From: Minkyu Kang Date: Wed, 17 Jun 2009 07:26:58 +0000 (+0900) Subject: [USB] add ramdisk boot mode X-Git-Tag: s5pc110_universal_support~180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aad4c4ad4adfcff5bf5947ae54bef4d2b5752b01;p=kernel%2Fu-boot.git [USB] add ramdisk boot mode Signed-off-by: Minkyu Kang --- diff --git a/common/cmd_usbd.c b/common/cmd_usbd.c index e932b07..5db3dae 100644 --- a/common/cmd_usbd.c +++ b/common/cmd_usbd.c @@ -142,6 +142,12 @@ static void boot_cmd(char *addr) do_bootm(NULL, 0, 2, argv); } +static void run_cmd(char *cmd) +{ + char *argv[] = { "run", cmd }; + do_run(NULL, 0, 2, argv); +} + #if defined(CONFIG_CMD_NAND) extern int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); #elif defined(CONFIG_CMD_ONENAND) @@ -470,6 +476,18 @@ static int process_data(struct usbd_ops *usbd) boot_cmd(ramaddr); return 0; + case COMMAND_RAMDISK_MODE: + printf("COMMAND_RAMDISK_MODE\n"); +#ifdef CONFIG_RAMDISK_ADDR + if (arg) { + down_ram_addr = usbd->ram_addr; + } else { + down_ram_addr = CONFIG_RAMDISK_ADDR; + run_cmd("ramboot"); + } +#endif + return 1; + #ifdef CONFIG_DOWN_PHONE case COMMAND_DOWN_PHONE: printf("COMMAND_RESET_PHONE\n"); diff --git a/include/configs/s5pc100_universal.h b/include/configs/s5pc100_universal.h index 451a29f..95fdfd5 100644 --- a/include/configs/s5pc100_universal.h +++ b/include/configs/s5pc100_universal.h @@ -282,5 +282,6 @@ #define CONFIG_SAMSUNG_USB #define CONFIG_OTG_CLK_OSCC #define CONFIG_SYS_DOWN_ADDR CONFIG_SYS_SDRAM_BASE +#define CONFIG_RAMDISK_ADDR 0x23000000 #endif /* __CONFIG_H */ diff --git a/include/usbd.h b/include/usbd.h index 99b4bb7..87b6de9 100644 --- a/include/usbd.h +++ b/include/usbd.h @@ -45,6 +45,7 @@ enum { #define COMMAND_RESET_PDA 214 #define COMMAND_RESET_USB 215 #define COMMAND_RAM_BOOT 216 +#define COMMAND_RAMDISK_MODE 217 #ifdef CONFIG_DOWN_PHONE #define COMMAND_DOWN_PHONE 220 #define COMMAND_CHANGE_USB 221 @@ -52,16 +53,16 @@ enum { /* * USB Downloader Operations - * usb_init : initialize the USB Controller and check the connection - * usb_stop : stop and release USB + * usb_init : initialize the USB Controller and check the connection + * usb_stop : stop and release USB * send_data : send the data (BULK ONLY!!) * recv_data : receive the data and returns received size (BULK ONLY!!) * recv_setup : setup download address, length and DMA setting for receive - * tx_data : send data address - * rx_data : receive data address - * tx_len : size of send data - * rx_len : size of receive data - * ram_addr : address of will be stored data on RAM + * tx_data : send data address + * rx_data : receive data address + * tx_len : size of send data + * rx_len : size of receive data + * ram_addr : address of will be stored data on RAM */ struct usbd_ops { void (*usb_init) (void);