Merge branch 'master' of git://git.denx.de/u-boot-video
authorWolfgang Denk <wd@denx.de>
Sat, 23 Oct 2010 19:56:51 +0000 (21:56 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 23 Oct 2010 19:56:51 +0000 (21:56 +0200)
19 files changed:
MAKEALL
Makefile
arch/sh/config.mk
arch/sh/lib/bootm.c
board/a4m072/a4m072.c
board/renesas/sh7785lcr/config.mk
boards.cfg
common/usb_storage.c
doc/README.LED_display
drivers/mtd/cfi_flash.c
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci.h
drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h
drivers/usb/musb/musb_hcd.c
include/configs/a4m072.h
include/configs/sh7785lcr.h
include/led-display.h

diff --git a/MAKEALL b/MAKEALL
index 51312dd5e3c87b0d0f0cb49feb00cfcd087f1fdf..4ae741a69565daae6eb567a44b2c62ace506cf6d 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -609,31 +609,11 @@ LIST_blackfin="$(boards_by_arch blackfin)
 ## SH Systems
 #########################################################################
 
-LIST_sh2="             \
-       rsk7203         \
-"
-LIST_sh3="             \
-       mpr2            \
-       ms7720se        \
-"
+LIST_sh2="$(boards_by_cpu sh2)"
+LIST_sh3="$(boards_by_cpu sh3)"
+LIST_sh4="$(boards_by_cpu sh4)"
 
-LIST_sh4="             \
-       ms7750se        \
-       ms7722se        \
-       MigoR           \
-       r7780mp         \
-       r2dplus         \
-       sh7763rdp       \
-       sh7785lcr       \
-       ap325rxa        \
-       espt            \
-"
-
-LIST_sh="              \
-       ${LIST_sh2}     \
-       ${LIST_sh3}     \
-       ${LIST_sh4}     \
-"
+LIST_sh="$(boards_by_arch sh)"
 
 #########################################################################
 ## SPARC Systems
index 06c71a2db86a4bf5c9713af4c9bd780b793264f1..f8e13d782ad30079c5b04e1d91130d3e7128ad69 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1184,88 +1184,6 @@ bf527-ezkit-v2_config    : unconfig
        @$(MKCONFIG) -t BF527_EZKIT_REV_2_1 \
                bf527-ezkit blackfin blackfin bf527-ezkit
 
-#========================================================================
-# SH3 (SuperH)
-#========================================================================
-
-#########################################################################
-## sh2 (Renesas SuperH)
-#########################################################################
-rsk7203_config: unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_RSK7203 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh2 rsk7203 renesas
-
-#########################################################################
-## sh3 (Renesas SuperH)
-#########################################################################
-
-mpr2_config: unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_MPR2 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh3 mpr2
-
-ms7720se_config: unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_MS7720SE 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh3 ms7720se
-
-#########################################################################
-## sh4 (Renesas SuperH)
-#########################################################################
-
-MigoR_config :       unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_MIGO_R 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 MigoR renesas
-
-ms7750se_config: unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_MS7750SE 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 ms7750se
-
-ms7722se_config :      unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_MS7722SE 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 ms7722se
-
-r2dplus_config  :   unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_R2DPLUS 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 r2dplus renesas
-
-r7780mp_config: unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_R7780MP 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 r7780mp renesas
-
-sh7763rdp_config  :   unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_SH7763RDP 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 sh7763rdp renesas
-
-sh7785lcr_32bit_config \
-sh7785lcr_config  :   unconfig
-       @mkdir -p $(obj)include
-       @mkdir -p $(obj)board/renesas/sh7785lcr
-       @echo "#define CONFIG_SH7785LCR 1" > $(obj)include/config.h
-       @if [ "$(findstring 32bit, $@)" ] ; then \
-               echo "#define CONFIG_SH_32BIT 1" >> $(obj)include/config.h ; \
-               echo "CONFIG_SYS_TEXT_BASE = 0x8ff80000" > \
-                       $(obj)board/renesas/sh7785lcr/config.tmp ; \
-       fi
-       @$(MKCONFIG) -n $@ -a sh7785lcr sh sh4 sh7785lcr renesas
-
-ap325rxa_config  :   unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_AP325RXA 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 ap325rxa renesas
-
-espt_config  :   unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_ESPT 1" > $(obj)include/config.h
-       @$(MKCONFIG) -a $@ sh sh4 espt
-
 #########################################################################
 #########################################################################
 
index 07ba68f19879b1db2c791f02b16d565a80ef112a..415c94979848f6980e6457200b46f05baf271308 100644 (file)
@@ -29,6 +29,6 @@ STANDALONE_LOAD_ADDR += -EB
 endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
-PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)
+PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE)
 
 LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
