summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES13
-rw-r--r--firmware/drivers/ata.c10
-rw-r--r--firmware/export/config/xduoox3.h4
-rw-r--r--firmware/target/arm/s5l8702/nor-target.h28
-rw-r--r--firmware/target/hosted/lcd-linuxfb.c24
-rw-r--r--firmware/target/hosted/samsungypr/lcd-ypr.c14
-rw-r--r--firmware/target/mips/ingenic_jz47xx/app.lds8
-rw-r--r--firmware/target/mips/ingenic_jz47xx/crt0.S2
8 files changed, 64 insertions, 39 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index e827f964f5..4e6fcbf70c 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -94,14 +94,12 @@ target/hosted/filesystem-unix.c
94target/hosted/filesystem-app.c 94target/hosted/filesystem-app.c
95#endif /* APPLICATION */ 95#endif /* APPLICATION */
96 96
97#if defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) 97#if (defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1)) && !defined(SIMULATOR)
98target/hosted/kernel-unix.c 98target/hosted/kernel-unix.c
99target/hosted/filesystem-unix.c 99target/hosted/filesystem-unix.c
100#ifndef SIMULATOR
101target/hosted/lc-unix.c 100target/hosted/lc-unix.c
102drivers/lcd-memframe.c 101drivers/lcd-memframe.c
103target/hosted/samsungypr/lcd-ypr.c 102target/hosted/samsungypr/lcd-ypr.c
104#endif
105target/hosted/samsungypr/gpio-ypr.c 103target/hosted/samsungypr/gpio-ypr.c
106#if CONFIG_TUNER 104#if CONFIG_TUNER
107target/hosted/samsungypr/radio-ypr.c 105target/hosted/samsungypr/radio-ypr.c
@@ -1568,6 +1566,9 @@ target/arm/s5l8702/clocking-s5l8702.c
1568target/arm/s5l8702/ipod6g/lcd-6g.c 1566target/arm/s5l8702/ipod6g/lcd-6g.c
1569target/arm/s5l8702/ipod6g/lcd-asm-6g.S 1567target/arm/s5l8702/ipod6g/lcd-asm-6g.S
1570target/arm/s5l8702/ipod6g/piezo-6g.c 1568target/arm/s5l8702/ipod6g/piezo-6g.c
1569target/arm/s5l8702/spi-s5l8702.c
1570target/arm/s5l8702/crypto-s5l8702.c
1571target/arm/s5l8702/nor-s5l8702.c
1571#if 0 //TODO 1572#if 0 //TODO
1572target/arm/s5l8702/postmortemstub.S 1573target/arm/s5l8702/postmortemstub.S
1573#endif 1574#endif
@@ -1587,10 +1588,6 @@ target/arm/s5l8702/debug-s5l8702.c
1587target/arm/s5l8702/pcm-s5l8702.c 1588target/arm/s5l8702/pcm-s5l8702.c
1588target/arm/s5l8702/ipod6g/audio-6g.c 1589target/arm/s5l8702/ipod6g/audio-6g.c
1589target/arm/s5l8702/ipod6g/cscodec-6g.c 1590target/arm/s5l8702/ipod6g/cscodec-6g.c
1590#else
1591target/arm/s5l8702/spi-s5l8702.c
1592target/arm/s5l8702/crypto-s5l8702.c
1593target/arm/s5l8702/nor-s5l8702.c
1594#endif /* BOOTLOADER */ 1591#endif /* BOOTLOADER */
1595#endif /* IPOD_6G */ 1592#endif /* IPOD_6G */
1596 1593
@@ -1649,9 +1646,9 @@ target/mips/ingenic_jz47xx/kernel-jz4760.c
1649target/mips/ingenic_jz47xx/i2c-jz4760.c 1646target/mips/ingenic_jz47xx/i2c-jz4760.c
1650target/mips/ingenic_jz47xx/lcd-jz4760.c 1647target/mips/ingenic_jz47xx/lcd-jz4760.c
1651target/mips/ingenic_jz47xx/system-jz4760.c 1648target/mips/ingenic_jz47xx/system-jz4760.c
1652target/mips/ingenic_jz47xx/usb-jz4760.c
1653target/mips/ingenic_jz47xx/timer-jz4760.c 1649target/mips/ingenic_jz47xx/timer-jz4760.c
1654#ifndef BOOTLOADER 1650#ifndef BOOTLOADER
1651target/mips/ingenic_jz47xx/usb-jz4760.c
1655target/mips/ingenic_jz47xx/codec-jz4760.c 1652target/mips/ingenic_jz47xx/codec-jz4760.c
1656target/mips/ingenic_jz47xx/pcm-jz4760.c 1653target/mips/ingenic_jz47xx/pcm-jz4760.c
1657#endif /* BOOTLOADER */ 1654#endif /* BOOTLOADER */
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index b245cbc09e..d82fb173cc 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -962,8 +962,8 @@ static int perform_soft_reset(void)
962 if (identify()) 962 if (identify())
963 return -5; 963 return -5;
964 964
965 if (set_features()) 965 if ((ret = set_features()))
966 return -2; 966 return -60 + ret;
967 967
968 if (set_multiple_mode(multisectors)) 968 if (set_multiple_mode(multisectors))
969 return -3; 969 return -3;
@@ -1013,7 +1013,7 @@ static int ata_power_on(void)
1013 1013
1014 rc = set_features(); 1014 rc = set_features();
1015 if (rc) 1015 if (rc)
1016 return rc * 10 - 2; 1016 return -60 + rc;
1017 1017
1018 if (set_multiple_mode(multisectors)) 1018 if (set_multiple_mode(multisectors))
1019 return -3; 1019 return -3;
@@ -1284,7 +1284,7 @@ int STORAGE_INIT_ATTR ata_init(void)
1284 goto error; 1284 goto error;
1285 } 1285 }
1286 1286
1287 rc = set_features(); 1287 rc = set_features(); // rror codes are between -1 and -49
1288 if (rc) { 1288 if (rc) {
1289 rc = -60 + rc; 1289 rc = -60 + rc;
1290 goto error; 1290 goto error;
@@ -1321,7 +1321,7 @@ int STORAGE_INIT_ATTR ata_init(void)
1321 } 1321 }
1322 rc = set_multiple_mode(multisectors); 1322 rc = set_multiple_mode(multisectors);
1323 if (rc) 1323 if (rc)
1324 rc = -70 + rc; 1324 rc = -100 + rc;
1325 1325
1326error: 1326error:
1327 mutex_unlock(&ata_mtx); 1327 mutex_unlock(&ata_mtx);
diff --git a/firmware/export/config/xduoox3.h b/firmware/export/config/xduoox3.h
index 46e1a61712..0d413ad372 100644
--- a/firmware/export/config/xduoox3.h
+++ b/firmware/export/config/xduoox3.h
@@ -174,6 +174,7 @@
174/* Type of LCD */ 174/* Type of LCD */
175#define CONFIG_LCD LCD_XDUOOX3 175#define CONFIG_LCD LCD_XDUOOX3
176 176
177#ifndef BOOTLOADER
177/* USB On-the-go */ 178/* USB On-the-go */
178#define CONFIG_USBOTG USBOTG_JZ4760 179#define CONFIG_USBOTG USBOTG_JZ4760
179 180
@@ -189,6 +190,7 @@
189 190
190#define USB_NUM_ENDPOINTS 3 191#define USB_NUM_ENDPOINTS 3
191#define USB_DEVBSS_ATTR IBSS_ATTR 192#define USB_DEVBSS_ATTR IBSS_ATTR
193#endif /* !BOOTLOADER */
192 194
193#define BOOTFILE_EXT "x3" 195#define BOOTFILE_EXT "x3"
194#define BOOTFILE "rockbox." BOOTFILE_EXT 196#define BOOTFILE "rockbox." BOOTFILE_EXT
@@ -198,7 +200,7 @@
198 200
199#define ICODE_ATTR_TREMOR_NOT_MDCT 201#define ICODE_ATTR_TREMOR_NOT_MDCT
200 202
201#endif /* SIMULATOR */ 203#endif /* !SIMULATOR */
202 204
203/** Port-specific settings **/ 205/** Port-specific settings **/
204 206
diff --git a/firmware/target/arm/s5l8702/nor-target.h b/firmware/target/arm/s5l8702/nor-target.h
index 4ebe1d58d4..3d2790d123 100644
--- a/firmware/target/arm/s5l8702/nor-target.h
+++ b/firmware/target/arm/s5l8702/nor-target.h
@@ -87,6 +87,34 @@ int bootflash_compare(int port, int offset, void* addr, int size);
87void bootflash_erase_blocks(int port, int first, int n); 87void bootflash_erase_blocks(int port, int first, int n);
88void bootflash_close(int port); 88void bootflash_close(int port);
89 89
90/*
91 * SysCfg
92 */
93struct SysCfgHeader {
94 uint32_t magic; // always 'SCfg'
95 uint32_t size;
96 uint32_t unknown1; // 0x00000200 on iPod classic
97 uint32_t version; // maybe? 0x00010001 on iPod classic
98 uint32_t unknown2; // 0x00000000 on iPod classic
99 uint32_t num_entries;
100}; // 0x18
101
102struct SysCfgEntry {
103 uint32_t tag;
104 uint8_t data[0x10];
105};
106
107#define SYSCFG_MAGIC 0x53436667 // SCfg
108
109#define SYSCFG_TAG_SRNM 0x53724e6d // SrNm
110#define SYSCFG_TAG_FWID 0x46774964 // FwId
111#define SYSCFG_TAG_HWID 0x48774964 // HwId
112#define SYSCFG_TAG_HWVR 0x48775672 // HwVr
113#define SYSCFG_TAG_CODC 0x436f6463 // Codc
114#define SYSCFG_TAG_SWVR 0x53775672 // SwVr
115#define SYSCFG_TAG_MLBN 0x4d4c424e // MLBN
116#define SYSCFG_TAG_MODN 0x4d6f6423 // Mod#
117#define SYSCFG_TAG_REGN 0x5265676e // Regn
90 118
91/* 119/*
92 * IM3 120 * IM3
diff --git a/firmware/target/hosted/lcd-linuxfb.c b/firmware/target/hosted/lcd-linuxfb.c
index 14c8c30f89..5dda5cf1cc 100644
--- a/firmware/target/hosted/lcd-linuxfb.c
+++ b/firmware/target/hosted/lcd-linuxfb.c
@@ -59,14 +59,21 @@ void lcd_init_device(void)
59 panicf("Cannot read framebuffer fixed information"); 59 panicf("Cannot read framebuffer fixed information");
60 } 60 }
61 61
62#if 0 62 if(ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0)
63 /* check resolution and framebuffer size */
64 if(vinfo.xres != LCD_WIDTH || vinfo.yres != LCD_HEIGHT || vinfo.bits_per_pixel != LCD_DEPTH)
65 { 63 {
66 panicf("Unexpected framebuffer resolution: %dx%dx%d\n", vinfo.xres, 64 panicf("Cannot read framebuffer variable information");
67 vinfo.yres, vinfo.bits_per_pixel); 65 }
66
67 /* Make sure we match our desired bitdepth */
68 if (vinfo.bits_per_pixel != LCD_DEPTH || vinfo.xres != LCD_WIDTH || vinfo.yres != LCD_HEIGHT) {
69 vinfo.bits_per_pixel = LCD_DEPTH;
70 vinfo.xres = LCD_WIDTH;
71 vinfo.yres = LCD_HEIGHT;
72 if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo)) {
73 panicf("Cannot set framebuffer to %dx%dx%d",
74 vinfo.xres, vinfo.yres, vinfo.bits_per_pixel);
75 }
68 } 76 }
69#endif
70 /* Note: we use a framebuffer size of width*height*bbp. We cannot trust the 77 /* Note: we use a framebuffer size of width*height*bbp. We cannot trust the
71 * values returned by the driver for line_length */ 78 * values returned by the driver for line_length */
72 79
@@ -77,11 +84,6 @@ void lcd_init_device(void)
77 panicf("Cannot map framebuffer"); 84 panicf("Cannot map framebuffer");
78 } 85 }
79 86
80 if(ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) < 0)
81 {
82 panicf("Cannot read framebuffer variable information");
83 }
84
85 memset(framebuffer, 0, finfo.smem_len); 87 memset(framebuffer, 0, finfo.smem_len);
86 88
87#ifdef HAVE_LCD_ENABLE 89#ifdef HAVE_LCD_ENABLE
diff --git a/firmware/target/hosted/samsungypr/lcd-ypr.c b/firmware/target/hosted/samsungypr/lcd-ypr.c
index b8db2eedd1..035abaeba7 100644
--- a/firmware/target/hosted/samsungypr/lcd-ypr.c
+++ b/firmware/target/hosted/samsungypr/lcd-ypr.c
@@ -66,17 +66,17 @@ void lcd_init_device(void)
66 exit(2); 66 exit(2);
67 } 67 }
68 68
69 /* Now we get the settable settings, and we set 16 bit bpp */ 69 /* Now we get the settable settings */
70 if (ioctl(dev_fd, FBIOGET_VSCREENINFO, &vinfo) == -1) { 70 if (ioctl(dev_fd, FBIOGET_VSCREENINFO, &vinfo) == -1) {
71 perror("Error reading variable information"); 71 perror("Error reading variable information");
72 exit(3); 72 exit(3);
73 } 73 }
74 74
75 vinfo.bits_per_pixel = LCD_DEPTH; 75 vinfo.bits_per_pixel = LCD_DEPTH; /* Explicitly set our desired depth */
76 76
77 if (ioctl(dev_fd, FBIOPUT_VSCREENINFO, &vinfo)) { 77 if (ioctl(dev_fd, FBIOPUT_VSCREENINFO, &vinfo)) {
78 perror("fbset(ioctl)"); 78 perror("fbset(ioctl)");
79 exit(4); 79 exit(4);
80 } 80 }
81 81
82 printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel); 82 printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel);
@@ -84,17 +84,17 @@ void lcd_init_device(void)
84 /* Figure out the size of the screen in bytes */ 84 /* Figure out the size of the screen in bytes */
85 screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8; 85 screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
86 if (screensize != FRAMEBUFFER_SIZE) { 86 if (screensize != FRAMEBUFFER_SIZE) {
87 exit(4);
88 perror("Display and framebuffer mismatch!\n"); 87 perror("Display and framebuffer mismatch!\n");
88 exit(5);
89 } 89 }
90 90
91 /* Map the device to memory */ 91 /* Map the device to memory */
92 dev_fb = mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, dev_fd, 0); 92 dev_fb = mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, dev_fd, 0);
93 if ((int)dev_fb == -1) { 93 if ((int)dev_fb == -1) {
94 perror("Error: failed to map framebuffer device to memory"); 94 perror("Error: failed to map framebuffer device to memory");
95 exit(4); 95 exit(6);
96 } 96 }
97 printf("The framebuffer device was mapped to memory successfully.\n"); 97 printf("Framebuffer device successfully mapped into memory.\n");
98 98
99 /* Be sure to turn on display at startup */ 99 /* Be sure to turn on display at startup */
100 ioctl(dev_fd, FBIOBLANK, VESA_NO_BLANKING); 100 ioctl(dev_fd, FBIOBLANK, VESA_NO_BLANKING);
diff --git a/firmware/target/mips/ingenic_jz47xx/app.lds b/firmware/target/mips/ingenic_jz47xx/app.lds
index 1d300fed82..29a973a0ca 100644
--- a/firmware/target/mips/ingenic_jz47xx/app.lds
+++ b/firmware/target/mips/ingenic_jz47xx/app.lds
@@ -37,15 +37,11 @@ SECTIONS
37{ 37{
38 . = DRAMORIG; 38 . = DRAMORIG;
39 39
40 .startup : 40 .text :
41 { 41 {
42 loadaddress = .; 42 loadaddress = .;
43 _loadaddress = .; 43 _loadaddress = .;
44 *(.startup.text); 44 *(.init.text);
45 } > DRAM
46
47 .text :
48 {
49 *(.text*); 45 *(.text*);
50#ifndef HAVE_INIT_ATTR 46#ifndef HAVE_INIT_ATTR
51 *(.init*); 47 *(.init*);
diff --git a/firmware/target/mips/ingenic_jz47xx/crt0.S b/firmware/target/mips/ingenic_jz47xx/crt0.S
index b73a43d8f2..ee203b3b4d 100644
--- a/firmware/target/mips/ingenic_jz47xx/crt0.S
+++ b/firmware/target/mips/ingenic_jz47xx/crt0.S
@@ -44,7 +44,7 @@
44 .extern main 44 .extern main
45 .global _start 45 .global _start
46 46
47 .section .startup.text,"ax",%progbits 47 .section .init.text
48 .set push 48 .set push
49 .set mips32 49 .set mips32
50 .set noreorder 50 .set noreorder