Changeset 4108


Ignore:
Timestamp:
02/24/08 23:26:25 (5 years ago)
Author:
werner
Message:

When booting from NOR, u-boot did not check whether we are resuming.
This patch moves this code to a common function which is called in the
NOR and NAND boot path (but not when booting from RAM).

cpu/arm920t/start.S is a very busy file, so a number of other patches
had to be refreshed.

uboot-neo1973-resume.patch:

  • cpu/arm920t/start.S: moved resume detection from NAND-specific code to general function

uboot-s3c2440.patch, uboot-s3c2442.patch, uboot-s3c2443.patch:

refreshed for above change

Location:
trunk/src/target/u-boot/patches
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/u-boot/patches/uboot-neo1973-resume.patch

    r2796 r4108  
    77--- u-boot.orig/cpu/arm920t/start.S 
    88+++ u-boot/cpu/arm920t/start.S 
    9 @@ -223,18 +223,68 @@ 
     9@@ -181,18 +181,68 @@ copyex: 
    1010        str     r1, [r0] 
    1111 # endif 
     
    7676-#endif 
    7777  
    78  #ifdef CONFIG_AT91RM9200 
    79  #ifdef CONFIG_BOOTBINFUNC 
    80 @@ -292,9 +342,33 @@ 
     78 #if defined(CONFIG_AT91RM9200) || defined(CONFIG_S3C2410) 
     79  
     80@@ -210,10 +260,8 @@ copyex: 
     81 #endif /* CONFIG_S3C2410_NAND_BOOT */ 
     82  
     83 relocate:                              /* relocate U-Boot to RAM           */ 
     84-#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY) 
     85        teq     r0, #0                  /* running at address 0 ?           */ 
     86-       bleq    cpu_init_crit           /* yes -> do low-level setup        */ 
     87-#endif /* !CONFIG_SKIP_LOWLEVEL_INIT && CONFIG_LL_INIT_NAND_ONLY */ 
     88+       bleq    may_resume              /* yes -> do low-level setup        */ 
     89  
     90        adr     r0, _start              /* the above may have clobbered r0  */ 
     91  
     92@@ -239,11 +287,7 @@ _done_relocate: 
    8193  
    8294 #ifdef CONFIG_S3C2410_NAND_BOOT 
    8395 nand_load: 
     96-#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY) 
     97-       bl      cpu_init_crit 
     98-#endif 
     99- 
     100-       /* mov  r10, lr */ 
     101+       bl      may_resume              /* low-level setup and resume */ 
     102  
     103        @ reset NAND 
     104        mov     r1, #S3C2410_NAND_BASE 
     105@@ -398,6 +442,51 @@ cpu_init_crit: 
     106        mov     pc, lr 
     107 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ 
     108  
     109+ 
     110+/* 
     111+ ************************************************************************* 
     112+ * 
     113+ * may_resume 
     114+ * 
     115+ * Bring up memory and check if we're coming out of suspend. 
     116+ * 
     117+ ************************************************************************* 
     118+ */ 
     119+ 
     120+ 
     121+may_resume: 
     122+       mov     r10, lr                 /* we may call cpu_init_crit */ 
     123+ 
    84124+       /* take sdram out of power down */ 
    85125+       ldr     r0, =0x56000080         /* misccr */ 
     
    93133+       bpl     1b 
    94134+ 
    95  #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY) 
    96         bl      cpu_init_crit 
    97  #endif 
     135+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY) 
     136+       bl      cpu_init_crit 
     137+#endif 
    98138+#if defined(CONFIG_S3C2410) 
    99139+       /* ensure some refresh has happened */ 
     
    109149+#endif /* CONFIG_S3C2410 */ 
    110150+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */ 
    111   
    112         /* mov  r10, lr */ 
    113   
     151+ 
     152+       mov     pc, r10 
     153+ 
     154 /* 
     155  ************************************************************************* 
     156  * 
  • trunk/src/target/u-boot/patches/uboot-s3c2440.patch

    r3564 r4108  
    55--- u-boot.orig/include/s3c24x0.h 
    66+++ u-boot/include/s3c24x0.h 
    7 @@ -82,7 +82,7 @@ 
     7@@ -82,7 +82,7 @@ typedef struct { 
    88        S3C24X0_REG32   PRIORITY; 
    99        S3C24X0_REG32   INTPND; 
     
    1414        S3C24X0_REG32   INTSUBMSK; 
    1515 #endif 
    16 @@ -92,11 +92,11 @@ 
     16@@ -92,11 +92,11 @@ typedef struct { 
    1717 /* DMAS (see manual chapter 8) */ 
    1818 typedef struct { 
     
    2828 #endif 
    2929        S3C24X0_REG32   DCON; 
    30 @@ -107,7 +107,7 @@ 
     30@@ -107,7 +107,7 @@ typedef struct { 
    3131 #ifdef CONFIG_S3C2400 
    3232        S3C24X0_REG32   res[1]; 
     
    3737 #endif 
    3838 } /*__attribute__((__packed__))*/ S3C24X0_DMA; 
    39 @@ -126,6 +126,9 @@ 
     39@@ -126,6 +126,9 @@ typedef struct { 
    4040        S3C24X0_REG32   CLKCON; 
    4141        S3C24X0_REG32   CLKSLOW; 
     
    4747  
    4848  
    49 @@ -145,7 +148,7 @@ 
     49@@ -145,7 +148,7 @@ typedef struct { 
    5050        S3C24X0_REG32   res[8]; 
    5151        S3C24X0_REG32   DITHMODE; 
     
    5656        S3C24X0_REG32   LCDSRCPND; 
    5757        S3C24X0_REG32   LCDINTMSK; 
    58 @@ -157,6 +160,9 @@ 
     58@@ -157,6 +160,9 @@ typedef struct { 
    5959 /* NAND FLASH (see S3C2410 manual chapter 6) */ 
    6060 typedef struct { 
     
    6666        S3C24X0_REG32   NFADDR; 
    6767        S3C24X0_REG32   NFDATA; 
    68 @@ -164,6 +170,15 @@ 
     68@@ -164,6 +170,15 @@ typedef struct { 
    6969        S3C24X0_REG32   NFECC; 
    7070 } /*__attribute__((__packed__))*/ S3C2410_NAND; 
     
    8282 /* UART (see manual chapter 11) */ 
    8383 typedef struct { 
    84 @@ -451,6 +466,65 @@ 
     84@@ -451,6 +466,65 @@ typedef struct { 
    8585        S3C24X0_REG32   GSTATUS3; 
    8686        S3C24X0_REG32   GSTATUS4; 
     
    148148  
    149149  
    150 @@ -637,8 +711,13 @@ 
     150@@ -637,8 +711,13 @@ typedef struct { 
    151151        S3C24X0_REG32   SDIDCNT; 
    152152        S3C24X0_REG32   SDIDSTA; 
     
    165165=================================================================== 
    166166--- u-boot.orig/drivers/rtc/s3c24x0_rtc.c 
    167 +++ u-boot/rtc/drivers/s3c24x0_rtc.c 
     167+++ u-boot/drivers/rtc/s3c24x0_rtc.c 
    168168@@ -34,6 +34,8 @@ 
    169169 #include <s3c2400.h> 
     
    484484--- u-boot.orig/include/common.h 
    485485+++ u-boot/include/common.h 
    486 @@ -479,7 +479,7 @@ 
     486@@ -481,7 +481,7 @@ int prt_mpc8220_clks (void); 
    487487 ulong  get_OPB_freq (void); 
    488488 ulong  get_PCI_freq (void); 
     
    527527  
    528528 #define MPLL 0 
    529 @@ -66,8 +69,17 @@ 
     529@@ -66,8 +69,17 @@ static ulong get_PLLCLK(int pllreg) 
    530530     m = ((r & 0xFF000) >> 12) + 8; 
    531531     p = ((r & 0x003F0) >> 4) + 2; 
     
    546546  
    547547 /* return FCLK frequency */ 
    548 @@ -81,7 +93,23 @@ 
     548@@ -81,7 +93,23 @@ ulong get_HCLK(void) 
    549549 { 
    550550     S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER(); 
     
    570570  
    571571 /* return PCLK frequency */ 
    572 @@ -98,4 +126,5 @@ 
     572@@ -98,4 +126,5 @@ ulong get_UCLK(void) 
    573573     return(get_PLLCLK(UPLL)); 
    574574 } 
     
    599599  
    600600 int timer_load_val = 0; 
    601 @@ -59,6 +62,7 @@ 
     601@@ -59,6 +62,7 @@ int interrupt_init (void) 
    602602        /* use PWM Timer 4 because it has no output */ 
    603603        /* prescaler for Timer 4 is 16 */ 
     
    607607        { 
    608608                /* 
    609 @@ -68,6 +72,9 @@ 
     609@@ -68,6 +72,9 @@ int interrupt_init (void) 
    610610                 */ 
    611611                timer_load_val = get_PCLK()/(2 * 16 * 100); 
     
    617617        lastdec = timers->TCNTB4 = timer_load_val; 
    618618        /* auto load, manual update of Timer 4 */ 
    619 @@ -178,6 +185,7 @@ 
     619@@ -178,6 +185,7 @@ ulong get_tbclk (void) 
    620620        tbclk = timer_load_val * 100; 
    621621 #elif defined(CONFIG_SBC2410X) || \ 
     
    625625        tbclk = CFG_HZ; 
    626626 #else 
    627 @@ -232,4 +240,5 @@ 
     627@@ -232,4 +240,5 @@ void s3c2410_irq(void) 
    628628 } 
    629629 #endif /* USE_IRQ */ 
     
    653653  
    654654 DECLARE_GLOBAL_DATA_PTR; 
    655 @@ -302,4 +305,5 @@ 
     655@@ -301,4 +304,5 @@ struct serial_device s3c24xx_serial2_dev 
    656656  
    657657 #endif /* CONFIG_SERIAL_MULTI */ 
     
    673673 #include <i2c.h> 
    674674  
    675 @@ -63,7 +65,7 @@ 
     675@@ -63,7 +65,7 @@ static int GetI2CSDA(void) 
    676676 { 
    677677        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 
     
    682682 #endif 
    683683 #ifdef CONFIG_S3C2400 
    684 @@ -82,7 +84,7 @@ 
     684@@ -82,7 +84,7 @@ static void SetI2CSCL(int x) 
    685685 { 
    686686        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 
     
    691691 #endif 
    692692 #ifdef CONFIG_S3C2400 
    693 @@ -139,7 +141,7 @@ 
     693@@ -139,7 +141,7 @@ void i2c_init (int speed, int slaveadd) 
    694694        } 
    695695  
     
    700700 #endif 
    701701 #ifdef CONFIG_S3C2400 
    702 @@ -147,7 +149,7 @@ 
     702@@ -147,7 +149,7 @@ void i2c_init (int speed, int slaveadd) 
    703703 #endif 
    704704                /* bus still busy probably by (most) previously interrupted transfer */ 
     
    709709                gpio->GPECON = (gpio->GPECON & ~0xF0000000) | 0x10000000; 
    710710 #endif 
    711 @@ -171,7 +173,7 @@ 
     711@@ -171,7 +173,7 @@ void i2c_init (int speed, int slaveadd) 
    712712                udelay (1000); 
    713713  
     
    760760  
    761761 /* 
    762 @@ -154,20 +158,38 @@ 
     762@@ -166,20 +170,38 @@ copyex: 
    763763        bne     copyex 
    764764 #endif 
     
    801801        mov     r1, #0x0 
    802802        str     r1, [r0] 
    803 @@ -178,24 +200,34 @@ 
     803@@ -190,24 +212,34 @@ copyex: 
    804804        mov     r1, #0xffffffff 
    805805        ldr     r0, =INTMSK 
     
    843843  
    844844        /* Page 7-19, seven nops between UPLL and MPLL */ 
    845 @@ -207,12 +239,12 @@ 
     845@@ -219,12 +251,12 @@ copyex: 
    846846        nop 
    847847        nop 
     
    858858  
    859859 #if 1 
    860 @@ -240,14 +272,15 @@ 
     860@@ -252,14 +284,15 @@ copyex: 
    861861        str     r1, [r0, #0x28] 
    862862 #endif 
     
    876876 #ifndef CONFIG_SKIP_RELOCATE_UBOOT 
    877877        adr     r0, _start              /* r0 <- current position of code   */ 
    878 @@ -299,7 +332,7 @@ 
     878@@ -305,6 +338,7 @@ nand_load: 
     879        bl      may_resume              /* low-level setup and resume */ 
     880  
     881        @ reset NAND 
     882+#if defined(CONFIG_S3C2410) 
     883        mov     r1, #S3C2410_NAND_BASE 
     884        ldr     r2, =0xf842             @ initial value enable tacls=3,rph0=6,rph1=0 
     885        str     r2, [r1, #oNFCONF] 
     886@@ -323,6 +357,17 @@ nand_load: 
     887        ldr     r2, [r1, #oNFCONF] 
     888        orr     r2, r2, #0x800          @ disable chip 
     889        str     r2, [r1, #oNFCONF] 
     890+#elif defined(CONFIG_S3C2440) 
     891+       mov     r1, #S3C2440_NAND_BASE 
     892+       ldr     r2, =0xfff0             @ initial value tacls=3,rph0=7,rph1=7 
     893+       ldr     r3, [r1, #oNFCONF] 
     894+       orr     r3, r3, r2 
     895+       str     r3, [r1, #oNFCONF] 
     896+ 
     897+       ldr     r3, [r1, #oNFCONT] 
     898+       orr     r3, r3, #1              @ enable nand controller 
     899+       str     r3, [r1, #oNFCONT] 
     900+#endif /* CONFIG_S3C2440 */ 
     901  
     902        ldr     r0, _TEXT_BASE          /* upper 128 KiB: relocated uboot   */ 
     903        sub     r0, r0, #CFG_MALLOC_LEN /* malloc area                      */ 
     904@@ -385,7 +430,7 @@ done_nand_read: 
     905 #endif /* CONFIG_S3C2410_NAND_BOOT */ 
     906 done_relocate: 
     907  
     908-#if defined(CONFIG_USE_IRQ) && defined(CONFIG_S3C2410) 
     909+#if defined(CONFIG_USE_IRQ) && (defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)) 
     910        /* In the case of the S3C2410, if we've somehow magically (JTAG, ...) 
     911           ended up in RAM, then that ram is mapped to 0x30000000 and not 0. 
     912           So we need to copy the interrupt vectors, etc.  */ 
     913@@ -502,7 +547,7 @@ may_resume: 
    879914 #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY) 
    880915        bl      cpu_init_crit 
     
    885920        ldr     r1, =0xfffff 
    886921 1:     subs    r1, r1, #1 
    887 @@ -310,11 +343,12 @@ 
     922@@ -513,7 +558,7 @@ may_resume: 
    888923        ldr     r0, [ r1 ] 
    889924        tst     r0, #0x02               /* is this resume from power down */ 
    890925        ldrne   pc, [r1, #4]            /* gstatus3 */ 
    891926-#endif /* CONFIG_S3C2410 */ 
    892 +#endif /* CONFIG_S3C2410 || CONFIG_S3C2440 */ 
     927+#endif /* CONFIG_S3C2410 || CONFIG_S3C244 */ 
    893928 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ 
    894929  
    895         /* mov  r10, lr */ 
    896   
    897 +#if defined(CONFIG_S3C2410) 
    898         @ reset NAND 
    899         mov     r1, #S3C2410_NAND_BASE 
    900         ldr     r2, =0xf842             @ initial value enable tacls=3,rph0=6,rph1=0 
    901 @@ -334,6 +368,17 @@ 
    902         ldr     r2, [r1, #oNFCONF] 
    903         orr     r2, r2, #0x800          @ disable chip 
    904         str     r2, [r1, #oNFCONF] 
    905 +#elif defined(CONFIG_S3C2440) 
    906 +       mov     r1, #S3C2440_NAND_BASE 
    907 +       ldr     r2, =0xfff0             @ initial value tacls=3,rph0=7,rph1=7 
    908 +       ldr     r3, [r1, #oNFCONF] 
    909 +       orr     r3, r3, r2 
    910 +       str     r3, [r1, #oNFCONF] 
    911 + 
    912 +       ldr     r3, [r1, #oNFCONT] 
    913 +       orr     r3, r3, #1              @ enable nand controller 
    914 +       str     r3, [r1, #oNFCONT] 
    915 +#endif 
    916   
    917  #if 0 
    918         @ get ready to call C functions (for nand_read()) 
    919 @@ -402,7 +447,7 @@ 
    920  #endif /* CONFIG_S3C2410_NAND_BOOT */ 
    921  done_relocate: 
    922   
    923 -#if defined(CONFIG_USE_IRQ) && defined(CONFIG_S3C2410) 
    924 +#if defined(CONFIG_USE_IRQ) && (defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)) 
    925         /* In the case of the S3C2410, if we've somehow magically (JTAG, ...) 
    926            ended up in RAM, then that ram is mapped to 0x30000000 and not 0. 
    927            So we need to copy the interrupt vectors, etc.  */ 
     930        mov     pc, r10 
    928931Index: u-boot/cpu/arm920t/s3c24x0/nand_read.c 
    929932=================================================================== 
     
    10781081 /* low level nand read function */ 
    10791082 int nand_read_ll(unsigned char *buf, unsigned long start_addr, int size) 
    1080 @@ -50,47 +161,28 @@ 
     1083@@ -50,47 +161,28 @@ int nand_read_ll(unsigned char *buf, uns 
    10811084                return -1;      /* invalid alignment */ 
    10821085  
     
    12001203 { 
    12011204        struct nand_chip *chip = mtd->priv; 
    1202 @@ -62,23 +92,31 @@ 
     1205@@ -62,23 +92,31 @@ static void s3c2410_hwcontrol(struct mtd 
    12031206  
    12041207        switch (cmd) { 
     
    12371240        } 
    12381241        return; 
    1239 @@ -180,15 +218,21 @@ 
     1242@@ -137,15 +175,21 @@ int __board_nand_init(struct nand_chip * 
    12401243        /* initialize hardware */ 
    12411244        twrph0 = 3; twrph1 = 0; tacls = 0; 
     
    12601263        /* read_buf and write_buf are default */ 
    12611264        /* read_byte and write_byte are default */ 
    1262 @@ -213,12 +257,23 @@ 
     1265@@ -170,12 +214,23 @@ int __board_nand_init(struct nand_chip * 
    12631266        nand->options = 0; 
    12641267 #endif 
     
    12891292--- u-boot.orig/cpu/arm920t/s3c24x0/mmc.c 
    12901293+++ u-boot/cpu/arm920t/s3c24x0/mmc.c 
    1291 @@ -137,6 +137,9 @@ 
     1294@@ -137,6 +137,9 @@ static int mmc_block_read(uchar *dst, ul 
    12921295        dcon |= S3C2410_SDIDCON_RXAFTERCMD|S3C2410_SDIDCON_XFER_RXSTART; 
    12931296        if (wide) 
     
    12991302  
    13001303        /* send read command */ 
    1301 @@ -394,13 +397,18 @@ 
     1304@@ -394,13 +397,18 @@ int mmc_init(int verbose) 
    13021305  
    13031306        clk_power->CLKCON |= (1 << 9); 
     
    13411344  
    13421345 int usb_cpu_init (void) 
    1343 @@ -68,5 +70,5 @@ 
     1346@@ -68,5 +70,5 @@ int usb_cpu_init_fail (void) 
    13441347        return 0; 
    13451348 } 
     
    13521355--- u-boot.orig/drivers/usb/usb_ohci.c 
    13531356+++ u-boot/drivers/usb/usb_ohci.c 
    1354 @@ -62,6 +62,7 @@ 
     1357@@ -66,6 +66,7 @@ 
    13551358 #if defined(CONFIG_ARM920T) || \ 
    13561359     defined(CONFIG_S3C2400) || \ 
     
    13761379 DECLARE_GLOBAL_DATA_PTR; 
    13771380  
    1378 @@ -46,6 +50,7 @@ 
     1381@@ -46,6 +50,7 @@ struct s3c24x0_pll_speed { 
    13791382        u_int16_t       mhz; 
    13801383        u_int32_t       mpllcon; 
     
    13841387  
    13851388 #define CLKDIVN_1_1_1  0x00 
    1386 @@ -53,6 +58,11 @@ 
     1389@@ -53,6 +58,11 @@ struct s3c24x0_pll_speed { 
    13871390 #define CLKDIVN_1_2_4  0x03 
    13881391 #define CLKDIVN_1_4_4  0x04 
     
    13961399 static const u_int32_t upllcon = ((0x78 << 12) + (0x2 << 4) + 0x3); 
    13971400 static const struct s3c24x0_pll_speed pll_configs[] = { 
    1398 @@ -77,6 +87,61 @@ 
     1401@@ -77,6 +87,61 @@ static const struct s3c24x0_pll_speed pl 
    13991402                .clkdivn = CLKDIVN_1_2_4, 
    14001403        }, 
     
    14581461 #error "please define valid pll configurations for your cpu type" 
    14591462 #endif 
    1460 @@ -95,6 +160,10 @@ 
     1463@@ -95,6 +160,10 @@ static int reconfig_mpll(u_int16_t mhz) 
    14611464  
    14621465        for (i = 0; i < ARRAY_SIZE(pll_configs); i++) { 
     
    14731476--- u-boot.orig/common/serial.c 
    14741477+++ u-boot/common/serial.c 
    1475 @@ -59,7 +59,7 @@ 
     1478@@ -60,7 +60,7 @@ struct serial_device *__default_serial_c 
    14761479 #else 
    14771480                return &serial0_device; 
     
    14821485        return &s3c24xx_serial0_device; 
    14831486 #elif defined(CONFIG_SERIAL2) 
    1484 @@ -129,7 +129,7 @@ 
     1487@@ -133,7 +133,7 @@ void serial_initialize (void) 
    14851488 #if defined (CONFIG_STUART) 
    14861489        serial_register(&serial_stuart_device); 
     
    14951498--- u-boot.orig/include/serial.h 
    14961499+++ u-boot/include/serial.h 
    1497 @@ -35,7 +35,7 @@ 
     1500@@ -36,7 +36,7 @@ extern struct serial_device eserial4_dev 
    14981501  
    14991502 #endif 
  • trunk/src/target/u-boot/patches/uboot-s3c2442.patch

    r3564 r4108  
    1212 #endif 
    1313  
    14 @@ -58,7 +58,7 @@ 
     14@@ -58,7 +58,7 @@ struct s3c24x0_pll_speed { 
    1515 #define CLKDIVN_1_2_4  0x03 
    1616 #define CLKDIVN_1_4_4  0x04 
     
    2121 #define CLKDIVN_1_3_6  0x07 
    2222 #endif 
    23 @@ -142,6 +142,67 @@ 
     23@@ -142,6 +142,67 @@ static const struct s3c24x0_pll_speed pl 
    2424 #error "clock frequencies != 12MHz / 16.9344MHz not supported" 
    2525 #endif 
     
    102102 #endif 
    103103 #include <i2c.h> 
    104 @@ -65,7 +65,8 @@ 
     104@@ -65,7 +65,8 @@ static int GetI2CSDA(void) 
    105105 { 
    106106        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 
     
    112112 #endif 
    113113 #ifdef CONFIG_S3C2400 
    114 @@ -84,7 +85,8 @@ 
     114@@ -84,7 +85,8 @@ static void SetI2CSCL(int x) 
    115115 { 
    116116        S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO(); 
     
    122122 #endif 
    123123 #ifdef CONFIG_S3C2400 
    124 @@ -141,7 +143,8 @@ 
     124@@ -141,7 +143,8 @@ void i2c_init (int speed, int slaveadd) 
    125125        } 
    126126  
     
    132132 #endif 
    133133 #ifdef CONFIG_S3C2400 
    134 @@ -149,7 +152,8 @@ 
     134@@ -149,7 +152,8 @@ void i2c_init (int speed, int slaveadd) 
    135135 #endif 
    136136                /* bus still busy probably by (most) previously interrupted transfer */ 
     
    142142                gpio->GPECON = (gpio->GPECON & ~0xF0000000) | 0x10000000; 
    143143 #endif 
    144 @@ -173,7 +177,8 @@ 
     144@@ -173,7 +177,8 @@ void i2c_init (int speed, int slaveadd) 
    145145                udelay (1000); 
    146146  
     
    174174 #endif 
    175175  
    176 @@ -62,7 +63,7 @@ 
     176@@ -62,7 +63,7 @@ int interrupt_init (void) 
    177177        /* use PWM Timer 4 because it has no output */ 
    178178        /* prescaler for Timer 4 is 16 */ 
     
    183183        { 
    184184                /* 
    185 @@ -241,4 +242,5 @@ 
     185@@ -241,4 +242,5 @@ void s3c2410_irq(void) 
    186186 #endif /* USE_IRQ */ 
    187187  
     
    194194--- u-boot.orig/cpu/arm920t/s3c24x0/mmc.c 
    195195+++ u-boot/cpu/arm920t/s3c24x0/mmc.c 
    196 @@ -137,7 +137,7 @@ 
     196@@ -137,7 +137,7 @@ static int mmc_block_read(uchar *dst, ul 
    197197        dcon |= S3C2410_SDIDCON_RXAFTERCMD|S3C2410_SDIDCON_XFER_RXSTART; 
    198198        if (wide) 
     
    203203 #endif 
    204204        sdi->SDIDCON = dcon; 
    205 @@ -403,7 +403,7 @@ 
     205@@ -403,7 +403,7 @@ int mmc_init(int verbose) 
    206206        //sdi->SDIPRE = 0x3e;  /* SDCLK = PCLK/2 / (SDIPRE+1) = 396kHz */ 
    207207        sdi->SDIPRE = 0x02;  /* 2410: SDCLK = PCLK/2 / (SDIPRE+1) = 11MHz */ 
     
    225225 #define oNFCMD         0x8 
    226226 #define oNFADDR                0xc 
    227 @@ -147,7 +147,7 @@ 
     227@@ -147,7 +147,7 @@ static void s3c2410_hwcontrol(struct mtd 
    228228        case NAND_CTL_SETNCE: 
    229229 #if defined(CONFIG_S3C2410) 
     
    234234 #endif 
    235235                DEBUGN("NFCONF=0x%08x\n", NFCONF); 
    236 @@ -155,7 +155,7 @@ 
     236@@ -155,7 +155,7 @@ static void s3c2410_hwcontrol(struct mtd 
    237237        case NAND_CTL_CLRNCE: 
    238238 #if defined(CONFIG_S3C2410) 
     
    243243 #endif 
    244244                DEBUGN("NFCONF=0x%08x\n", NFCONF); 
    245 @@ -278,7 +278,7 @@ 
     245@@ -235,7 +235,7 @@ int __board_nand_init(struct nand_chip * 
    246246        cfg |= S3C2410_NFCONF_TWRPH1(twrph1 - 1); 
    247247  
     
    252252        NFCONF = (tacls<<12)|(twrph0<<8)|(twrph1<<4)|(0<<0); 
    253253        NFCONT = (0<<13)|(0<<12)|(0<<10)|(0<<9)|(0<<8)|(1<<6)|(1<<5)|(1<<4)|(1<<1)|(1<<0); 
    254 @@ -315,7 +315,7 @@ 
     254@@ -272,7 +272,7 @@ int __board_nand_init(struct nand_chip * 
    255255        nand->options = 0; 
    256256 #endif 
     
    274274 #define NFCONT         __REGi(NF_BASE + 0x4) 
    275275 #define NFCMD          __REGb(NF_BASE + 0x8) 
    276 @@ -142,7 +142,7 @@ 
     276@@ -142,7 +142,7 @@ static int nand_read_page_ll(unsigned ch 
    277277                *buf = (NFDATA & 0xff); 
    278278                buf++; 
     
    304304 #endif 
    305305  
    306 @@ -306,4 +307,5 @@ 
     306@@ -305,4 +306,5 @@ struct serial_device s3c24xx_serial2_dev 
    307307 #endif /* CONFIG_SERIAL_MULTI */ 
    308308  
     
    331331 #endif 
    332332  
    333 @@ -71,7 +71,7 @@ 
     333@@ -71,7 +71,7 @@ static ulong get_PLLCLK(int pllreg) 
    334334     s = r & 0x3; 
    335335 #if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) 
     
    340340     if (pllreg == MPLL) 
    341341        return ( 2 * m * (CONFIG_SYS_CLK_FREQ / (p << s )) ); 
    342 @@ -95,7 +95,7 @@ 
     342@@ -95,7 +95,7 @@ ulong get_HCLK(void) 
    343343  
    344344 #if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) 
     
    349349         case 0x0: 
    350350            return get_FCLK(); 
    351 @@ -127,4 +127,5 @@ 
     351@@ -127,4 +127,5 @@ ulong get_UCLK(void) 
    352352 } 
    353353  
     
    377377 #endif 
    378378  
    379 @@ -70,5 +71,6 @@ 
     379@@ -70,5 +71,6 @@ int usb_cpu_init_fail (void) 
    380380        return 0; 
    381381 } 
     
    411411 #endif 
    412412 #include <status_led.h> 
    413 @@ -163,14 +163,15 @@ 
     413@@ -170,14 +170,15 @@ copyex: 
    414414        bne     copyex 
    415415 #endif 
     
    429429 #  define INTMSK               0x4A000008      /* Interupt-Controller base addresses */ 
    430430 #  define INTSUBMSK    0x4A00001C 
    431 @@ -193,6 +194,17 @@ 
     431@@ -200,6 +201,17 @@ copyex: 
    432432 #endif 
    433433 # define CLKDIVN_val   7 /* FCLK:HCLK:PCLK = 1:3:6 */ 
     
    447447  
    448448        ldr     r0, =pWTCON 
    449 @@ -205,13 +217,13 @@ 
     449@@ -212,13 +224,13 @@ copyex: 
    450450        mov     r1, #0xffffffff 
    451451        ldr     r0, =INTMSK 
     
    463463        ldr     r0, =CAMDIVN 
    464464        mov     r1, #0 
    465 @@ -277,7 +289,7 @@ 
     465@@ -284,7 +296,7 @@ copyex: 
    466466        str     r1, [r0, #0x28] 
    467467 #endif 
     
    472472 #ifndef CONFIG_SKIP_LOWLEVEL_INIT 
    473473 #ifndef CONFIG_LL_INIT_NAND_ONLY 
    474 @@ -285,7 +297,7 @@ 
     474@@ -292,7 +304,7 @@ copyex: 
    475475 #endif 
    476476  
     
    481481 #ifndef CONFIG_SKIP_RELOCATE_UBOOT 
    482482        adr     r0, _start              /* r0 <- current position of code   */ 
    483 @@ -337,7 +349,7 @@ 
     483@@ -357,7 +369,7 @@ nand_load: 
     484        ldr     r2, [r1, #oNFCONF] 
     485        orr     r2, r2, #0x800          @ disable chip 
     486        str     r2, [r1, #oNFCONF] 
     487-#elif defined(CONFIG_S3C2440) 
     488+#elif defined(CONFIG_S3C2440) || defined(CONFIG_S3C2442) 
     489        mov     r1, #S3C2440_NAND_BASE 
     490        ldr     r2, =0xfff0             @ initial value tacls=3,rph0=7,rph1=7 
     491        ldr     r3, [r1, #oNFCONF] 
     492@@ -367,7 +379,7 @@ nand_load: 
     493        ldr     r3, [r1, #oNFCONT] 
     494        orr     r3, r3, #1              @ enable nand controller 
     495        str     r3, [r1, #oNFCONT] 
     496-#endif /* CONFIG_S3C2440 */ 
     497+#endif /* CONFIG_S3C2440 || CONFIG_S3C2442 */ 
     498  
     499        ldr     r0, _TEXT_BASE          /* upper 128 KiB: relocated uboot   */ 
     500        sub     r0, r0, #CFG_MALLOC_LEN /* malloc area                      */ 
     501@@ -430,7 +442,8 @@ done_nand_read: 
     502 #endif /* CONFIG_S3C2410_NAND_BOOT */ 
     503 done_relocate: 
     504  
     505-#if defined(CONFIG_USE_IRQ) && (defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)) 
     506+#if defined(CONFIG_USE_IRQ) && (defined(CONFIG_S3C2410) || \ 
     507+    defined(CONFIG_S3C2440) || defined(CONFIG_S3C2442)) 
     508        /* In the case of the S3C2410, if we've somehow magically (JTAG, ...) 
     509           ended up in RAM, then that ram is mapped to 0x30000000 and not 0. 
     510           So we need to copy the interrupt vectors, etc.  */ 
     511@@ -547,7 +560,7 @@ may_resume: 
    484512 #if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && defined(CONFIG_LL_INIT_NAND_ONLY) 
    485513        bl      cpu_init_crit 
     
    490518        ldr     r1, =0xfffff 
    491519 1:     subs    r1, r1, #1 
    492 @@ -348,7 +360,7 @@ 
     520@@ -558,7 +571,7 @@ may_resume: 
    493521        ldr     r0, [ r1 ] 
    494522        tst     r0, #0x02               /* is this resume from power down */ 
    495523        ldrne   pc, [r1, #4]            /* gstatus3 */ 
    496 -#endif /* CONFIG_S3C2410 || CONFIG_S3C2440 */ 
    497 +#endif /* CONFIG_S3C2410 || CONFIG_S3C2440 || CONFIG_S3C2442*/ 
     524-#endif /* CONFIG_S3C2410 || CONFIG_S3C244 */ 
     525+#endif /* CONFIG_S3C2410 || CONFIG_S3C244 || CONFIG_S3C2442 */ 
    498526 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ 
    499527  
    500         /* mov  r10, lr */ 
    501 @@ -373,7 +385,7 @@ 
    502         ldr     r2, [r1, #oNFCONF] 
    503         orr     r2, r2, #0x800          @ disable chip 
    504         str     r2, [r1, #oNFCONF] 
    505 -#elif defined(CONFIG_S3C2440) 
    506 +#elif defined(CONFIG_S3C2440) || defined(CONFIG_S3C2442) 
    507         mov     r1, #S3C2440_NAND_BASE 
    508         ldr     r2, =0xfff0             @ initial value tacls=3,rph0=7,rph1=7 
    509         ldr     r3, [r1, #oNFCONF] 
    510 @@ -452,7 +464,8 @@ 
    511  #endif /* CONFIG_S3C2410_NAND_BOOT */ 
    512  done_relocate: 
    513   
    514 -#if defined(CONFIG_USE_IRQ) && (defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)) 
    515 +#if defined(CONFIG_USE_IRQ) && (defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440) || \ 
    516 +                               defined(CONFIG_S3C2442)) 
    517         /* In the case of the S3C2410, if we've somehow magically (JTAG, ...) 
    518            ended up in RAM, then that ram is mapped to 0x30000000 and not 0. 
    519            So we need to copy the interrupt vectors, etc.  */ 
    520 Index: u-boot/drivers/usbdcore_s3c2410.c 
     528        mov     pc, r10 
     529Index: u-boot/drivers/usb/usbdcore_s3c2410.c 
    521530=================================================================== 
    522531--- u-boot.orig/drivers/usb/usbdcore_s3c2410.c 
     
    532541 #include <common.h> 
    533542  
    534 Index: u-boot/drivers/usbtty.h 
     543Index: u-boot/drivers/serial/usbtty.h 
    535544=================================================================== 
    536545--- u-boot.orig/drivers/serial/usbtty.h 
     
    550559--- u-boot.orig/include/common.h 
    551560+++ u-boot/include/common.h 
    552 @@ -479,7 +479,9 @@ 
     561@@ -481,7 +481,9 @@ int prt_mpc8220_clks (void); 
    553562 ulong  get_OPB_freq (void); 
    554563 ulong  get_PCI_freq (void); 
     
    565574--- u-boot.orig/include/s3c24x0.h 
    566575+++ u-boot/include/s3c24x0.h 
    567 @@ -82,7 +82,8 @@ 
     576@@ -82,7 +82,8 @@ typedef struct { 
    568577        S3C24X0_REG32   PRIORITY; 
    569578        S3C24X0_REG32   INTPND; 
     
    575584        S3C24X0_REG32   INTSUBMSK; 
    576585 #endif 
    577 @@ -92,11 +93,13 @@ 
     586@@ -92,11 +93,13 @@ typedef struct { 
    578587 /* DMAS (see manual chapter 8) */ 
    579588 typedef struct { 
     
    591600 #endif 
    592601        S3C24X0_REG32   DCON; 
    593 @@ -107,7 +110,8 @@ 
     602@@ -107,7 +110,8 @@ typedef struct { 
    594603 #ifdef CONFIG_S3C2400 
    595604        S3C24X0_REG32   res[1]; 
     
    601610 #endif 
    602611 } /*__attribute__((__packed__))*/ S3C24X0_DMA; 
    603 @@ -126,7 +130,7 @@ 
     612@@ -126,7 +130,7 @@ typedef struct { 
    604613        S3C24X0_REG32   CLKCON; 
    605614        S3C24X0_REG32   CLKSLOW; 
     
    610619 #endif 
    611620 } /*__attribute__((__packed__))*/ S3C24X0_CLOCK_POWER; 
    612 @@ -148,7 +152,8 @@ 
     621@@ -148,7 +152,8 @@ typedef struct { 
    613622        S3C24X0_REG32   res[8]; 
    614623        S3C24X0_REG32   DITHMODE; 
     
    620629        S3C24X0_REG32   LCDSRCPND; 
    621630        S3C24X0_REG32   LCDINTMSK; 
    622 @@ -160,7 +165,7 @@ 
     631@@ -160,7 +165,7 @@ typedef struct { 
    623632 /* NAND FLASH (see S3C2410 manual chapter 6) */ 
    624633 typedef struct { 
     
    629638 #endif 
    630639        S3C24X0_REG32   NFCMD; 
    631 @@ -466,7 +471,7 @@ 
     640@@ -466,7 +471,7 @@ typedef struct { 
    632641        S3C24X0_REG32   GSTATUS3; 
    633642        S3C24X0_REG32   GSTATUS4; 
     
    638647        S3C24X0_REG32   GPADAT; 
    639648        S3C24X0_REG32   res1[2]; 
    640 @@ -714,7 +719,7 @@ 
     649@@ -714,7 +719,7 @@ typedef struct { 
    641650 #if defined(CONFIG_S3C2410) 
    642651        S3C24X0_REG32   SDIDAT; 
     
    664673--- u-boot.orig/common/serial.c 
    665674+++ u-boot/common/serial.c 
    666 @@ -59,7 +59,8 @@ 
     675@@ -60,7 +60,8 @@ struct serial_device *__default_serial_c 
    667676 #else 
    668677                return &serial0_device; 
     
    674683        return &s3c24xx_serial0_device; 
    675684 #elif defined(CONFIG_SERIAL2) 
    676 @@ -129,7 +130,8 @@ 
     685@@ -133,7 +134,8 @@ void serial_initialize (void) 
    677686 #if defined (CONFIG_STUART) 
    678687        serial_register(&serial_stuart_device); 
     
    688697--- u-boot.orig/include/serial.h 
    689698+++ u-boot/include/serial.h 
    690 @@ -35,7 +35,8 @@ 
     699@@ -36,7 +36,8 @@ extern struct serial_device eserial4_dev 
    691700  
    692701 #endif 
  • trunk/src/target/u-boot/patches/uboot-s3c2443.patch

    r3564 r4108  
    1212 #include <status_led.h> 
    1313  
    14 @@ -164,7 +166,7 @@ 
     14@@ -171,7 +173,7 @@ copyex: 
    1515 #endif 
    1616  
     
    2121  
    2222 # if defined(CONFIG_S3C2400) 
    23 @@ -205,6 +207,11 @@ 
     23@@ -212,6 +214,11 @@ copyex: 
    2424 # endif 
    2525 # define CLKDIVN_val  7 /* FCLK:HCLK:PCLK = 1:3:6 */ 
     
    3333  
    3434        ldr     r0, =pWTCON 
    35 @@ -217,7 +224,8 @@ 
     35@@ -224,7 +231,8 @@ copyex: 
    3636        mov     r1, #0xffffffff 
    3737        ldr     r0, =INTMSK 
     
    4343        ldr     r0, =INTSUBMSK 
    4444        str     r1, [r0] 
    45 @@ -236,6 +244,43 @@ 
     45@@ -243,6 +251,43 @@ copyex: 
    4646        mcr     p15, 0, r1, c1, c0, 0 
    4747  
     
    8787 #define UPLLCON                0x4c000008 
    8888  
    89 @@ -263,6 +308,7 @@ 
     89@@ -270,6 +315,7 @@ copyex: 
    9090        ldr     r0, =CLKDIVN 
    9191        mov     r1, #CLKDIVN_val 
     
    9595 #if 1 
    9696        /* enable uart */ 
    97 @@ -289,7 +335,8 @@ 
     97@@ -296,7 +342,8 @@ copyex: 
    9898        str     r1, [r0, #0x28] 
    9999 #endif 
     
    105105 #ifndef CONFIG_SKIP_LOWLEVEL_INIT 
    106106 #ifndef CONFIG_LL_INIT_NAND_ONLY 
    107 @@ -297,7 +344,8 @@ 
     107@@ -304,7 +351,8 @@ copyex: 
    108108 #endif 
    109109  
     
    137137  
    138138 int timer_load_val = 0; 
    139 @@ -187,6 +189,7 @@ 
     139@@ -187,6 +189,7 @@ ulong get_tbclk (void) 
    140140 #elif defined(CONFIG_SBC2410X) || \ 
    141141       defined(CONFIG_SMDK2410) || \ 
Note: See TracChangeset for help on using the changeset viewer.