index 9c58ed7ec8cb2d507321c7c03f650ea1f478725f..f38d0b0e8e3fbc4e9276ff24cd212a2ea43b0a76 100644 (file)
@@ -43,6 +43,41 @@ static void hexdump(unsigned char *buf, int len)
 }
 #endif
 
+#define MOUNT_ROOT_RDONLY      0x000
+#define RAMDISK_FLAGS          0x004
+#define ORIG_ROOT_DEV          0x008
+#define LOADER_TYPE                    0x00c
+#define INITRD_START           0x010
+#define INITRD_SIZE                    0x014
+#define COMMAND_LINE           0x100
+
+#define RD_PROMPT      (1<<15)
+#define RD_DOLOAD      (1<<14)
+#define CMD_ARG_RD_PROMPT      "prompt_ramdisk="
+#define CMD_ARG_RD_DOLOAD      "load_ramdisk="
+
+#ifdef CONFIG_SH_SDRAM_OFFSET
+#define GET_INITRD_START(initrd, linux) (initrd - linux + CONFIG_SH_SDRAM_OFFSET)
+#else
+#define GET_INITRD_START(initrd, linux) (initrd - linux)
+#endif
+
+static void set_sh_linux_param(unsigned long param_addr, unsigned long data)
+{
+       *(unsigned long *)(param_addr) = data;
+}
+
+static unsigned long sh_check_cmd_arg(char *cmdline, char *key, int base)
+{
+       unsigned long val = 0;
+       char *p = strstr(cmdline, key);
+       if (p) {
+               p += strlen(key);
+               val = simple_strtol(p, NULL, base);
+       }
+       return val;
+}
+
 int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images)
 {
        /* Linux kernel load address */
@@ -51,7 +86,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
        unsigned char *param
                = (unsigned char *)image_get_load(images->legacy_hdr_os);
        /* Linux kernel command line */
-       char *cmdline = (char *)param + 0x100;
+       char *cmdline = (char *)param + COMMAND_LINE;
        /* PAGE_SIZE */
        unsigned long size = images->ep - (unsigned long)param;
        char *bootargs = getenv("bootargs");
@@ -61,8 +96,37 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
 
        /* Setup parameters */
        memset(param, 0, size); /* Clear zero page */
+
+       /* Set commandline */
        strcpy(cmdline, bootargs);
 
+       sh_check_cmd_arg(bootargs, CMD_ARG_RD_DOLOAD, 10);
+       /* Initrd */
+       if (images->rd_start || images->rd_end) {
+               unsigned long ramdisk_flags = 0;
+               int val = sh_check_cmd_arg(bootargs, CMD_ARG_RD_PROMPT, 10);
+               if (val == 1)
+                               ramdisk_flags |= RD_PROMPT;
+               else
+                               ramdisk_flags &= ~RD_PROMPT;
+                                       
+               val = sh_check_cmd_arg(bootargs, CMD_ARG_RD_DOLOAD, 10);
+               if (val == 1)
+                               ramdisk_flags |= RD_DOLOAD;
+               else
+                               ramdisk_flags &= ~RD_DOLOAD;
+
+               set_sh_linux_param((unsigned long)param + MOUNT_ROOT_RDONLY, 0x0001);
+               set_sh_linux_param((unsigned long)param + RAMDISK_FLAGS, ramdisk_flags);
+               set_sh_linux_param((unsigned long)param + ORIG_ROOT_DEV, 0x0200);
+               set_sh_linux_param((unsigned long)param + LOADER_TYPE, 0x0001);
+               set_sh_linux_param((unsigned long)param + INITRD_START,
+                       GET_INITRD_START(images->rd_start, CONFIG_SYS_SDRAM_BASE));
+               set_sh_linux_param((unsigned long)param + INITRD_SIZE,
+                       images->rd_end - images->rd_start);
+       }
+
+       /* Boot kernel */
        kernel();
        /* does not return */
 
index ae7ccbb4e9dbbaff1daac139a06301b3da663c56..09a5a5183bf9e4e6fa91ab5c79a230f0638be338 100644 (file)
@@ -270,8 +270,6 @@ static u8 display_buf[DISPLAY_BUF_SIZE];
 static u8 display_putc_pos;
 static u8 display_out_pos;
 
-static u8 display_dot_enable;
-
 void display_set(int cmd) {
 
        if (cmd & DISPLAY_CLEAR) {
@@ -281,12 +279,6 @@ void display_set(int cmd) {
        if (cmd & DISPLAY_HOME) {
                display_putc_pos = 0;
        }
-
-       if (cmd & DISPLAY_MARK) {
-               display_dot_enable = 1;
-       } else {
-               display_dot_enable = 0;
-       }
 }
 
 #define SEG_A    (1<<0)
@@ -314,10 +306,12 @@ void display_set(int cmd) {
  * A..Z                index 10..35
  * -           index 36
  * _           index 37
+ * .           index 38
  */
 
 #define SYMBOL_DASH            (36)
 #define SYMBOL_UNDERLINE       (37)
+#define SYMBOL_DOT             (38)
 
 static u8 display_char2seg7_tbl[]=
 {
@@ -337,28 +331,29 @@ static u8 display_char2seg7_tbl[]=
        SEG_B | SEG_C | SEG_D | SEG_E | SEG_G,                  /* d */
        SEG_A | SEG_D | SEG_E | SEG_F | SEG_G,                  /* E */
        SEG_A | SEG_E | SEG_F | SEG_G,                          /* F */
-       SEG_A | SEG_B | SEG_C | SEG_D | SEG_F | SEG_G,          /* g */
+       0,                                      /* g - not displayed */
        SEG_B | SEG_C | SEG_E | SEG_F | SEG_G,                  /* H */
-       SEG_E | SEG_F,                                          /* I */
-       SEG_B | SEG_C | SEG_D | SEG_E,                          /* J */
-       SEG_A,                                          /* K - special 1 */
+       SEG_B | SEG_C,                                          /* I */
+       0,                                      /* J - not displayed */
+       0,                                      /* K - not displayed */
        SEG_D | SEG_E | SEG_F,                                  /* L */
-       SEG_B,                                          /* m - special 2 */
-       SEG_C | SEG_E | SEG_G,                                  /* n */
-       SEG_C | SEG_D | SEG_E | SEG_G,                          /* o */
+       0,                                      /* m - not displayed */
+       0,                                      /* n - not displayed */
+       SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,          /* O */
        SEG_A | SEG_B | SEG_E | SEG_F | SEG_G,                  /* P */
-       SEG_A | SEG_B | SEG_C | SEG_F | SEG_G,                  /* q */
-       SEG_E | SEG_G,                                          /* r */
+       0,                                      /* q - not displayed */
+       0,                                      /* r - not displayed */
        SEG_A | SEG_C | SEG_D | SEG_F | SEG_G,                  /* S */
        SEG_D | SEG_E | SEG_F | SEG_G,                          /* t */
        SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,                  /* U */
-       SEG_C | SEG_D | SEG_E | SEG_F,                          /* V */
-       SEG_C,                                          /* w - special 3 */
-       SEG_B | SEG_C | SEG_E | SEG_F | SEG_G,                  /* X */
+       0,                                      /* V - not displayed */
+       0,                                      /* w - not displayed */
+       0,                                      /* X - not displayed */
        SEG_B | SEG_C | SEG_D | SEG_F | SEG_G,                  /* Y */
-       SEG_A | SEG_B | SEG_D | SEG_E | SEG_G,                  /* Z */
+       0,                                      /* Z - not displayed */
        SEG_G,                                                  /* - */
-       SEG_D                                                   /* _ */
+       SEG_D,                                                  /* _ */
+       SEG_P                                                   /* . */
 };
 
 /* Convert char to the LED segments representation */
@@ -374,23 +369,20 @@ static u8 display_char2seg7(char c)
                c -= 'A' - 10;
        else if (c == '-')
                c = SYMBOL_DASH;
-       else if ((c == '_') || (c == '.'))
+       else if (c == '_')
                c = SYMBOL_UNDERLINE;
+       else if (c == '.')
+               c = SYMBOL_DOT;
        else
                c = ' ';        /* display unsupported symbols as space */
 
        if (c != ' ')
                val = display_char2seg7_tbl[(int)c];
 
-       /* Handle DP LED here */
-       if (display_dot_enable) {
-               val |= SEG_P;
-       }
-
        return val;
 }
 
-static inline int display_putc_nomark(char c)
+int display_putc(char c)
 {
        if (display_putc_pos >= DISPLAY_BUF_SIZE)
                return -1;
@@ -403,13 +395,6 @@ static inline int display_putc_nomark(char c)
        return c;
 }
 
-int display_putc(char c)
-{
-       /* Mark the codes from the "display" command with the DP LED */
-       display_set(DISPLAY_MARK);
-       return display_putc_nomark(c);
-}
-
 /*
  * Flush current symbol to the LED display hardware
  */
@@ -493,9 +478,8 @@ void show_boot_progress(int status)
        if (a4m072_status2code(status, buf) < 0)
                return;
 
-       display_set(0); /* Clear DP Led */
-       display_putc_nomark(buf[0]);
-       display_putc_nomark(buf[1]);
+       display_putc(buf[0]);
+       display_putc(buf[1]);
        display_set(DISPLAY_HOME);
        display_out_pos = 0;    /* reset output position */
 
index 1a9038c75331c4c5054f13fadcb5664173560a12..6853d2b28beaf29a65f89fb73d6da467f70e3615 100644 (file)
@@ -24,6 +24,8 @@
 #
 sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
-ifndef CONFIG_SYS_TEXT_BASE
+ifdef CONFIG_SH_32BIT
+CONFIG_SYS_TEXT_BASE = 0x8FF80000
+else
 CONFIG_SYS_TEXT_BASE = 0x0ff80000
 endif
index 0f3292fd3905526bb711139aa951a087959e981e..b7017374753d4a9446a2e2beb47800baee066239 100644 (file)
@@ -732,5 +732,18 @@ davinci_dm6467evm arm      arm926ejs       dm6467evm       davinci         davinci
 davinci_schmoogie arm  arm926ejs       schmoogie       davinci         davinci
 davinci_dm355leopard arm arm926ejs     dm355leopard    davinci         davinci
 bf527-ad7160-eval blackfin     blackfin
+rsk7203        sh      sh2             rsk7203         renesas         -
+mpr2   sh      sh3             mpr2    -       -
+ms7720se       sh      sh3     ms7720se        -       -
+MigoRsh        sh4     MigoR   renesas -   
+ms7750se       sh      sh4     ms7750se        -       -   
+ms7722se       sh      sh4     ms7722se        -       -   
+r2dplus        sh      sh4     r2dplus renesas -   
+r7780mp        sh      sh4     r7780mp renesas -   
+sh7763rdp      sh      sh4     sh7763rdp       renesas -   
+sh7785lcr      sh      sh4     sh7785lcr       renesas -   
+sh7785lcr_32bit        sh  sh4 sh7785lcr       renesas -       sh7785lcr:SH_32BIT=1
+ap325rxa       sh      sh4     ap325rxa        renesas -   
+espt   sh      sh4     espt    -       -
 # Target       ARCH    CPU             Board name      Vendor          SoC             Options
 ###############################################################################################
index 613c4f0f1f7e79a653ad6267a8341e7c30207f80..1e6cd6af27491467870ad76cc61d7c631a8a277f 100644 (file)
@@ -70,7 +70,7 @@
 /* direction table -- this indicates the direction of the data
  * transfer for each command code -- a 1 indicates input
  */
-unsigned char us_direction[256/8] = {
+static const unsigned char us_direction[256/8] = {
        0x28, 0x81, 0x14, 0x14, 0x20, 0x01, 0x90, 0x77,
        0x0C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01,
index 521746e12912f56b8625ab4b6d3450bc8971d4d8..19977ea7e0d1aba27e961a82d090f3ba533698fe 100644 (file)
@@ -14,7 +14,6 @@ This function should control the state of the LED display. Argument is
 an ORed combination of the following values:
  DISPLAY_CLEAR -- clear the display
  DISPLAY_HOME  -- set the position to the beginning of display
- DISPLAY_MARK  -- enable mark (decimal point), if implemented
 
 int display_putc(char c);
 
index 798902f337698d9e54dad633dcc134481fa2069e..c92c7a7a490cd8c7fa45fec2c7091ecbcdebb010 100644 (file)
@@ -85,6 +85,17 @@ static phys_addr_t __cfi_flash_bank_addr(int i)
 phys_addr_t cfi_flash_bank_addr(int i)
        __attribute__((weak, alias("__cfi_flash_bank_addr")));
 
+static unsigned long __cfi_flash_bank_size(int i)
+{
+#ifdef CONFIG_SYS_FLASH_BANKS_SIZES
+       return ((unsigned long [])CONFIG_SYS_FLASH_BANKS_SIZES)[i];
+#else
+       return 0;
+#endif
+}
+unsigned long cfi_flash_bank_size(int i)
+       __attribute__((weak, alias("__cfi_flash_bank_size")));
+
 static void __flash_write8(u8 value, void *addr)
 {
        __raw_writeb(value, addr);
@@ -1826,7 +1837,7 @@ static void flash_fixup_stm(flash_info_t *info, struct cfi_qry *qry)
  * The following code cannot be run from FLASH!
  *
  */
-ulong flash_get_size (phys_addr_t base, int banknum)
+ulong flash_get_size (phys_addr_t base, int banknum, unsigned long max_size)
 {
        flash_info_t *info = &flash_info[banknum];
        int i, j;
@@ -1915,6 +1926,13 @@ ulong flash_get_size (phys_addr_t base, int banknum)
                debug ("size_ratio %d port %d bits chip %d bits\n",
                       size_ratio, info->portwidth << CFI_FLASH_SHIFT_WIDTH,
                       info->chipwidth << CFI_FLASH_SHIFT_WIDTH);
+               info->size = 1 << qry.dev_size;
+               /* multiply the size by the number of chips */
+               info->size *= size_ratio;
+               if (max_size && (info->size > max_size)) {
+                       debug("[truncated from %ldMiB]", info->size >> 20);
+                       info->size = max_size;
+               }
                debug ("found %d erase regions\n", num_erase_regions);
                sect_cnt = 0;
                sector = base;
@@ -1935,6 +1953,8 @@ ulong flash_get_size (phys_addr_t base, int banknum)
                        debug ("erase_region_count = %d erase_region_size = %d\n",
                                erase_region_count, erase_region_size);
                        for (j = 0; j < erase_region_count; j++) {
+                               if (sector - base >= info->size)
+                                       break;
                                if (sect_cnt >= CONFIG_SYS_MAX_FLASH_SECT) {
                                        printf("ERROR: too many flash sectors\n");
                                        break;
@@ -1968,9 +1988,6 @@ ulong flash_get_size (phys_addr_t base, int banknum)
                }
 
                info->sector_count = sect_cnt;
-               info->size = 1 << qry.dev_size;
-               /* multiply the size by the number of chips */
-               info->size *= size_ratio;
                info->buffer_size = 1 << le16_to_cpu(qry.max_buf_write_size);
                tmp = 1 << qry.block_erase_timeout_typ;
                info->erase_blk_tout = tmp *
@@ -2026,7 +2043,8 @@ unsigned long flash_init (void)
                flash_info[i].flash_id = FLASH_UNKNOWN;
 
                if (!flash_detect_legacy(cfi_flash_bank_addr(i), i))
-                       flash_get_size(cfi_flash_bank_addr(i), i);
+                       flash_get_size(cfi_flash_bank_addr(i), i,
+                                       cfi_flash_bank_size(i));
                size += flash_info[i].size;
                if (flash_info[i].flash_id == FLASH_UNKNOWN) {
 #ifndef CONFIG_SYS_FLASH_QUIET_TEST
index f44fc4e3c4b693117979078adf55d692d83002be..982f96e8b8ff242d7617389f5181abab4238b3fe 100644 (file)
@@ -205,12 +205,12 @@ static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec)
        uint32_t result;
        do {
                result = ehci_readl(ptr);
+               udelay(5);
                if (result == ~(uint32_t)0)
                        return -1;
                result &= mask;
                if (result == done)
                        return 0;
-               udelay(1);
                usec--;
        } while (usec > 0);
        return -1;
index 047902a0c1c62fed41a3ba1827b95248cf865eee..cff34389295c5d13ce12d8988bdad47ab8c64c0a 100644 (file)
@@ -53,6 +53,10 @@ int ehci_hcd_init(void)
        hcor = (struct ehci_hcor *)((uint32_t) hccr +
                        HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
 
+       debug("EHCI-PCI init hccr 0x%x and hcor 0x%x hc_length %d\n",
+                       (uint32_t)hccr, (uint32_t)hcor,
+                       (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
+
        return 0;
 }
 
index d3aa55b4a6c70a40ff6f584b22ca8b482b4d7c4e..945ab64f95119fbf8790813f43a540af2d63d64b 100644 (file)
@@ -175,7 +175,7 @@ struct qTD {
        uint32_t qt_buffer_hi[5];       /* Appendix B */
        /* pad struct for 32 byte alignment */
        uint32_t unused[3];
-} __attribute__ ((aligned (32)));
+};
 
 /* Queue Head (QH). */
 struct QH {
index 6fe2c39bce800cb6eac58008431f8c3a2fb36f10..545ebf4b502322cdecd71ddd2b5cc72ff24f209a 100644 (file)
@@ -76,7 +76,7 @@ void musb_start(void)
  * epinfo      - Pointer to EP configuration table
  * cnt         - Number of entries in the EP conf table.
  */
-void musb_configure_ep(struct musb_epinfo *epinfo, u8 cnt)
+void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt)
 {
        u16 csr;
        u16 fifoaddr = 64; /* First 64 bytes of FIFO reserved for EP0 */
index 8f73876f8067ec1f7d8cdced275c6eaa141841a5..a8adcce00fa4ae558cd72944faa7dad4f956ebf1 100644 (file)
@@ -357,7 +357,7 @@ extern struct musb_regs             *musbr;
 
 /* exported functions */
 extern void musb_start(void);
-extern void musb_configure_ep(struct musb_epinfo *epinfo, u8 cnt);
+extern void musb_configure_ep(const struct musb_epinfo *epinfo, u8 cnt);
 extern void write_fifo(u8 ep, u32 length, void *fifo_data);
 extern void read_fifo(u8 ep, u32 length, void *fifo_data);
 
index f38b279096c31fbfaf5abb161526ffa82eca19c1..8b0c61d642662609057c1a87dbf98850e0ee0888 100644 (file)
@@ -29,7 +29,7 @@
 #define USB_MSC_BBB_GET_MAX_LUN        0xFE
 
 /* Endpoint configuration information */
-static struct musb_epinfo epinfo[3] = {
+static const struct musb_epinfo epinfo[3] = {
        {MUSB_BULK_EP, 1, 512}, /* EP1 - Bluk Out - 512 Bytes */
        {MUSB_BULK_EP, 0, 512}, /* EP1 - Bluk In  - 512 Bytes */
        {MUSB_INTR_EP, 0, 64}   /* EP2 - Interrupt IN - 64 Bytes */
@@ -41,7 +41,7 @@ static int rh_devnum;
 static u32 port_status;
 
 /* Device descriptor */
-static u8 root_hub_dev_des[] = {
+static const u8 root_hub_dev_des[] = {
        0x12,                   /*  __u8  bLength; */
        0x01,                   /*  __u8  bDescriptorType; Device */
        0x00,                   /*  __u16 bcdUSB; v1.1 */
@@ -63,7 +63,7 @@ static u8 root_hub_dev_des[] = {
 };
 
 /* Configuration descriptor */
-static u8 root_hub_config_des[] = {
+static const u8 root_hub_config_des[] = {
        0x09,                   /*  __u8  bLength; */
        0x02,                   /*  __u8  bDescriptorType; Configuration */
        0x19,                   /*  __u16 wTotalLength; */
@@ -96,14 +96,14 @@ static u8 root_hub_config_des[] = {
        0xff                    /*  __u8  ep_bInterval; 255 ms */
 };
 
-static unsigned char root_hub_str_index0[] = {
+static const unsigned char root_hub_str_index0[] = {
        0x04,                   /*  __u8  bLength; */
        0x03,                   /*  __u8  bDescriptorType; String-descriptor */
        0x09,                   /*  __u8  lang ID */
        0x04,                   /*  __u8  lang ID */
 };
 
-static unsigned char root_hub_str_index1[] = {
+static const unsigned char root_hub_str_index1[] = {
        0x1c,                   /*  __u8  bLength; */
        0x03,                   /*  __u8  bDescriptorType; String-descriptor */
        'M',                    /*  __u8  Unicode */
@@ -557,7 +557,7 @@ static int musb_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
        int len = 0;
        int stat = 0;
        u32 datab[4];
-       u8 *data_buf = (u8 *) datab;
+       const u8 *data_buf = (u8 *) datab;
        u16 bmRType_bReq;
        u16 wValue;
        u16 wIndex;
@@ -778,25 +778,27 @@ static int musb_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
 
                break;
 
-       case RH_GET_DESCRIPTOR | RH_CLASS:
+       case RH_GET_DESCRIPTOR | RH_CLASS: {
+               u8 *_data_buf = (u8 *) datab;
                debug("RH_GET_DESCRIPTOR | RH_CLASS\n");
 
-               data_buf[0] = 0x09;     /* min length; */
-               data_buf[1] = 0x29;
-               data_buf[2] = 0x1;      /* 1 port */
-               data_buf[3] = 0x01;     /* per-port power switching */
-               data_buf[3] |= 0x10;    /* no overcurrent reporting */
+               _data_buf[0] = 0x09;    /* min length; */
+               _data_buf[1] = 0x29;
+               _data_buf[2] = 0x1;     /* 1 port */
+               _data_buf[3] = 0x01;    /* per-port power switching */
+               _data_buf[3] |= 0x10;   /* no overcurrent reporting */
 
                /* Corresponds to data_buf[4-7] */
-               data_buf[4] = 0;
-               data_buf[5] = 5;
-               data_buf[6] = 0;
-               data_buf[7] = 0x02;
-               data_buf[8] = 0xff;
+               _data_buf[4] = 0;
+               _data_buf[5] = 5;
+               _data_buf[6] = 0;
+               _data_buf[7] = 0x02;
+               _data_buf[8] = 0xff;
 
                len = min_t(unsigned int, leni,
                            min_t(unsigned int, data_buf[0], wLength));
                break;
+       }
 
        case RH_GET_CONFIGURATION:
                debug("RH_GET_CONFIGURATION\n");
index 24a04ebefb539f4f804d93d110ea5c459499b544..f18bc45c4d14a2f9d54b711f91972c09fef946f9 100644 (file)
 #define CONFIG_PREBOOT                         "run try_update"
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
-       "bk=run add_mtd ; run add_consolespec ; bootm 200000\0" \
-       "cf1=diskboot 200000 0:1\0"     \
-       "bootcmd_cf1=run bcf1\0"        \
-       "bcf=setenv bootargs root=/dev/hda3\0"  \
-       "bootcmd_nfs=run bnfs\0"        \
-       "norargs=setenv bootargs root=/dev/mtdblock3 rootfstype=cramfs\0"       \
-       "bootcmd_nor=cp.b ${kernel_addr} 200000 100000; run norargs addip; run bk\0"    \
-       "bnfs=nfs 200000 ${rootpath}/boot/uImage ; run nfsargs addip ; run bk\0"        \
-       "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}\0"    \
-       "try_update=usb start;sleep 2;usb start;sleep 1;fatload usb 0 2F0000 PCPUUPDT 2FF;usb stop;source 2F0000\0"     \
-       "env_addr=FE060000\0"   \
-       "kernel_addr=FE100000\0"        \
-       "rootfs_addr=FE200000\0"        \
-       "add_mtd=setenv bootargs ${bootargs} mtdparts=phys_mapped_flash:384k(u),640k(e),1m(k),30m(r)\0" \
-       "bcf1=run cf1; run bcf; run addip; run bk\0"    \
-       "add_consolespec=setenv bootargs ${bootargs} console=/dev/null quiet\0" \
-       "addip=if test \"${ethaddr}\" != \"00:00:00:00:00:00\" ; then if test -n ${ipaddr}; then setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1; fi ; fi\0"     \
-       "hostname=CPUP0\0"      \
-       "ethaddr=00:00:00:00:00:00\0"   \
-       "netdev=eth0\0" \
-       "bootcmd=run bootcmd_nor\0" \
+       "bk=run add_mtd ; run add_consolespec ; bootm 200000\0"         \
+       "cf1=diskboot 200000 0:1\0"                                     \
+       "bootcmd_cf1=run bcf1\0"                                        \
+       "bcf=setenv bootargs root=/dev/hda3\0"                          \
+       "bootcmd_nfs=run bnfs\0"                                        \
+       "norargs=setenv bootargs root=/dev/mtdblock3 rootfstype=cramfs "\
+               "panic=1\0"                                             \
+       "bootcmd_nor=cp.b ${kernel_addr} 200000 100000;"                \
+                       "run norargs addip; run bk\0"                   \
+       "bnfs=nfs 200000 ${rootpath}/boot/uImage;"                      \
+                       "run nfsargs addip ; run bk\0"                  \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
+                               "nfsroot=${serverip}:${rootpath}\0"     \
+       "try_update=usb start;sleep 2;usb start;sleep 1;"               \
+                       "fatload usb 0 2F0000 PCPUUPDT 2FF;usb stop;"   \
+                       "source 2F0000\0"                               \
+       "env_addr=FE060000\0"                                           \
+       "kernel_addr=FE100000\0"                                        \
+       "rootfs_addr=FE200000\0"                                        \
+       "add_mtd=setenv bootargs ${bootargs} mtdparts="                 \
+               "phys_mapped_flash:384k(u),640k(e),1m(k),30m(r)\0"      \
+       "bcf1=run cf1; run bcf; run addip; run bk\0"                    \
+       "add_consolespec=setenv bootargs ${bootargs} "                  \
+                               "console=/dev/null quiet\0"             \
+       "addip=if test -n ${ethaddr};"                                  \
+               "then if test -n ${ipaddr};"                            \
+                       "then setenv bootargs ${bootargs} "             \
+                               "ip=${ipaddr}:${serverip}:${gatewayip}:"\
+                               "${netmask}:${hostname}:${netdev}:off;" \
+                       "fi;"                                           \
+               "else;"                                                 \
+                       "setenv bootargs ${bootargs} no_ethaddr;"       \
+               "fi\0"                                                  \
+       "hostname=CPUP0\0"                                              \
+       "ethaddr=00:00:00:00:00:00\0"                                   \
+       "netdev=eth0\0"                                                 \
+       "bootcmd=run bootcmd_nor\0"                                     \
        ""
 /*
  * IPB Bus clocking configuration.
 #define CONFIG_SYS_FLASH_CFI
 #define CONFIG_SYS_FLASH_CFI_WIDTH     FLASH_CFI_16BIT
 #define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_CS0_START}
+#define CONFIG_SYS_FLASH_BANKS_SIZES   {CONFIG_SYS_CS0_SIZE}
 
 /*
  * Environment settings
index 2c18e2f7fdf1e039a0c664740bcd0b00a60cd1ac..6627f99ce300e81502d4ec57e7c9014fec691f87 100644 (file)
 
 /* MEMORY */
 #if defined(CONFIG_SH_32BIT)
-#define SH7785LCR_SDRAM_PHYS_BASE      (0x48000000)
-#define SH7785LCR_SDRAM_BASE           (0x88000000)
+/* 0x40000000 - 0x47FFFFFF does not use */
+#define CONFIG_SH_SDRAM_OFFSET         (0x8000000)
+#define SH7785LCR_SDRAM_PHYS_BASE      (0x40000000 + CONFIG_SH_SDRAM_OFFSET)
+#define SH7785LCR_SDRAM_BASE           (0x80000000 + CONFIG_SH_SDRAM_OFFSET)
 #define SH7785LCR_SDRAM_SIZE           (384 * 1024 * 1024)
 #define SH7785LCR_FLASH_BASE_1         (0xa0000000)
 #define SH7785LCR_FLASH_BANK_SIZE      (64 * 1024 * 1024)
index 41c37443452bc2ffdad092c06870b51a875e3850..eaa0f406406d5cbe0e8d6d004320432c866b0424 100644 (file)
@@ -29,7 +29,6 @@
 /* Display Commands */
 #define DISPLAY_CLEAR  0x1 /* Clear the display */
 #define DISPLAY_HOME   0x2 /* Set cursor at home position */
-#define DISPLAY_MARK   0x4 /* Enable the decimal point led, if implemented */
 
 void display_set(int cmd);
 int display_putc(char c);