Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Someone
Tuesday, December 5th, 2006 at 1:50:58am UTC 

  1. Index: bootloader/e200.c
  2. ===================================================================
  3. RCS file: /cvsroot/rockbox/bootloader/e200.c,v
  4. retrieving revision 1.5
  5. diff -u -r1.5 e200.c
  6. --- bootloader/e200.c   16 Oct 2006 17:21:30 -0000 1.5
  7. +++ bootloader/e200.c   5 Dec 2006 01:27:21 -0000
  8. @@ -5,9 +5,12 @@
  9.   *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
  10.   *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
  11.   *                     \/            \/     \/    \/            \/
  12. - * $Id: e200.c,v 1.5 2006-10-16 17:21:30 dan_a Exp $
  13. + * $Id: h10.c,v 1.4 2006-08-28 08:11:32 barrywardell Exp $
  14.   *
  15. - * Copyright (C) 2006 Daniel Stenberg
  16. + * Copyright (C) 2006 by Barry Wardell
  17. + *
  18. + * Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
  19. + * and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
  20.   *
  21.   * All files in this archive are subject to the GNU General Public License.
  22.   * See the file COPYING in the source tree root for full license agreement.
  23. @@ -32,63 +35,202 @@
  24.  #include "font.h"
  25.  #include "adc.h"
  26.  #include "backlight.h"
  27. +#include "button.h"
  28.  #include "panic.h"
  29.  #include "power.h"
  30.  #include "file.h"
  31.  
  32. -static inline void blink(void)
  33. +/* Size of the buffer to store the loaded Rockbox/Sansa image */
  34. +#define MAX_LOADSIZE (10*1024*1024)
  35. +
  36. +/* A buffer to load the iriver firmware or Rockbox into */
  37. +unsigned char loadbuffer[MAX_LOADSIZE];
  38. +
  39. +char version[] = APPSVERSION;
  40. +
  41. +#define DRAM_START              0x10000000
  42. +
  43. +int line=0;
  44. +
  45. +/* Load original Sandisk firmware. This function expects a file called
  46. +   "/.rockbox/OF.bin" on the player. It should be decrypted
  47. +   and have the header stripped using mi4code. It reads the file in to a memory
  48. +   buffer called buf. The rest of the loading is done in main() and crt0.S
  49. +*/
  50. +int load_sandisk(unsigned char* buf)
  51.  {
  52. -    volatile unsigned int* ptr;
  53. +    int fd;
  54. +    int rc;
  55. +    int len;
  56. +
  57. +    fd = open("/.rockbox/OF.bin", O_RDONLY);
  58. +
  59. +    len = filesize(fd);
  60. +
  61. +    if (len > MAX_LOADSIZE)
  62. +        return -6;
  63. +
  64. +    rc = read(fd, buf, len);
  65. +    if(rc < len)
  66. +        return -4;
  67. +
  68. +    close(fd);
  69. +    return len;
  70. +}
  71. +
  72. +/* Load Rockbox firmware (rockbox.e200) */
  73. +int load_rockbox(unsigned char* buf)
  74. +{
  75. +    int fd;
  76. +    int rc;
  77. +    int len;
  78. +    unsigned long chksum;
  79. +    char model[5];
  80. +    unsigned long sum;
  81.      int i;
  82. -    ptr = (volatile unsigned int*)0x70000020;
  83. +    char str[80];
  84.  
  85. -    *ptr &= ~(1 << 13);
  86. -    for(i = 0; i < 0xfffff; i++)
  87. +    fd = open("/.rockbox/" BOOTFILE, O_RDONLY);
  88. +    if(fd < 0)
  89.      {
  90. +        fd = open("/" BOOTFILE, O_RDONLY);
  91. +        if(fd < 0)
  92. +            return -1;
  93.      }
  94. -    *ptr |= (1 << 13);
  95. -    for(i = 0; i < 0xfffff; i++)
  96. -    {
  97. +
  98. +    len = filesize(fd) - 8;
  99. +
  100. +    snprintf(str, sizeof(str), "Length: %x", len);
  101. +    lcd_puts(0, line++ ,str);
  102. +    lcd_update();
  103. +
  104. +    if (len > MAX_LOADSIZE)
  105. +        return -6;
  106. +
  107. +    lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
  108. +
  109. +    rc = read(fd, &chksum, 4);
  110. +    chksum=betoh32(chksum); /* Rockbox checksums are big-endian */
  111. +    if(rc < 4)
  112. +        return -2;
  113. +
  114. +    snprintf(str, sizeof(str), "Checksum: %x", chksum);
  115. +    lcd_puts(0, line++ ,str);
  116. +    lcd_update();
  117. +
  118. +    rc = read(fd, model, 4);
  119. +    if(rc < 4)
  120. +        return -3;
  121. +
  122. +    model[4] = 0;
  123. +
  124. +    snprintf(str, sizeof(str), "Model name: %s", model);
  125. +    lcd_puts(0, line++ ,str);
  126. +    lcd_update();
  127. +
  128. +    lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);
  129. +
  130. +    rc = read(fd, buf, len);
  131. +    if(rc < len)
  132. +        return -4;
  133. +
  134. +    close(fd);
  135. +
  136. +    sum = MODEL_NUMBER;
  137. +
  138. +    for(i = 0;i < len;i++) {
  139. +        sum += buf[i];
  140.      }
  141. +
  142. +    snprintf(str, sizeof(str), "Sum: %x", sum);
  143. +    lcd_puts(0, line++ ,str);
  144. +    lcd_update();
  145. +
  146. +    if(sum != chksum)
  147. +        return -5;
  148. +
  149. +    return len;
  150.  }
  151.  
  152. -static inline void slow_blink(void)
  153. +void* main(void)
  154.  {
  155. -    volatile unsigned int* ptr;
  156. +    char buf[256];
  157.      int i;
  158. -    ptr = (volatile unsigned int*)0x70000020;
  159. +    int rc;
  160. +    unsigned short* identify_info;
  161. +    struct partinfo* pinfo;
  162.  
  163. -    *ptr &= ~(1 << 13);
  164. -    for(i = 0; i < (0xfffff); i++)
  165. -    {
  166. -    }
  167. -    for(i = 0; i < (0xfffff); i++)
  168. -    {
  169. -    }
  170. -    for(i = 0; i < (0xfffff); i++)
  171. -    {
  172. -    }
  173. +    system_init();
  174. +    kernel_init();
  175. +    lcd_init();
  176. +    font_init();
  177.  
  178. -    *ptr |= (1 << 13);
  179. -    for(i = 0; i < (0xfffff); i++)
  180. +    line=0;
  181. +
  182. +    lcd_setfont(FONT_SYSFIXED);
  183. +
  184. +    lcd_puts(0, line++, "Rockbox boot loader");
  185. +    snprintf(buf, sizeof(buf), "Version: 20%s", version);
  186. +    lcd_puts(0, line++, buf);
  187. +    snprintf(buf, sizeof(buf), "Sandisk Sansa E200");
  188. +    lcd_puts(0, line++, buf);
  189. +    lcd_update();
  190. +
  191. +    i=ata_init();
  192. +    if (i==0) {
  193. +      identify_info=ata_get_identify();
  194. +      /* Show model */
  195. +      for (i=0; i < 20; i++) {
  196. +        ((unsigned short*)buf)[i]=htobe16(identify_info[i+27]);
  197. +      }
  198. +      buf[40]=0;
  199. +      for (i=39; i && buf[i]==' '; i--) {
  200. +        buf[i]=0;
  201. +      }
  202. +      lcd_puts(0, line++, buf);
  203. +      lcd_update();
  204. +    } else {
  205. +      snprintf(buf, sizeof(buf), "ATA: %d", i);
  206. +      lcd_puts(0, line++, buf);
  207. +      lcd_update();
  208. +    }
  209. +
  210. +    disk_init();
  211. +    rc = disk_mount_all();
  212. +    if (rc<=0)
  213.      {
  214. +        lcd_puts(0, line++, "No partition found");
  215. +        lcd_update();
  216.      }
  217. -    for(i = 0; i < (0xfffff); i++)
  218. +
  219. +    pinfo = disk_partinfo(0);
  220. +    snprintf(buf, sizeof(buf), "Partition 0: 0x%02x %ld MB",
  221. +                  pinfo->type, pinfo->size / 2048);
  222. +    lcd_puts(0, line++, buf);
  223. +    lcd_update();
  224. +
  225. +    i=button_read_device();
  226. +    if(i==BUTTON_LEFT)
  227.      {
  228. +        lcd_puts(0, line, "Loading Sandisk firmware...");
  229. +        lcd_update();
  230. +        rc=load_sandisk(loadbuffer);
  231. +        /* Sandisk firmware doesn't like having the cache enabled */
  232. +    } else {
  233. +        lcd_puts(0, line, "Loading Rockbox...");
  234. +        lcd_update();
  235. +        rc=load_rockbox(loadbuffer);
  236.      }
  237. -    for(i = 0; i < (0xfffff); i++)
  238. -    {
  239. +
  240. +    if (rc < 0) {
  241. +            snprintf(buf, sizeof(buf), "Rockbox error: %d",rc);
  242. +            lcd_puts(0, line++, buf);
  243. +            lcd_update();
  244. +            while(1) {}
  245.      }
  246. -}
  247.  
  248. -static inline unsigned long get_pc(void)
  249. -{
  250. -    unsigned long pc;
  251. -    asm volatile (
  252. -        "mov %0, pc\n"
  253. -        : "=r"(pc)
  254. -    );
  255. -    return pc;
  256. +    memcpy((void*)DRAM_START,loadbuffer,rc);
  257. +    return (void*)DRAM_START;
  258.  }
  259.  
  260.  /* These functions are present in the firmware library, but we reimplement
  261. @@ -100,62 +242,7 @@
  262.  
  263.  int dbg_ports(void)
  264.  {
  265. -    unsigned int gpio_a, gpio_b, gpio_c, gpio_d;
  266. -    unsigned int gpio_e, gpio_f, gpio_g, gpio_h;
  267. -    unsigned int gpio_i, gpio_j, gpio_k, gpio_l;
  268. -
  269. -    char buf[128];
  270. -    int line;
  271. -
  272. -    lcd_setmargins(0, 0);
  273. -    lcd_clear_display();
  274. -    lcd_setfont(FONT_SYSFIXED);
  275. -
  276. -    while(1)
  277. -    {
  278. -        gpio_a = GPIOA_INPUT_VAL;
  279. -        gpio_b = GPIOB_INPUT_VAL;
  280. -        gpio_c = GPIOC_INPUT_VAL;
  281. -
  282. -        gpio_g = GPIOG_INPUT_VAL;
  283. -        gpio_h = GPIOH_INPUT_VAL;
  284. -        gpio_i = GPIOI_INPUT_VAL;
  285. -
  286. -        line = 0;
  287. -        snprintf(buf, sizeof(buf), "GPIO_A: %02x GPIO_G: %02x", gpio_a, gpio_g);
  288. -        lcd_puts(0, line++, buf);
  289. -        snprintf(buf, sizeof(buf), "GPIO_B: %02x GPIO_H: %02x", gpio_b, gpio_h);
  290. -        lcd_puts(0, line++, buf);
  291. -        snprintf(buf, sizeof(buf), "GPIO_C: %02x GPIO_I: %02x", gpio_c, gpio_i);
  292. -        lcd_puts(0, line++, buf);
  293. -        line++;
  294. -
  295. -        gpio_d = GPIOD_INPUT_VAL;
  296. -        gpio_e = GPIOE_INPUT_VAL;
  297. -        gpio_f = GPIOF_INPUT_VAL;
  298. -
  299. -        gpio_j = GPIOJ_INPUT_VAL;
  300. -        gpio_k = GPIOK_INPUT_VAL;
  301. -        gpio_l = GPIOL_INPUT_VAL;
  302. -
  303. -        snprintf(buf, sizeof(buf), "GPIO_D: %02x GPIO_J: %02x", gpio_d, gpio_j);
  304. -        lcd_puts(0, line++, buf);
  305. -        snprintf(buf, sizeof(buf), "GPIO_E: %02x GPIO_K: %02x", gpio_e, gpio_k);
  306. -        lcd_puts(0, line++, buf);
  307. -        snprintf(buf, sizeof(buf), "GPIO_F: %02x GPIO_L: %02x", gpio_f, gpio_l);
  308. -        lcd_puts(0, line++, buf);
  309. -        line++;
  310. -        snprintf(buf, sizeof(buf), "ADC_1: %02x", adc_read(ADC_0));
  311. -        lcd_puts(0, line++, buf);
  312. -        snprintf(buf, sizeof(buf), "ADC_2: %02x", adc_read(ADC_1));
  313. -        lcd_puts(0, line++, buf);
  314. -        snprintf(buf, sizeof(buf), "ADC_3: %02x", adc_read(ADC_2));
  315. -        lcd_puts(0, line++, buf);
  316. -        snprintf(buf, sizeof(buf), "ADC_4: %02x", adc_read(ADC_3));
  317. -        lcd_puts(0, line++, buf);
  318. -        lcd_update();
  319. -    }
  320. -    return 0;
  321. +   return 0;
  322.  }
  323.  
  324.  void mpeg_stop(void)
  325. @@ -173,18 +260,3 @@
  326.  void sys_poweroff(void)
  327.  {
  328.  }
  329. -
  330. -void system_reboot(void)
  331. -{
  332. -
  333. -}
  334. -
  335. -void main(void)
  336. -{
  337. -    kernel_init();
  338. -    adc_init();
  339. -    lcd_init_device();
  340. -
  341. -    dbg_ports();
  342. -}
  343. -
  344. Index: firmware/export/config-e200.h
  345. ===================================================================
  346. RCS file: /cvsroot/rockbox/firmware/export/config-e200.h,v
  347. retrieving revision 1.4
  348. diff -u -r1.4 config-e200.h
  349. --- firmware/export/config-e200.h       22 Nov 2006 00:49:15 -0000     1.4
  350. +++ firmware/export/config-e200.h       5 Dec 2006 01:27:24 -0000
  351. @@ -4,7 +4,7 @@
  352.  #define TARGET_TREE /* this target is using the target tree system */
  353.  
  354.  /* For Rolo and boot loader */
  355. -#define MODEL_NUMBER 12
  356. +#define MODEL_NUMBER 16
  357.  
  358.  /* define this if you have recording possibility */
  359.  /*#define HAVE_RECORDING 1*/ /* TODO: add support for this */
  360. Index: firmware/target/arm/crt0-pp.S
  361. ===================================================================
  362. RCS file: /cvsroot/rockbox/firmware/target/arm/crt0-pp.S,v
  363. retrieving revision 1.2
  364. diff -u -r1.2 crt0-pp.S
  365. --- firmware/target/arm/crt0-pp.S       22 Nov 2006 00:49:16 -0000     1.2
  366. +++ firmware/target/arm/crt0-pp.S       5 Dec 2006 01:27:24 -0000
  367. @@ -5,7 +5,7 @@
  368.   *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
  369.   *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
  370.   *                     \/            \/     \/    \/            \/
  371. - * $Id: crt0-pp.S,v 1.2 2006-11-22 00:49:16 dan_a Exp $
  372. + * $Id: crt0-pp.S,v 1.2 2006/11/22 00:49:16 dan_a Exp $
  373.   *
  374.   * Copyright (C) 2002 by Linus Nielsen Feltzing
  375.   *
  376. @@ -52,17 +52,36 @@
  377.  
  378.      msr    cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
  379.  
  380. -#ifndef BOOTLOADER
  381.      b      pad_skip
  382.  
  383. -#if defined(SANSA_E200)
  384. -/* mi4tool writes junk between 0xe0 and 0xeb.  Avoid this. */
  385. -.space 60*4 /* (more than enough) space for exception vectors */
  386. -#else
  387. -.space 50*4
  388. -#endif
  389. +.space 60*4 /* For bootloader builds on targets with mi4 firmware, scramble
  390. +               writes data to 0xe0-0xeb, so jump past that. For normal builds
  391. +               this provides more than enough space for exception vectors */
  392.  
  393.  pad_skip:
  394. +
  395. +#ifdef BOOTLOADER
  396. +/* 1 - Copy the bootloader to IRAM */
  397. +    /* get the high part of our execute address */
  398. +    and    r4, pc, #0xff000000
  399. +
  400. +    /* Copy bootloader to safe area - 0x40000000 */
  401. +    mov    r5, #0x40000000
  402. +    ldr    r6, = _dataend
  403. +    sub    r0, r6, r5       /* length of loader */
  404. +    add    r8, r4, r0       /* r8 points to start of loader */
  405. +1:
  406. +    cmp    r5, r6
  407. +    ldrcc  r2, [r4], #4
  408. +    strcc  r2, [r5], #4
  409. +    bcc    1b
  410. +
  411. +/* 2 - Jump both CPU and COP there */
  412. +    ldr    pc, =start_loc    /* jump to the relocated start_loc:  */
  413. +
  414. +start_loc:
  415. +
  416. +#else /* BOOTLOADER */
  417.  #ifdef SANSA_E200
  418.      /* On the Sansa, copying the vectors fails if the cache is initialised */
  419.      ldr    r1, =CACHE_CTRL
  420. @@ -106,24 +125,63 @@
  421.  L_post_remap: .word remap_end
  422.  remap_end:
  423.  
  424. -    /* After doing the remapping, send the COP to sleep.
  425. -       On wakeup it will go to cop_init */
  426. +#endif
  427. +
  428. +    /* Send the COP to sleep. On wakeup it will go to cop_init */
  429.      ldr    r0, =PROC_ID
  430.      ldr    r0, [r0]
  431.      and    r0, r0, #0xff
  432.      cmp    r0, #0x55
  433. -    beq    1f
  434. +    beq    cpu
  435.      
  436.      /* put us (co-processor) to sleep */
  437.      ldr    r4, =COP_CTRL
  438.      mov    r3, #SLEEP
  439.      str    r3, [r4]
  440. +    ldr    pc, =cop_wake_start
  441.  
  442. -    ldr    pc, =cop_init
  443. +cop_wake_start:
  444. +    /* COP: Invalidate cache */
  445. +    ldr    r0, =0xf000f044
  446. +    ldr    r1, [r0]
  447. +    orr    r1, r1, #0x6
  448. +    str    r1, [r0]
  449.  
  450. +    ldr    r0, =0x6000c000
  451.  1:
  452. +    ldr    r1, [r0]
  453. +    tst    r1, #0x8000
  454. +    bne    1b
  455. +   
  456. +#ifdef BOOTLOADER
  457. +    ldr    r0, =startup_loc
  458. +    ldr    pc, [r0]
  459. +#else
  460. +    /* Setup stack for COP */
  461. +    ldr    sp, =cop_stackend
  462. +    mov    r3, sp
  463. +    ldr    r2, =cop_stackbegin
  464. +    ldr    r4, =0xdeadbeef
  465. +2:
  466. +    cmp    r3, r2
  467. +    strhi  r4, [r2], #4
  468. +    bhi    2b
  469.  
  470. -#ifndef DEBUG
  471. +    ldr    sp, =cop_stackend
  472. +   
  473. +    /* Run cop_main() in apps/main.c */
  474. +    bl     cop_main
  475. +#endif
  476. +
  477. +cpu:
  478. +    /* Wait for COP to be sleeping */
  479. +    ldr    r4, =COP_STATUS
  480. +1:
  481. +    ldr    r3, [r4]
  482. +    ands   r3, r3, #SLEEPING
  483. +    beq    1b
  484. +   
  485. +#ifndef BOOTLOADER
  486.      /* Copy exception handler code to address 0 */
  487.      ldr    r2, =_vectorsstart
  488.      ldr    r3, =_vectorsend
  489. @@ -133,24 +191,18 @@
  490.      ldrhi  r5, [r4], #4
  491.      strhi  r5, [r2], #4
  492.      bhi    1b
  493. -#else
  494. -    ldr    r1, =vectors
  495. -    ldr    r0, =irq_handler
  496. -    str    r0, [r1, #24]
  497. -    ldr    r0, =fiq_handler
  498. -    str    r0, [r1, #28]
  499.  #endif
  500.  
  501. -#ifndef STUB
  502. -    /* Zero out IBSS */
  503. -    ldr    r2, =_iedata
  504. -    ldr    r3, =_iend
  505. +    /* Initialise bss section to zero */
  506. +    ldr    r2, =_edata
  507. +    ldr    r3, =_end
  508.      mov    r4, #0
  509.  1:
  510.      cmp    r3, r2
  511.      strhi  r4, [r2], #4
  512.      bhi    1b
  513. -
  514. +       
  515. +#ifndef BOOTLOADER
  516.      /* Copy the IRAM */
  517.      ldr    r2, =_iramcopy
  518.      ldr    r3, =_iramstart
  519. @@ -160,18 +212,8 @@
  520.      ldrhi  r5, [r2], #4
  521.      strhi  r5, [r3], #4
  522.      bhi    1b
  523. -#endif /* !STUB */
  524. -#endif /* !BOOTLOADER */
  525. +#endif
  526.  
  527. -    /* Initialise bss section to zero */
  528. -    ldr    r2, =_edata
  529. -    ldr    r3, =_end
  530. -    mov    r4, #0
  531. -1:
  532. -    cmp    r3, r2
  533. -    strhi  r4, [r2], #4
  534. -    bhi    1b
  535. -   
  536.      /* Set up some stack and munge it with 0xdeadbeef */
  537.      ldr    sp, =stackend
  538.      mov    r3, sp
  539. @@ -183,76 +225,31 @@
  540.      bhi    1b
  541.  
  542.  #ifdef BOOTLOADER
  543. -    /* TODO: the high part of the address is probably dependent on CONFIG_CPU.
  544. -       Since we tend to use ifdefs for each chipset target
  545. -       anyway, we might as well just hardcode it here.
  546. -     */
  547. -       
  548. -    /* get the high part of our execute address */
  549. -    ldr    r0, =0xff000000
  550. -    and    r8, pc, r0             @ r8 is used later
  551. -
  552. -    /* Find out which processor we are */
  553. -    mov    r0, #PROC_ID
  554. -    ldr    r0, [r0]
  555. -    and    r0, r0, #0xff
  556. -    cmp    r0, #0x55
  557. -    beq    1f
  558. -
  559. -    /* put us (co-processor) to sleep */
  560. -    ldr    r4, =COP_CTRL
  561. -    mov    r3, #SLEEP
  562. -    str    r3, [r4]
  563. -    ldr    pc, =cop_wake_start
  564. -
  565. -cop_wake_start:
  566. -    /* jump the COP to startup */
  567. -    ldr    r0, =startup_loc
  568. -    ldr    pc, [r0]
  569. -
  570. -1:
  571. -   
  572. -    /* get the high part of our execute address */
  573. -    ldr    r2, =0xffffff00
  574. -    and    r4, pc, r2
  575. -
  576. -    /* Copy bootloader to safe area - 0x40000000 */
  577. -    mov    r5, #0x40000000
  578. -    ldr    r6, = _dataend
  579. -    sub    r0, r6, r5       /* length of loader */
  580. -    add    r0, r4, r0     /* r0 points to start of loader */
  581. -1:
  582. -    cmp    r5, r6
  583. -    ldrcc  r2, [r4], #4
  584. -    strcc  r2, [r5], #4
  585. -    bcc    1b
  586. -
  587. -    ldr    pc, =start_loc    /* jump to the relocated start_loc:  */
  588. -   
  589. -start_loc:
  590. +    mov    r0, r8 /* r8 holds the start of the loader - copy this to r0 */
  591.  
  592.      /* execute the loader - this will load an image to 0x10000000 */
  593.      bl     main
  594.  
  595. -    /* Wake up the coprocessor before executing the firmware */
  596. -
  597. -    /* save the startup address for the COP */
  598.      ldr    r1, =startup_loc
  599.      str    r0, [r1]
  600.  
  601. -    /* make sure COP is sleeping */
  602. -    ldr    r4, =COP_STATUS
  603. +    /* Flush cache */
  604. +    ldr    r3, =0xf000f044
  605. +    ldr    r4, [r3]
  606. +    orr    r4, r4, #0x2
  607. +    str    r4, [r3]
  608. +
  609. +    ldr    r3, =0x6000c000
  610.  1:
  611. -    ldr    r3, [r4]
  612. -    ands   r3, r3, #SLEEPING
  613. -    beq    1b
  614. +    ldr    r4, [r3]
  615. +    tst    r4, #0x8000
  616. +    bne    1b
  617.  
  618. -    /* wake up COP */
  619. +    /* Wake up the coprocessor before executing the firmware */
  620.      ldr    r4, =COP_CTRL
  621.      mov    r3, #WAKE
  622.      str    r3, [r4]
  623.  
  624. -    /* jump to start location */
  625.      mov    pc, r0
  626.  
  627.  startup_loc:
  628. @@ -265,7 +262,7 @@
  629.      .space 400
  630.  
  631.  #else /* BOOTLOADER */
  632. -   
  633. +
  634.      /* Set up stack for IRQ mode */
  635.      msr    cpsr_c, #0xd2
  636.      ldr    sp, =irq_stack
  637. @@ -288,19 +285,6 @@
  638.      ldr    sp, =stackend
  639.      bl     main
  640.      /* main() should never return */
  641. -
  642. -cop_init:
  643. -    ldr    sp, =cop_stackend
  644. -    mov    r3, sp
  645. -    ldr    r2, =cop_stackbegin
  646. -    ldr    r4, =0xdeadbeef
  647. -2:
  648. -    cmp    r3, r2
  649. -    strhi  r4, [r2], #4
  650. -    bhi    2b
  651. -
  652. -    ldr    sp, =cop_stackend
  653. -    bl     cop_main
  654.      
  655.  /* Exception handlers. Will be copied to address 0 after memory remapping */
  656.      .section .vectors,"aw"
  657. @@ -385,5 +369,4 @@
  658.  /* 256 words of FIQ stack */
  659.      .space 256*4
  660.  fiq_stack:
  661. -
  662. -#endif /* BOOTLOADER */
  663. +#endif /* BOOTLOADER */
  664. Index: tools/configure
  665. ===================================================================
  666. RCS file: /cvsroot/rockbox/tools/configure,v
  667. retrieving revision 1.245
  668. diff -u -r1.245 configure
  669. --- tools/configure     27 Nov 2006 02:15:39 -0000   1.245
  670. +++ tools/configure     5 Dec 2006 01:27:27 -0000
  671. @@ -1115,10 +1115,10 @@
  672.      target="-DSANSA_E200"
  673.      memory=32 # supposedly
  674.      arm7tdmicc
  675. -    tool="$rootdir/tools/scramble -mi4v3"
  676. +    tool="$rootdir/tools/scramble -add=e200"
  677.      bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
  678.      bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
  679. -    output="PP5022.mi4"
  680. +    output="rockbox.e200"
  681.      appextra="recorder:gui"
  682.      archosrom=""
  683.      flash=""
  684. Index: tools/scramble.c
  685. ===================================================================
  686. RCS file: /cvsroot/rockbox/tools/scramble.c,v
  687. retrieving revision 1.35
  688. diff -u -r1.35 scramble.c
  689. --- tools/scramble.c    31 Aug 2006 19:19:35 -0000  1.35
  690. +++ tools/scramble.c    5 Dec 2006 01:27:28 -0000
  691. @@ -89,7 +89,7 @@
  692.             "\t-mi4v3  PortalPlayer .mi4 format (revision 010301)\n"
  693.             "\t-add=X  Rockbox generic \"add-up\" checksum format\n"
  694.             "\t        (X values: h100, h120, h140, h300, ipco, nano, ipvd\n"
  695. -           "\t                   ip3g, ip4g, mini, x5, h10, h10_5gb)\n"
  696. +           "\t                   ip3g, ip4g, mini, x5, h10, h10_5gb, tpj2, e200)\n"
  697.             "\nNo option results in Archos standard player/recorder format.\n");
  698.  
  699.      exit(1);
  700. @@ -207,6 +207,8 @@
  701.              modelnum = 14;
  702.          else if(!strcmp(&argv[1][5], "tpj2"))
  703.              modelnum = 15;
  704. +        else if(!strcmp(&argv[1][5], "e200"))
  705. +            modelnum = 16;
  706.          else {
  707.              fprintf(stderr, "unsupported model: %s\n", &argv[1][5]);
  708.              return 2;

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right