archosg9: add support for tablet
Subsystems (9)
cover archosg9: add support for tablet
This patch series is the same as before except for:
[PATCH 03/13] ARM: ensure irqs are disabled
imported irq handling from linux
[PATCH 07/13] uimage: improve transfer speed
solved a compile warning
Vicente (14):
twl6030: add debug info
omap4: add rename definitions to match datasheet
ARM: import irq handling from linux
ARM: ensure irqs are disabled
omap: revert gpiolib
omap4: add usb boot source
bootm: close open files
uimage: improve transfer speed
fs: improve robustness
omap4: add support for booting cpu from usb
omap4: add serial communications over usb boot
omap4: add filesystem support over usb boot
omap4: add support for loading second stage from usb Add support for Archos G9 tablet
Documentation/oamp4_usb_booting.txt | 27 ++ arch/arm/Kconfig | 1 - arch/arm/Makefile | 1 + arch/arm/boards/archosg9/Makefile | 3 + arch/arm/boards/archosg9/board.c | 71 ++++ arch/arm/boards/archosg9/config.h | 1 + arch/arm/boards/archosg9/env/config | 1 + arch/arm/boards/archosg9/env/init/usbboot | 5 + arch/arm/boards/archosg9/lowlevel.c | 79 ++++ arch/arm/boards/archosg9/mux.c | 459 ++++++++++++++++++++++++ arch/arm/boards/archosg9/mux.h | 6 + arch/arm/boards/panda/mux.c | 52 +-- arch/arm/boards/pcm049/mux.c | 44 +-- arch/arm/boards/phycard-a-xl2/mux.c | 46 +-- arch/arm/configs/archosg9_defconfig | 70 ++++ arch/arm/configs/archosg9_xload_defconfig | 24 ++ arch/arm/cpu/cpu.c | 7 + arch/arm/cpu/exceptions.S | 1 - arch/arm/cpu/interrupts.c | 6 +- arch/arm/include/asm/irqflags.h | 155 ++++++++ arch/arm/include/asm/ptrace.h | 55 +-- arch/arm/lib/bootm.c | 4 +- arch/arm/mach-omap/Kconfig | 18 + arch/arm/mach-omap/Makefile | 1 + arch/arm/mach-omap/gpio.c | 170 +++++---- arch/arm/mach-omap/include/mach/omap4-mux.h | 80 +++-- arch/arm/mach-omap/include/mach/omap4-silicon.h | 13 + arch/arm/mach-omap/include/mach/omap4_rom_usb.h | 141 ++++++++ arch/arm/mach-omap/include/mach/xload.h | 1 + arch/arm/mach-omap/omap3_generic.c | 19 - arch/arm/mach-omap/omap4_generic.c | 44 +-- arch/arm/mach-omap/omap4_rom_usb.c | 198 ++++++++++ arch/arm/mach-omap/xload.c | 26 ++ commands/bootm.c | 6 +- common/uimage.c | 27 +- drivers/mfd/twl6030.c | 21 ++ drivers/serial/Kconfig | 7 + drivers/serial/Makefile | 1 + drivers/serial/serial_omap4_usbboot.c | 83 +++++ fs/Kconfig | 5 + fs/Makefile | 1 + fs/fs.c | 27 +- fs/omap4_usbbootfs.c | 219 +++++++++++ include/mfd/twl6030.h | 8 + scripts/.gitignore | 1 + scripts/Makefile | 4 + scripts/omap4_usbboot.c | 415 +++++++++++++++++++++ scripts/usb.h | 61 ++++ scripts/usb_linux.c | 397 ++++++++++++++++++++ 49 files changed, 2848 insertions(+), 264 deletions(-) create mode 100644 Documentation/oamp4_usb_booting.txt create mode 100644 arch/arm/boards/archosg9/Makefile create mode 100644 arch/arm/boards/archosg9/board.c create mode 100644 arch/arm/boards/archosg9/config.h create mode 100644 arch/arm/boards/archosg9/env/config create mode 100644 arch/arm/boards/archosg9/env/init/usbboot create mode 100644 arch/arm/boards/archosg9/lowlevel.c create mode 100644 arch/arm/boards/archosg9/mux.c create mode 100644 arch/arm/boards/archosg9/mux.h create mode 100644 arch/arm/configs/archosg9_defconfig create mode 100644 arch/arm/configs/archosg9_xload_defconfig create mode 100644 arch/arm/include/asm/irqflags.h create mode 100644 arch/arm/mach-omap/include/mach/omap4_rom_usb.h create mode 100644 arch/arm/mach-omap/omap4_rom_usb.c create mode 100644 drivers/serial/serial_omap4_usbboot.c create mode 100644 fs/omap4_usbbootfs.c create mode 100644 scripts/omap4_usbboot.c create mode 100644 scripts/usb.h create mode 100644 scripts/usb_linux.c
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/14 twl6030: add debug info
--- drivers/mfd/twl6030.c | 21 +++++++++++++++++++++ include/mfd/twl6030.h | 8 ++++++++ 2 files changed, 29 insertions(+)
drivers/mfd/twl6030.c +21 -0
@@ -39,6 +39,27 @@ static int twl_probe(struct device_d *dev)devfs_create (&(twl_dev->core.cdev)); +if (IS_ENABLED (CONFIG_DEBUG )) { +u8 i, jtag_rev, eprom_rev; +int r; +u64 dieid; + + r =twl6030_reg_read (twl_dev,TWL6030_JTAG_JTAGVERNUM , + &jtag_rev); + r |=twl6030_reg_read (twl_dev,TWL6030_JTAG_EPROM_REV , + &eprom_rev); +for (i =0 ; i <8 ; i++) + r |=twl6030_reg_read (twl_dev,TWL6030_DIEID_0 +i, + ((u8 *)(&dieid))+i); +if (r) +dev_dbg (dev,"TWL6030 Error reading ID\n" ); +else +dev_dbg (dev,"TWL6030 JTAG REV: 0x%02X, " +"EPROM REV: 0x%02X, " +"DIE ID: 0x%016llX\n" , + (unsigned )jtag_rev, (unsigned )eprom_rev, dieid); + } +return 0 ; }
include/mfd/twl6030.h +8 -0
@@ -371,6 +371,14 @@ enum twl6030_reg {/* JTAG */ TWL6030_JTAG_JTAGVERNUM =0x0287 ,TWL6030_JTAG_EPROM_REV =0x02DF , +TWL6030_DIEID_0 =0x02C0 , +TWL6030_DIEID_1 =0x02C1 , +TWL6030_DIEID_2 =0x02C2 , +TWL6030_DIEID_3 =0x02C3 , +TWL6030_DIEID_4 =0x02C4 , +TWL6030_DIEID_5 =0x02C5 , +TWL6030_DIEID_6 =0x02C6 , +TWL6030_DIEID_7 =0x02C7 ,/* GPADC Trimming */ TWL6030_GPADC_TRIM1 =0x02CD , TWL6030_GPADC_TRIM2 = 0x02CE,
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/14 omap4: add rename definitions to match datasheet
In reply to Vicente--- arch/arm/boards/panda/mux.c | 52 ++++++++-------- arch/arm/boards/pcm049/mux.c | 44 +++++++------- arch/arm/boards/phycard-a-xl2/mux.c | 46 +++++++------- arch/arm/mach-omap/include/mach/omap4-mux.h | 80 ++++++++++++++++--------- arch/arm/mach-omap/include/mach/omap4-silicon.h | 13 ++++ 5 files changed, 136 insertions(+), 99 deletions(-)
arch/arm/boards/panda/mux.c +26 -26
@@ -212,31 +212,31 @@ static const struct pad_conf_entry core_padconf_array[] = { };static const struct pad_conf_entry wkup_padconf_array[] = { - {PAD0_SIM_IO ,IEN |M0 /* sim_io */ }, - {PAD1_SIM_CLK ,M0 /* sim_clk */ }, - {PAD0_SIM_RESET ,M0 /* sim_reset */ }, - {PAD1_SIM_CD ,PTU |IEN |M0 /* sim_cd */ }, - {PAD0_SIM_PWRCTRL ,M0 /* sim_pwrctrl */ }, - {PAD1_SR_SCL ,PTU |IEN |M0 /* sr_scl */ }, - {PAD0_SR_SDA ,PTU |IEN |M0 /* sr_sda */ }, - {PAD1_FREF_XTAL_IN ,M0 /* # */ }, - {PAD0_FREF_SLICER_IN ,M0 /* fref_slicer_in */ }, - {PAD1_FREF_CLK_IOREQ ,M0 /* fref_clk_ioreq */ }, - {PAD0_FREF_CLK0_OUT ,M2 /* sys_drm_msecure */ }, - {PAD1_FREF_CLK3_REQ ,PTU |IEN |M0 /* # */ }, - {PAD0_FREF_CLK3_OUT ,M0 /* fref_clk3_out */ }, - {PAD1_FREF_CLK4_REQ ,PTU |IEN |M0 /* # */ }, - {PAD0_FREF_CLK4_OUT ,M0 /* # */ }, - {PAD1_SYS_32K ,IEN |M0 /* sys_32k */ }, - {PAD0_SYS_NRESPWRON ,M0 /* sys_nrespwron */ }, - {PAD1_SYS_NRESWARM ,M0 /* sys_nreswarm */ }, - {PAD0_SYS_PWR_REQ ,PTU |M0 /* sys_pwr_req */ }, - {PAD1_SYS_PWRON_RESET ,M3 /* gpio_wk29 */ }, - {PAD0_SYS_BOOT6 ,IEN |M3 /* gpio_wk9 */ }, - {PAD1_SYS_BOOT7 ,IEN |M3 /* gpio_wk10 */ }, - {PAD1_FREF_CLK3_REQ ,M3 /* gpio_wk30 */ }, - {PAD1_FREF_CLK4_REQ ,M3 /* gpio_wk7 */ }, - {PAD0_FREF_CLK4_OUT ,M3 /* gpio_wk8 */ }, + {GPIO_WK0 ,IEN |M0 /* sim_io */ }, + {GPIO_WK1 ,M0 /* sim_clk */ }, + {GPIO_WK2 ,M0 /* sim_reset */ }, + {GPIO_WK3 ,PTU |IEN |M0 /* sim_cd */ }, + {GPIO_WK4 ,M0 /* sim_pwrctrl */ }, + {SR_SCL ,PTU |IEN |M0 /* sr_scl */ }, + {SR_SDA ,PTU |IEN |M0 /* sr_sda */ }, + {FREF_XTAL_IN ,M0 /* # */ }, + {FREF_SLICER_IN ,M0 /* fref_slicer_in */ }, + {FREF_CLK_IOREQ ,M0 /* fref_clk_ioreq */ }, + {FREF_CLK0_OUT ,M2 /* sys_drm_msecure */ }, + {FREF_CLK3_REQ ,PTU |IEN |M0 /* # */ }, + {FREF_CLK3_OUT ,M0 /* fref_clk3_out */ }, + {FREF_CLK4_REQ ,PTU |IEN |M0 /* # */ }, + {FREF_CLK4_OUT ,M0 /* # */ }, + {SYS_32K ,IEN |M0 /* sys_32k */ }, + {SYS_NRESPWRON ,M0 /* sys_nrespwron */ }, + {SYS_NRESWARM ,M0 /* sys_nreswarm */ }, + {SYS_PWR_REQ ,PTU |M0 /* sys_pwr_req */ }, + {SYS_PWRON_RESET_OUT ,M3 /* gpio_wk29 */ }, + {SYS_BOOT6 ,IEN |M3 /* gpio_wk9 */ }, + {SYS_BOOT7 ,IEN |M3 /* gpio_wk10 */ }, + {FREF_CLK3_REQ ,M3 /* gpio_wk30 */ }, + {FREF_CLK4_REQ ,M3 /* gpio_wk7 */ }, + {FREF_CLK4_OUT ,M3 /* gpio_wk8 */ }, };void set_muxconf_regs (void )
@@ -249,7 +249,7 @@ void set_muxconf_regs(void)/* gpio_wk7 is used for controlling TPS on 4460 */ if (omap4_revision () >=OMAP4460_ES1_0 ) { -writew (M3 ,OMAP44XX_CONTROL_PADCONF_WKUP +PAD1_FREF_CLK4_REQ ); +writew (M3 ,OMAP44XX_CONTROL_PADCONF_WKUP +FREF_CLK4_REQ );/* Enable GPIO-1 clocks before TPS initialization */ omap4_enable_gpio1_wup_clocks (); }
arch/arm/boards/pcm049/mux.c +22 -22
50 lines not on this page · raw message
arch/arm/boards/phycard-a-xl2/mux.c +23 -23
58 lines not on this page · raw message
arch/arm/mach-omap/include/mach/omap4-mux.h +52 -28
129 lines not on this page · raw message
arch/arm/mach-omap/include/mach/omap4-silicon.h +13 -0
@@ -72,6 +72,12 @@#define OMAP44XX_UART2_BASE (OMAP44XX_L4_PER_BASE + 0x6c000)#define OMAP44XX_UART3_BASE (OMAP44XX_L4_PER_BASE + 0x20000) +/* I2C */ +#define OMAP44XX_I2C1_BASE (OMAP44XX_L4_PER_BASE + 0x070000) +#define OMAP44XX_I2C2_BASE (OMAP44XX_L4_PER_BASE + 0x072000) +#define OMAP44XX_I2C3_BASE (OMAP44XX_L4_PER_BASE + 0x060000) +#define OMAP44XX_I2C4_BASE (OMAP44XX_L4_PER_BASE + 0x350000) +/* General Purpose Timers */ #define OMAP44XX_GPT1_BASE (OMAP44XX_L4_WKUP_BASE + 0x18000)#define OMAP44XX_GPT2_BASE (OMAP44XX_L4_PER_BASE + 0x32000)
@@ -88,6 +94,13 @@/* 32KTIMER */ #define OMAP_32KTIMER_BASE (OMAP44XX_L4_WKUP_BASE + 0x4000) +/* MMC */ +#define OMAP44XX_MMC1_BASE (OMAP44XX_L4_PER_BASE + 0x09C100) +#define OMAP44XX_MMC2_BASE (OMAP44XX_L4_PER_BASE + 0x0B4100) +#define OMAP44XX_MMC3_BASE (OMAP44XX_L4_PER_BASE + 0x0AD100) +#define OMAP44XX_MMC4_BASE (OMAP44XX_L4_PER_BASE + 0x0D1100) +#define OMAP44XX_MMC5_BASE (OMAP44XX_L4_PER_BASE + 0x0D5100) +/* GPMC */ #define OMAP_GPMC_BASE 0x50000000
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/14 ARM: import irq handling from linux
In reply to Vicente--- arch/arm/cpu/exceptions.S | 1 - arch/arm/cpu/interrupts.c | 6 +- arch/arm/include/asm/irqflags.h | 155 ++++++++++++++++++++++++++++++++++++++++ arch/arm/include/asm/ptrace.h | 55 +++++++------- 4 files changed, 188 insertions(+), 29 deletions(-) create mode 100644 arch/arm/include/asm/irqflags.h
arch/arm/cpu/exceptions.S +0 -1
@@ -35,7 +35,6 @@ #define S_R0 0 #define MODE_SVC 0x13 -#define I_BIT 0x80 _STACK_START: .word STACK_BASE + STACK_SIZE - 4
arch/arm/cpu/interrupts.c +3 -3
@@ -57,9 +57,9 @@ void show_regs (struct pt_regs *regs)printf ("r3 : %08lx r2 : %08lx r1 : %08lx r0 : %08lx\n" , regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0);printf ("Flags: %c%c%c%c" , - flags &CC_N_BIT ?'N' :'n' , - flags &CC_Z_BIT ?'Z' :'z' , - flags &CC_C_BIT ?'C' :'c' , flags &CC_V_BIT ?'V' :'v' ); + flags &PSR_N_BIT ?'N' :'n' , + flags &PSR_Z_BIT ?'Z' :'z' , + flags &PSR_C_BIT ?'C' :'c' , flags &PSR_V_BIT ?'V' :'v' ); printf (" IRQs %s FIQs %s Mode %s%s\n", interrupts_enabled (regs) ? "on" : "off", fast_interrupts_enabled (regs) ? "on" : "off",
arch/arm/include/asm/irqflags.h new file +155 -0
155 lines not on this page · raw message
arch/arm/include/asm/ptrace.h +30 -25
88 lines not on this page · raw message
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/14 ARM: ensure irqs are disabled
In reply to Vicente--- arch/arm/cpu/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/cpu/cpu.c +7 -0
@@ -28,6 +28,7 @@#include <asm/mmu.h> #include <asm/system.h> #include <asm/memory.h> +#include <asm/irqflags.h> /** * Enable processor's instruction cache
@@ -85,6 +86,12 @@ void arch_shutdown(void) : "r0", "r1", "r2", "r3", "r6", "r10", "r12", "lr", "cc", "memory" );#endif +/* +* barebox normally does not use interrupts, but some functionalities +* (eg. OMAP4_USBBOOT) require them enabled. So be sure interrupts are +* disabled before exiting. +*/ +arch_local_irq_disable (); }#ifdef CONFIG_THUMB2_BAREBOX
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/14 omap: revert gpiolib
In reply to VicenteBy now it is still required as the changes proposed:
base should be calculated as dev->id * 32 region size should be reduced to 0x0f00
Does not solve the issue.
--- arch/arm/Kconfig | 1 - arch/arm/mach-omap/gpio.c | 170 ++++++++++++++++++++----------------- arch/arm/mach-omap/omap3_generic.c | 19 ----- arch/arm/mach-omap/omap4_generic.c | 19 ----- 4 files changed, 93 insertions(+), 116 deletions(-)
arch/arm/Kconfig +0 -1
@@ -60,7 +60,6 @@ config ARCH_NOMADIK config ARCH_OMAP bool "TI OMAP" select HAS_DEBUG_LL - select GPIOLIB config ARCH_PXA bool "Intel/Marvell PXA based"
arch/arm/mach-omap/gpio.c +93 -77
217 lines not on this page · raw message
arch/arm/mach-omap/omap3_generic.c +0 -19
@@ -511,22 +511,3 @@ const struct gpmc_config omap3_nand_cfg = { .base = 0x28000000, .size = GPMC_SIZE_16M, }; - -static int omap3_gpio_init (void ) -{ -add_generic_device ("omap-gpio" ,0 ,NULL ,0x48310000 , -0x100 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,1 ,NULL ,0x49050000 , -0x100 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,2 ,NULL ,0x49052000 , -0x100 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,3 ,NULL ,0x49054000 , -0x100 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,4 ,NULL ,0x49056000 , -0x100 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,5 ,NULL ,0x49058000 , -0x100 ,IORESOURCE_MEM ,NULL ); - -return 0 ; -} -coredevice_initcall (omap3_gpio_init);
arch/arm/mach-omap/omap4_generic.c +0 -19
@@ -572,22 +572,3 @@ const struct gpmc_config omap4_nand_cfg = { .base = 0x28000000, .size = GPMC_SIZE_16M, }; - -static int omap4_gpio_init (void ) -{ -add_generic_device ("omap-gpio" ,0 ,NULL ,0x4a310100 , -0x1000 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,1 ,NULL ,0x48055100 , -0x1000 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,2 ,NULL ,0x48057100 , -0x1000 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,3 ,NULL ,0x48059100 , -0x1000 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,4 ,NULL ,0x4805b100 , -0x1000 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("omap-gpio" ,5 ,NULL ,0x4805d100 , -0x1000 ,IORESOURCE_MEM ,NULL ); - -return 0 ; -} -coredevice_initcall (omap4_gpio_init);
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 6/14 omap4: add usb boot source
In reply to Vicente--- arch/arm/mach-omap/include/mach/xload.h | 1 + arch/arm/mach-omap/omap4_generic.c | 2 ++ 2 files changed, 3 insertions(+)
arch/arm/mach-omap/include/mach/xload.h +1 -0
@@ -6,6 +6,7 @@ enum omap_boot_src {OMAP_BOOTSRC_MMC1 ,OMAP_BOOTSRC_NAND ,OMAP_BOOTSRC_SPI1 , + OMAP_BOOTSRC_USB1, };enum omap_boot_src omap3_bootsrc (void );
arch/arm/mach-omap/omap4_generic.c +2 -0
@@ -481,6 +481,8 @@ enum omap_boot_src omap4_bootsrc(void)return OMAP_BOOTSRC_MMC1 ;if (bootsrc & (1 <<3 ))return OMAP_BOOTSRC_NAND ; +if (bootsrc & (1 <<20 )) +return OMAP_BOOTSRC_USB1 ;return OMAP_BOOTSRC_UNKNOWN ; }
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 7/14 bootm: close open files
In reply to Vicente--- arch/arm/lib/bootm.c | 4 +++- commands/bootm.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-)
arch/arm/lib/bootm.c +3 -1
@@ -269,8 +269,9 @@ static int do_bootz_linux(struct image_data *data) ret =do_bootz_linux_fdt (fd, data);if (ret && ret != -ENXIO ) -return ret; + goto err_out; +close (fd);return __do_bootm_linux (data, swap); err_out:
@@ -431,6 +432,7 @@ static int do_bootm_aimage(struct image_data *data)reset_cpu (0 ); } +close (fd);return __do_bootm_linux (data,0 ); err_out:
commands/bootm.c +5 -1
@@ -70,6 +70,7 @@ static int bootm_open_os_uimage(struct image_data *data)if (ret) {printf ("Checking data crc failed with %s\n" ,strerror (-ret)); +uimage_close (data->os);return ret; } }
@@ -79,6 +80,7 @@ static int bootm_open_os_uimage(struct image_data *data)if (data->os->header.ih_arch !=IH_ARCH ) {printf ("Unsupported Architecture 0x%x\n" , data->os->header.ih_arch); +uimage_close (data->os);return -EINVAL ; }
@@ -88,8 +90,10 @@ static int bootm_open_os_uimage(struct image_data *data)if (data->os_address !=UIMAGE_INVALID_ADDRESS ) { data->os_res =uimage_load_to_sdram (data->os,0 , data->os_address); -if (!data->os_res) +if (!data->os_res) { +uimage_close (data->os);return -ENOMEM ; + } }return 0 ;
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 8/14 uimage: improve transfer speed
In reply to Vicente--- common/uimage.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)
common/uimage.c +25 -2
@@ -28,6 +28,8 @@#include <rtc.h> #include <filetype.h> #include <memory.h> +#include <linux/stat.h> +#include <sizes.h> #ifdef CONFIG_UIMAGE_MULTI static inline int uimage_is_multi_image (struct uimage_handle *handle)
@@ -380,15 +382,36 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr)struct resource *res;size_t size =BUFSIZ ;size_t ofs =0 ; +size_t now;int fd; +struct stat s; fd =open (filename,O_RDONLY );if (fd <0 )return NULL ; -while (1 ) { -size_t now; +/* TODO: use fstat(fd, &s) when implemented and avoid reopening file */ +if (stat (filename, &s) ==0 && s.st_size <=SZ_1G ) { +/* +* As the file size is known we can read it at once and improve +* transfer speed. +*/ + size = s.st_size; + res =request_sdram_region ("image" , adr, size); +if (!res) { +printf ("unable to request SDRAM 0x%08lx-0x%08lx\n" , + adr, adr + size -1 ); + goto out; + } + now =read_full (fd, (void *)(res->start), size); +if (now < size) { +release_sdram_region (res); + res =NULL ; + } + goto out; + } +while (1 ) { res =request_sdram_region ("image" , adr, size);if (!res) { printf("unable to request SDRAM 0x%08lx-0x%08lx\n",
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 9/14 fs: improve robustness
In reply to Vicente--- fs/fs.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
fs/fs.c +18 -9
@@ -715,12 +715,13 @@ int ioctl(int fd, int request, void *buf) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);
@@ -738,12 +739,13 @@ int read(int fd, void *buf, size_t count) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);
@@ -768,12 +770,13 @@ ssize_t write(int fd, const void *buf, size_t count) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);
@@ -803,12 +806,13 @@ int flush(int fd) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);
@@ -827,13 +831,14 @@ loff_t lseek(int fildes, loff_t offset, int whence) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fildes]; +FILE *f;loff_t pos;int ret;if (check_fd (fildes))return -1 ; + f = &files[fildes]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);if (!fsdrv->lseek) {
@@ -877,11 +882,12 @@ int erase(int fd, size_t count, unsigned long offset) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd];if (offset >= f->size)return 0 ;if (count > f->size - offset)
@@ -905,11 +911,12 @@ int protect(int fd, size_t count, unsigned long offset, int prot) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd];if (offset >= f->size)return 0 ;if (count > f->size - offset)
@@ -948,13 +955,14 @@ void *memmap(int fd, int flags) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;void *retp = (void *)-1 ;int ret;if (check_fd (fd))return retp; + f = &files[fd]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);
@@ -975,12 +983,13 @@ int close(int fd) {struct device_d *dev;struct fs_driver_d *fsdrv; -FILE *f = &files[fd]; +FILE *f;int ret;if (check_fd (fd))return -errno; + f = &files[fd]; dev = f->dev; fsdrv =dev_to_fs_driver (dev);
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 10/14 omap4: add support for booting cpu from usb
In reply to Vicente--- Documentation/oamp4_usb_booting.txt | 27 ++ arch/arm/mach-omap/Kconfig | 9 + arch/arm/mach-omap/Makefile | 1 + arch/arm/mach-omap/include/mach/omap4_rom_usb.h | 141 ++++++++ arch/arm/mach-omap/omap4_generic.c | 23 +- arch/arm/mach-omap/omap4_rom_usb.c | 198 +++++++++++ scripts/.gitignore | 1 + scripts/Makefile | 4 + scripts/omap4_usbboot.c | 415 ++++++++++++++++++++++++ scripts/usb.h | 61 ++++ scripts/usb_linux.c | 397 +++++++++++++++++++++++ 11 files changed, 1270 insertions(+), 7 deletions(-) create mode 100644 Documentation/oamp4_usb_booting.txt create mode 100644 arch/arm/mach-omap/include/mach/omap4_rom_usb.h create mode 100644 arch/arm/mach-omap/omap4_rom_usb.c create mode 100644 scripts/omap4_usbboot.c create mode 100644 scripts/usb.h create mode 100644 scripts/usb_linux.c
Documentation/oamp4_usb_booting.txt new file +27 -0
@@ -0,0 +1,27 @@ +-------------- omap4_usb_booting -------------- + +omap4 processors have support for booting from the usb port. To be able to fully +use this feature you will need to enable the following: + OMAP4_USBBOOT + This CONFIG_ option adds the required infrastructure. + DRIVER_SERIAL_OMAP4_USBBOOT + This adds console support over the same usb port used for booting. + FS_OMAP4_USBBOOT + This adds filesystem support over the same usb port used for booting. + +To send the bootloader to the processor, execute the utility omap4_usbboot which +can be found in the scripts subdirectory. +omap4_usbboot takes two parameters: + the bootloader image + a directory name which will be the root for the guest system +Once omap4_usbboot is running it will wait for enumeration of the omap4 cpu on +the host usb subsystem. Then power on or reset the cpu with the correct sys_boot +or SAR memory configuration. + +If everything works, barebox's first stage will boot and afterwards it will load +the second stage found at "/barebox.bin". +Barebox's second stage will still have access to the usb filesystem, so an +initrd and a zImage can be loaded. + +Overall this procedure frees the developer of continously be changing the SD +card or other boot media from host to target.
arch/arm/mach-omap/Kconfig +9 -0
@@ -82,6 +82,15 @@ config ARCH_TEXT_BASE default 0x80e80000 if MACH_OMAP343xSDP default 0x80e80000 if MACH_BEAGLE +config OMAP4_USBBOOT + bool "enable booting from USB" + default n + depends on ARCH_OMAP4 && !MMU + help + Say Y here if you want to be able to boot an OMAP4 cpu from USB. + You need the utility program omap4_usbboot to boot from USB. + Please read oamp4_usb_booting.txt for more information. + config BOARDINFO default "Texas Instrument's SDP343x" if MACH_OMAP343xSDP default "Texas Instrument's Beagle" if MACH_BEAGLE
arch/arm/mach-omap/Makefile +1 -0
@@ -26,4 +26,5 @@ obj-$(CONFIG_OMAP3_CLOCK_CONFIG) += omap3_clock.o obj-$(CONFIG_OMAP_GPMC) += gpmc.o devices-gpmc-nand.o obj-$(CONFIG_SHELL_NONE) += xload.o obj-$(CONFIG_I2C_TWL6030) += omap4_twl6030_mmc.o +obj-$(CONFIG_OMAP4_USBBOOT) += omap4_rom_usb.o obj-y += gpio.o
arch/arm/mach-omap/include/mach/omap4_rom_usb.h new file +141 -0
141 lines not on this page · raw message
arch/arm/mach-omap/omap4_generic.c +16 -7
@@ -8,6 +8,7 @@#include <mach/xload.h> #include <mach/gpmc.h> #include <mach/gpio.h> +#include <mach/omap4_rom_usb.h> /* * The following several lines are taken from U-Boot to support
@@ -459,13 +460,21 @@ late_initcall(watchdog_init);static int omap_vector_init (void ) { - __asm__ __volatile__ ( -"mov r0, #0;" -"mcr p15, #0, r0, c12, c0, #0;" - : - : - :"r0" - ); +/* +* omap4 usbboot interfaces with the omap4 ROM to reuse the USB port +* used for booting. +* The ROM code uses interrupts for the transfers, so do not modify the +* interrupt vectors in this case. +*/ +if (omap4_bootsrc () !=OMAP_BOOTSRC_USB1 ) { + __asm__ __volatile__ ( +"mov r0, #0;" +"mcr p15, #0, r0, c12, c0, #0;" + : + : + :"r0" + ); + }return 0 ; }
arch/arm/mach-omap/omap4_rom_usb.c new file +198 -0
198 lines not on this page · raw message
scripts/.gitignore +1 -0
@@ -6,3 +6,4 @@ mk-am35xx-spi-image mkimage mkublheader omap_signGP +omap4_usbboot
scripts/Makefile +4 -0
@@ -13,6 +13,10 @@ hostprogs-$(CONFIG_ARCH_OMAP) += omap_signGP mk-am35xx-spi-image hostprogs-$(CONFIG_ARCH_S5PCxx) += s5p_cksum hostprogs-$(CONFIG_ARCH_DAVINCI) += mkublheader +HOSTLOADLIBES_omap4_usbboot = -lpthread +omap4_usbboot-objs := usb_linux.o omap4_usbboot.o +hostprogs-$(CONFIG_OMAP4_USBBOOT)+= omap4_usbboot + always := $(hostprogs-y) $(hostprogs-m) subdir-y += mod
scripts/omap4_usbboot.c new file +415 -0
415 lines not on this page · raw message
scripts/usb.h new file +61 -0
61 lines not on this page · raw message
scripts/usb_linux.c new file +397 -0
397 lines not on this page · raw message
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 11/14 omap4: add serial communications over usb boot
In reply to Vicente--- drivers/serial/Kconfig | 7 +++ drivers/serial/Makefile | 1 + drivers/serial/serial_omap4_usbboot.c | 83 +++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 drivers/serial/serial_omap4_usbboot.c
drivers/serial/Kconfig +7 -0
@@ -100,4 +100,11 @@ config DRIVER_SERIAL_PXA bool "PXA serial driver" depends on ARCH_PXA +config DRIVER_SERIAL_OMAP4_USBBOOT + bool "serial driver over omap4 usb" + default n + depends on OMAP4_USBBOOT + help + Enable this to get console support over the usb bus used to boot an OMAP4 + endmenu
drivers/serial/Makefile +1 -0
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRIVER_SERIAL_S3C) += serial_s3c.o obj-$(CONFIG_DRIVER_SERIAL_ALTERA) += serial_altera.o obj-$(CONFIG_DRIVER_SERIAL_ALTERA_JTAG) += serial_altera_jtag.o obj-$(CONFIG_DRIVER_SERIAL_PXA) += serial_pxa.o +obj-$(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT) += serial_omap4_usbboot.o
drivers/serial/serial_omap4_usbboot.c new file +83 -0
83 lines not on this page · raw message
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 12/14 omap4: add filesystem support over usb boot
In reply to Vicente--- fs/Kconfig | 5 ++ fs/Makefile | 1 + fs/omap4_usbbootfs.c | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 225 insertions(+) create mode 100644 fs/omap4_usbbootfs.c
fs/Kconfig +5 -0
@@ -29,6 +29,11 @@ config FS_TFTP prompt "tftp support" depends on NET +config FS_OMAP4_USBBOOT + bool + prompt "Filesystem over usb boot" + depends on OMAP4_USBBOOT + config FS_NFS depends on NET bool
fs/Makefile +1 -0
@@ -5,4 +5,5 @@ obj-$(CONFIG_FS_DEVFS) += devfs.o obj-$(CONFIG_FS_FAT) += fat/ obj-y += fs.o obj-$(CONFIG_FS_TFTP) += tftp.o +obj-$(CONFIG_FS_OMAP4_USBBOOT) += omap4_usbbootfs.o obj-$(CONFIG_FS_NFS) += nfs.o
fs/omap4_usbbootfs.c new file +219 -0
219 lines not on this page · raw message
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 13/14 omap4: add support for loading second stage from usb
In reply to Vicente--- arch/arm/mach-omap/xload.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
arch/arm/mach-omap/xload.c +26 -0
@@ -139,6 +139,24 @@ static void *omap_xload_boot_spi(int offset)return to; } +static void *omap4_xload_boot_usb (void ){ +int ret; +void *buf; +int len; + + ret =mount ("omap4_usbboot" ,"omap4_usbbootfs" ,"/" ); +if (ret) { +printf ("Unable to mount omap4_usbbootfs (%d)\n" , ret); +return NULL ; + } + + buf =read_file ("/barebox.bin" , &len); +if (!buf) +printf ("could not read barebox.bin from omap4_usbbootfs\n" ); + +return buf; +} +enum omap_boot_src omap_bootsrc (void ) {#if defined(CONFIG_ARCH_OMAP3 )
@@ -161,6 +179,14 @@ int run_shell(void)printf ("booting from MMC1\n" ); func =omap_xload_boot_mmc ();break ; +case OMAP_BOOTSRC_USB1 : +if (IS_ENABLED (CONFIG_FS_OMAP4_USBBOOT )) { +printf ("booting from USB1\n" ); + func =omap4_xload_boot_usb (); +break ; + }else { +printf ("booting from usb1 not enabled\n" ); + }case OMAP_BOOTSRC_UNKNOWN :printf ("unknown boot source. Fall back to nand\n" );case OMAP_BOOTSRC_NAND :
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 14/14 Add support for Archos G9 tablet
In reply to Vicente--- arch/arm/Makefile | 1 + arch/arm/boards/archosg9/Makefile | 3 + arch/arm/boards/archosg9/board.c | 71 +++++ arch/arm/boards/archosg9/config.h | 1 + arch/arm/boards/archosg9/env/config | 1 + arch/arm/boards/archosg9/env/init/usbboot | 5 + arch/arm/boards/archosg9/lowlevel.c | 79 +++++ arch/arm/boards/archosg9/mux.c | 459 ++++++++++++++++++++++++++++++ arch/arm/boards/archosg9/mux.h | 6 + arch/arm/configs/archosg9_defconfig | 70 +++++ arch/arm/configs/archosg9_xload_defconfig | 24 ++ arch/arm/mach-omap/Kconfig | 9 + 12 files changed, 729 insertions(+) create mode 100644 arch/arm/boards/archosg9/Makefile create mode 100644 arch/arm/boards/archosg9/board.c create mode 100644 arch/arm/boards/archosg9/config.h create mode 100644 arch/arm/boards/archosg9/env/config create mode 100644 arch/arm/boards/archosg9/env/init/usbboot create mode 100644 arch/arm/boards/archosg9/lowlevel.c create mode 100644 arch/arm/boards/archosg9/mux.c create mode 100644 arch/arm/boards/archosg9/mux.h create mode 100644 arch/arm/configs/archosg9_defconfig create mode 100644 arch/arm/configs/archosg9_xload_defconfig
arch/arm/Makefile +1 -0
@@ -101,6 +101,7 @@ board-$(CONFIG_MACH_OMAP343xSDP) := omap343xdsp board-$(CONFIG_MACH_BEAGLE) := beagle board-$(CONFIG_MACH_OMAP3EVM) := omap3evm board-$(CONFIG_MACH_PANDA) := panda +board-$(CONFIG_MACH_ARCHOSG9) := archosg9 board-$(CONFIG_MACH_PCM049) := pcm049 board-$(CONFIG_MACH_PCA100) := phycard-i.MX27 board-$(CONFIG_MACH_PCAAL1) := phycard-a-l1
arch/arm/boards/archosg9/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +obj-y += board.o +obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel.o mux.o +pbl-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel.o mux.o
arch/arm/boards/archosg9/board.c new file +71 -0
71 lines not on this page · raw message
arch/arm/boards/archosg9/config.h new file +1 -0
@@ -0,0 +1 @@ +/* nothing */
arch/arm/boards/archosg9/env/config new file +1 -0
@@ -0,0 +1 @@ +global.linux.bootargs.base="earlyprintk=serial console=ttyO1,1000000n8 keep_bootcon pm_disable initcall_debug ignore_loglevel no_console_suspend=1 root=/dev/ram0 init=/linuxrc"
arch/arm/boards/archosg9/env/init/usbboot new file +5 -0
@@ -0,0 +1,5 @@ +mkdir /usb +mount -t omap4_usbbootfs omap4_usbboot /usb +. /env/config +. /usb/boot/config +bootm -r /usb/boot/initrd /usb/boot/zImage
arch/arm/boards/archosg9/lowlevel.c new file +79 -0
79 lines not on this page · raw message
arch/arm/boards/archosg9/mux.c new file +459 -0
459 lines not on this page · raw message
arch/arm/boards/archosg9/mux.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _MUX_H +#define _MUX_H + +void set_muxconf_regs (void ); + +#endif /* _MUX_H */
arch/arm/configs/archosg9_defconfig new file +70 -0
70 lines not on this page · raw message
arch/arm/configs/archosg9_xload_defconfig new file +24 -0
@@ -0,0 +1,24 @@ +CONFIG_MACH_ARCHOSG9=y +CONFIG_ARCH_OMAP=y +CONFIG_ARCH_OMAP4=y +# CONFIG_OMAP_GPMC is not set +CONFIG_OMAP_BUILD_IFT=y +CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000 +CONFIG_AEABI=y +CONFIG_OMAP4_USBBOOT=y +# CONFIG_CMD_ARM_CPUINFO is not set +CONFIG_TEXT_BASE=0x40300000 +CONFIG_MEMORY_LAYOUT_FIXED=y +CONFIG_STACK_BASE=0x8f000000 +CONFIG_MALLOC_BASE=0x84000000 +CONFIG_MALLOC_SIZE=0x2000000 +CONFIG_SHELL_NONE=y +# CONFIG_ERRNO_MESSAGES is not set +# CONFIG_TIMESTAMP is not set +# CONFIG_CONSOLE_FULL is not set +# CONFIG_DEFAULT_ENVIRONMENT is not set +CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y +# CONFIG_SPI is not set +# CONFIG_FS_RAMFS is not set +# CONFIG_FS_DEVFS is not set +CONFIG_FS_OMAP4_USBBOOT=y
arch/arm/mach-omap/Kconfig +9 -0
@@ -92,6 +92,7 @@ config OMAP4_USBBOOT Please read oamp4_usb_booting.txt for more information. config BOARDINFO + default "Archos G9" if MACH_ARCHOSG9 default "Texas Instrument's SDP343x" if MACH_OMAP343xSDP default "Texas Instrument's Beagle" if MACH_BEAGLE default "Texas Instrument's OMAP3EVM" if MACH_OMAP3EVM
@@ -131,6 +132,14 @@ config MACH_PANDA help Say Y here if you are using OMAP4 Panda board +config MACH_ARCHOSG9 + bool "Archos G9 tablets" + select HAVE_NOSHELL + select MACH_HAS_LOWLEVEL_INIT + depends on ARCH_OMAP4 + help + Say Y here if you are using OMAP4-based Archos G9 tablet + config MACH_PCM049 bool "Phytec phyCORE pcm049" select HAVE_NOSHELL
Signature · 7 lines
1.7.12.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 14/14] Add support for Archos G9 tablet
Quoted 38 lines
arch/arm/boards/archosg9/lowlevel.c new file +32
-0@@ -0,0 +1,79 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <common.h> +#include <io.h> +#include <init.h> +#include <mach/omap4-mux.h> +#include <mach/omap4-silicon.h> +#include <mach/omap4-clock.h> +#include <mach/syslib.h> +#include <asm/barebox-arm.h> +#include <asm/barebox-arm-head.h> +#include "mux.h" + +#define TPS62361_VSEL0_GPIO 7 + +static const struct ddr_regs ddr_regs_400_mhz_2cs = { + .tim1 =0x10EB0662 , + .tim2 =0x20370DD2 , + .tim3 =0x00B1C33F , + .phy_ctrl_1 =0x849FF408 , + .ref_ctrl =0x00000618 , + .config_init =0x80000EB9 ,
arch/arm/boards/archosg9/lowlevel.c line 42
Quoted 10 lines
arch/arm/boards/archosg9/lowlevel.c new file +10
-0+ .config_final = 0x80001AB9, + .zq_config = 0xD00B3215, + .mr1 = 0x83, + .mr2 = 0x4 +}; + +static noinline void archosg9_init_lowlevel(void) +{ +struct dpll_param core =OMAP4_CORE_DPLL_PARAM_19M2_DDR400 ; +struct dpll_param mpu =OMAP4_MPU_DPLL_PARAM_19M2_MPU600 ;
This if OPP100 for 4430, for 4460 OPP100 defines 700MHz.
Quoted 13 lines
arch/arm/boards/archosg9/lowlevel.c new file +13
-0+struct dpll_param iva =OMAP4_IVA_DPLL_PARAM_19M2 ; +struct dpll_param per =OMAP4_PER_DPLL_PARAM_19M2 ; +struct dpll_param abe =OMAP4_ABE_DPLL_PARAM_19M2 ; +struct dpll_param usb =OMAP4_USB_DPLL_PARAM_19M2 ; + +writel (CM_SYS_CLKSEL_19M2 ,CM_SYS_CLKSEL ); + +/* Configure all DPLL's at 100% OPP */ +omap4_configure_mpu_dpll (&mpu); +omap4_configure_iva_dpll (&iva); +omap4_configure_per_dpll (&per); +omap4_configure_abe_dpll (&abe); +omap4_configure_usb_dpll (&usb);
arch/arm/boards/archosg9/lowlevel.c line 65
Quoted 10 lines
arch/arm/boards/archosg9/lowlevel.c new file +10
-0+ +/* Enable all clocks */ +omap4_enable_all_clocks (); + +set_muxconf_regs (); + +omap4_ddr_init (&ddr_regs_400_mhz_2cs, &core); + +/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */ +omap4_scale_vcores (TPS62361_VSEL0_GPIO );
According to TIs DM the sequence for going into a higher OPP is to first raise the voltage. I saw this is also wrong on pandaboard. They also say rise core freq before mpu freq so the order should be omap4_scale_vcoresomap4_ddr_initomap4_configure_mpu_dpll
I'll fix and test the order on PCM049
Jan
Quoted 614 lines
arch/arm/boards/archosg9/lowlevel.c new file +14
-0+board_init_lowlevel_return (); +} + +void __naked __bare_init reset(void) +{ +u32 r; + +common_reset (); + + r =0x4030D000 ; + __asm__ __volatile__("mov sp, %0" : :"r" (r)); + +archosg9_init_lowlevel (); +}arch/arm/boards/archosg9/mux.c new file +459
-0@@ -0,0 +1,459 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <common.h> +#include <init.h> +#include <io.h> +#include <mach/omap4-silicon.h> +#include <mach/omap4-mux.h> +#include <mach/omap4-clock.h> +#include "mux.h" + +static const struct pad_conf_entry core_padconf_array[] = { +/* sdmmc2_dat0 */ /* internal FLASH */ + {GPMC_AD0 ,IEN |PTU |M1 }, +/* sdmmc2_dat1 */ /* internal FLASH */ + {GPMC_AD1 ,IEN |PTU |M1 }, +/* sdmmc2_dat2 */ /* internal FLASH */ + {GPMC_AD2 ,IEN |PTU |M1 }, +/* sdmmc2_dat3 */ /* internal FLASH */ + {GPMC_AD3 ,IEN |PTU |M1 }, +/* sdmmc2_dat4 */ /* internal FLASH */ + {GPMC_AD4 ,IEN |PTU |M1 }, +/* sdmmc2_dat5 */ /* internal FLASH */ + {GPMC_AD5 ,IEN |PTU |M1 }, +/* sdmmc2_dat6 */ /* internal FLASH */ + {GPMC_AD6 ,IEN |PTU |M1 }, +/* sdmmc2_dat7 */ /* internal FLASH */ + {GPMC_AD7 ,IEN |PTU |M1 }, +/* gpio_32 */ + {GPMC_AD8 ,IEN |PTD |M3 }, +/* gpmc_ad9 */ + {GPMC_AD9 ,IEN |PTU |M0 }, +/* gpio_34 */ /* 1v8_pwron */ + {GPMC_AD10 ,IEN |PTU |M3 }, +/* gpio_35 */ /* vcc_pwron */ + {GPMC_AD11 ,IEN |PTU |M3 }, +/* gpio_36 */ /* 5v_pwron */ + {GPMC_AD12 ,IEN |M3 }, +/* gpio_37 */ /* hdmi_pwr */ + {GPMC_AD13 ,IEN |M3 }, +/* gpio_38 */ /* lcd_pwon */ + {GPMC_AD14 ,IEN |M3 }, +/* gpio_39 */ /* lvds_en */ + {GPMC_AD15 ,IEN |M3 }, +/* gpio_40 */ /* 3g_enable */ + {GPMC_A16 ,IEN |M3 }, +/* gpio_41 */ /* gps_enable */ + {GPMC_A17 ,IEN |M3 }, +/* gpio_42 */ /* ehci_enable */ + {GPMC_A18 ,IEN |M3 }, +/* gpio_43 */ /* volume up */ + {GPMC_A19 ,IEN |M3 }, +/* gpio_44 */ /* volume down */ + {GPMC_A20 ,IEN |M3 }, +/* gpio_45 */ /* accel_int1 */ + {GPMC_A21 ,IEN |PTU |M3 }, +/* kpd_col6 */ + {GPMC_A22 ,IEN |PTD |M1 }, +/* kpd_col7 */ + {GPMC_A23 ,IEN |PTD |M1 }, +/* gpio_48 */ /* vbus_detect */ + {GPMC_A24 ,IEN |M3 }, +/* gpio_49 */ /* id */ + {GPMC_A25 ,IEN |PTU |M3 }, +/* gpmc_ncs0 */ + {GPMC_NCS0 ,IEN |PTU |M0 }, +/* gpio_51 */ /* compass_data_ready */ + {GPMC_NCS1 ,IEN |M3 }, +/* safe_mode */ + {GPMC_NCS2 ,IEN |PTU |M7 }, +/* gpio_53 */ /* lcd_rst */ + {GPMC_NCS3 ,IEN |M3 }, +/* gpmc_nwp */ + {GPMC_NWP ,IEN |PTD |M0 }, +/* gpmc_clk */ + {GPMC_CLK ,IEN |PTD |M0 }, +/* gpmc_nadv_ale */ + {GPMC_NADV_ALE ,IEN |PTD |M0 }, +/* sdmmc2_clk */ /* internal FLASH */ + {GPMC_NOE ,IEN |PTU |M1 }, +/* sdmmc2_cmd */ /* internal FLASH */ + {GPMC_NWE ,IEN |PTU |M1 }, +/* gpmc_nbe0_cle */ + {GPMC_NBE0_CLE ,IEN |PTD |M0 }, +/* safe_mode */ + {GPMC_NBE1 ,IEN |PTD |M7 }, +/* gpmc_wait0 */ + {GPMC_WAIT0 ,IEN |PTU |M0 }, +/* gpio_62 */ /* camera_reset */ + {GPMC_WAIT1 ,IEN |M3 }, +/* safe_mode */ + {GPMC_WAIT2 ,IEN |PTD |M7 }, +/* gpio_101 */ /* lcd_stdby */ + {GPMC_NCS4 ,M3 }, +/* gpio_102 */ /* wifi_irq */ + {GPMC_NCS5 ,IEN |M3 }, +/* gpio_103 */ /* wifi_power */ + {GPMC_NCS6 ,M3 }, +/* gpio_104 */ /* bt_power */ + {GPMC_NCS7 ,IEN |M3 }, +/* gpio_63 */ /* hdmi_hpd ?? */ + {GPIO63 ,IEN |PTD |M3 }, +/* */ + {GPIO64 ,IEN |M0 }, +/* */ + {GPIO65 ,IEN |M0 }, +/* */ + {GPIO66 ,IEN |M0 }, +/* csi21_dx0 */ + {CSI21_DX0 ,IEN |M0 }, +/* csi21_dy0 */ + {CSI21_DY0 ,IEN |M0 }, +/* csi21_dx1 */ + {CSI21_DX1 ,IEN |M0 }, +/* csi21_dy1 */ + {CSI21_DY1 ,IEN |M0 }, +/* safe_mode */ + {CSI21_DX2 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI21_DY2 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI21_DX3 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI21_DY3 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI21_DX4 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI21_DY4 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI22_DX0 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI22_DY0 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI22_DX1 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI22_DY1 ,IEN |PTD |M7 }, +/* cam_shutter */ + {CAM_SHUTTER ,PTD |M0 }, +/* cam_strobe */ + {CAM_STROBE ,PTD |M0 }, +/* gpio_83 */ + {CAM_GLOBALRESET ,PTD |M3 }, +/* usbb1_ulpiphy_clk */ + {USBB1_ULPITLL_CLK ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_stp */ + {USBB1_ULPITLL_STP ,M4 }, +/* usbb1_ulpiphy_dir */ + {USBB1_ULPITLL_DIR ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_nxt */ + {USBB1_ULPITLL_NXT ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat0 */ + {USBB1_ULPITLL_DAT0 ,WAKEUP_EN |IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat1 */ + {USBB1_ULPITLL_DAT1 ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat2 */ + {USBB1_ULPITLL_DAT2 ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat3 */ + {USBB1_ULPITLL_DAT3 ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat4 */ + {USBB1_ULPITLL_DAT4 ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat5 */ + {USBB1_ULPITLL_DAT5 ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat6 */ + {USBB1_ULPITLL_DAT6 ,IEN |PTD |M4 }, +/* usbb1_ulpiphy_dat7 */ + {USBB1_ULPITLL_DAT7 ,IEN |PTD |M4 }, +/* usbb1_hsic_data */ + {USBB1_HSIC_DATA ,M0 }, +/* usbb1_hsic_strobe */ + {USBB1_HSIC_STROBE ,M0 }, +/* usbc1_icusb_dp */ + {USBC1_ICUSB_DP ,M0 }, +/* usbc1_icusb_dm */ + {USBC1_ICUSB_DM ,M0 }, +/* sdmmc1_clk */ /* SD card */ + {SDMMC1_CLK ,PTU |M0 }, +/* sdmmc1_cmd */ /* SD card */ + {SDMMC1_CMD ,IEN |PTU |M0 }, +/* sdmmc1_dat0 */ /* SD card */ + {SDMMC1_DAT0 ,IEN |PTU |M0 }, +/* sdmmc1_dat1 */ /* SD card */ + {SDMMC1_DAT1 ,IEN |PTU |M0 }, +/* sdmmc1_dat2 */ /* SD card */ + {SDMMC1_DAT2 ,IEN |PTU |M0 }, +/* sdmmc1_dat3 */ /* SD card */ + {SDMMC1_DAT3 ,IEN |PTU |M0 }, +/* sdmmc1_dat4 */ /* SD card */ + {SDMMC1_DAT4 ,IEN |PTU |M0 }, +/* sdmmc1_dat5 */ /* SD card */ + {SDMMC1_DAT5 ,IEN |PTU |M0 }, +/* sdmmc1_dat6 */ /* SD card */ + {SDMMC1_DAT6 ,IEN |PTU |M0 }, +/* sdmmc1_dat7 */ /* SD card */ + {SDMMC1_DAT7 ,IEN |PTU |M0 }, +/* gpio_110 */ /* tsp_pwr_gpio */ + {ABE_MCBSP2_CLKX ,M3 }, +/* gpio_111 */ /* vbus_musb_pwron */ + {ABE_MCBSP2_DR ,IEN |M3 }, +/* gpio_112 */ /* tsp_irq_gpio */ + {ABE_MCBSP2_DX ,WAKEUP_EN |IEN |PTU |M3 }, +/* gpio_113 */ /* vbus_flag */ + {ABE_MCBSP2_FSX ,IEN |PTU |M3 }, +/* safe_mode */ + {ABE_MCBSP1_CLKX ,IEN |PTD |M7 }, +/* safe_mode */ + {ABE_MCBSP1_DR ,IEN |PTD |M7 }, +/* abe_mcbsp1_dx */ + {ABE_MCBSP1_DX ,M0 }, +/* abe_mcbsp1_fsx */ + {ABE_MCBSP1_FSX ,IEN |M0 }, +/* abe_pdm_ul_data */ + {ABE_PDM_UL_DATA ,IEN |M0 }, +/* abe_pdm_dl_data */ + {ABE_PDM_DL_DATA ,M0 }, +/* abe_pdm_frame */ + {ABE_PDM_FRAME ,IEN |M0 }, +/* abe_pdm_lb_clk */ + {ABE_PDM_LB_CLK ,IEN |M0 }, +/* abe_clks */ + {ABE_CLKS ,IEN |M0 }, +/* safe_mode */ + {ABE_DMIC_CLK1 ,IEN |PTD |M7 }, +/* safe_mode */ + {ABE_DMIC_DIN1 ,IEN |PTD |M7 }, +/* safe_mode */ + {ABE_DMIC_DIN2 ,IEN |PTD |M7 }, +/* safe_mode */ /* bkl_en on gpio_122 ?? */ + {ABE_DMIC_DIN3 ,IEN |PTD |M7 }, +/* uart2_cts */ + {UART2_CTS ,WAKEUP_EN |OFF_PU |OFF_IN |M0 }, +/* safe_mode */ + {UART2_RTS ,OFF_PU |OFF_IN |M7 }, +/* uart2_rx */ + {UART2_RX ,IEN |PTU |M0 }, +/* uart2_tx */ + {UART2_TX ,M0 }, +/* gpio_127 */ /* audio_power_on */ + {HDQ_SIO ,M3 }, +/* i2c1_scl */ + {I2C1_SCL ,IEN |M0 }, +/* i2c1_sda */ + {I2C1_SDA ,IEN |M0 }, +/* i2c2_scl */ + {I2C2_SCL ,IEN |M0 }, +/* i2c2_sda */ + {I2C2_SDA ,IEN |M0 }, +/* i2c3_scl */ + {I2C3_SCL ,IEN |M0 }, +/* i2c3_sda */ + {I2C3_SDA ,IEN |M0 }, +/* i2c4_scl */ + {I2C4_SCL ,IEN |M0 }, +/* i2c4_sda */ + {I2C4_SDA ,IEN |M0 }, +/* mcspi1_clk */ + {MCSPI1_CLK ,IEN |M0 }, +/* mcspi1_somi */ + {MCSPI1_SOMI ,IEN |M0 }, +/* mcspi1_simo */ + {MCSPI1_SIMO ,IEN |M0 }, +/* mcspi1_cs0 */ + {MCSPI1_CS0 ,IEN |PTD |M0 }, +/* uart1_rx */ + {MCSPI1_CS1 ,WAKEUP_EN |IEN |M1 }, +/* gpio_139 */ + {MCSPI1_CS2 ,M3 }, +/* safe_mode */ + {MCSPI1_CS3 ,IEN |PTU |M7 }, +/* uart1_tx */ + {UART3_CTS_RCTX ,M1 }, +/* uart3_rts_sd */ + {UART3_RTS_SD ,M0 }, +/* safe_mode */ + {UART3_RX_IRRX ,IEN |PTU |M7 }, +/* safe_mode */ + {UART3_TX_IRTX ,IEN |PTD |M7 }, +/* sdmmc5_clk */ + {SDMMC5_CLK ,PTU |M0 }, +/* sdmmc5_cmd */ + {SDMMC5_CMD ,IEN |PTU |M0 }, +/* sdmmc5_dat0 */ + {SDMMC5_DAT0 ,IEN |PTU |M0 }, +/* sdmmc5_dat1 */ + {SDMMC5_DAT1 ,IEN |PTU |M0 }, +/* sdmmc5_dat2 */ + {SDMMC5_DAT2 ,IEN |PTU |M0 }, +/* sdmmc5_dat3 */ + {SDMMC5_DAT3 ,IEN |PTU |M0 }, +/* sdmmc4_clk */ + {MCSPI4_CLK ,IEN |PTU |M1 }, +/* sdmmc4_cmd */ + {MCSPI4_SIMO ,IEN |PTU |M1 }, +/* sdmmc4_dat0 */ + {MCSPI4_SOMI ,IEN |PTU |M1 }, +/* sdmmc4_dat3 */ + {MCSPI4_CS0 ,IEN |PTU |M1 }, +/* sdmmc4_dat2 */ + {UART4_RX ,IEN |PTU |M1 }, +/* sdmmc4_dat1 */ + {UART4_TX ,IEN |PTU |M1 }, +/* gpio_157 */ + {USBB2_ULPITLL_CLK ,M3 }, +/* dispc2_data23 */ + {USBB2_ULPITLL_STP ,M5 }, +/* dispc2_data22 */ + {USBB2_ULPITLL_DIR ,M5 }, +/* dispc2_data21 */ + {USBB2_ULPITLL_NXT ,M5 }, +/* dispc2_data20 */ + {USBB2_ULPITLL_DAT0 ,M5 }, +/* dispc2_data19 */ + {USBB2_ULPITLL_DAT1 ,M5 }, +/* dispc2_data18 */ + {USBB2_ULPITLL_DAT2 ,M5 }, +/* dispc2_data15 */ + {USBB2_ULPITLL_DAT3 ,M5 }, +/* dispc2_data14 */ + {USBB2_ULPITLL_DAT4 ,M5 }, +/* dispc2_data13 */ + {USBB2_ULPITLL_DAT5 ,M5 }, +/* dispc2_data12 */ + {USBB2_ULPITLL_DAT6 ,M5 }, +/* dispc2_data11 */ + {USBB2_ULPITLL_DAT7 ,M5 }, +/* gpio_169 */ + {USBB2_HSIC_DATA ,M3 }, +/* gpio_170 */ + {USBB2_HSIC_STROBE ,M3 }, +/* kpd_col0 */ + {KPD_COL3 ,IEN |PTD |M1 }, +/* kpd_col1 */ + {KPD_COL4 ,IEN |PTD |M1 }, +/* kpd_col2 */ + {KPD_COL5 ,IEN |PTD |M1 }, +/* gpio_174 */ /* accel_int2 */ + {KPD_COL0 ,IEN |PTU |M3 }, +/* gpio_0 */ /* tsp_shtdwn_gpio */ + {KPD_COL1 ,IEN |PTD |M3 }, +/* gpio_1 */ + {KPD_COL2 ,IEN |PTD |M3 }, +/* kpd_row0 */ + {KPD_ROW3 ,IEN |PTD |M1 }, +/* kpd_row1 */ + {KPD_ROW4 ,IEN |PTD |M1 }, +/* kpd_row2 */ + {KPD_ROW5 ,IEN |PTD |M1 }, +/* kpd_row3 */ + {KPD_ROW0 ,IEN |PTD |M1 }, +/* kpd_row4 */ + {KPD_ROW1 ,IEN |PTD |M1 }, +/* kpd_row5 */ + {KPD_ROW2 ,IEN |PTD |M1 }, +/* usba0_otg_ce */ + {USBA0_OTG_CE ,PTU |M0 }, +/* usba0_otg_dp */ + {USBA0_OTG_DP ,M0 }, +/* usba0_otg_dm */ + {USBA0_OTG_DM ,M0 }, +/* safe_mode */ + {FREF_CLK1_OUT ,IEN |PTD |M7 }, +/* fref_clk2_out */ + {FREF_CLK2_OUT ,M0 }, +/* sys_nirq1 */ + {SYS_NIRQ1 ,WAKEUP_EN |IEN |PTU |M0 }, +/* sys_nirq2 */ /* audio_irq */ + {SYS_NIRQ2 ,IEN |PTU |M0 }, +/* sys_boot0 */ + {SYS_BOOT0 ,IEN |PTD |M0 }, +/* sys_boot1 */ + {SYS_BOOT1 ,IEN |PTD |M0 }, +/* sys_boot2 */ + {SYS_BOOT2 ,IEN |PTD |M0 }, +/* sys_boot3 */ + {SYS_BOOT3 ,IEN |PTD |M0 }, +/* sys_boot4 */ + {SYS_BOOT4 ,IEN |PTD |M0 }, +/* sys_boot5 */ + {SYS_BOOT5 ,IEN |PTD |M0 }, +/* dpm_emu0 */ + {DPM_EMU0 ,IEN |PTU |M0 }, +/* gpio_12 */ /* lcd_avdd_en */ + {DPM_EMU1 ,IEN |M3 }, +/* safe_mode */ + {DPM_EMU2 ,IEN |PTD |M7 }, +/* dispc2_data10 */ + {DPM_EMU3 ,M5 }, +/* dispc2_data9 */ + {DPM_EMU4 ,M5 }, +/* dispc2_data16 */ + {DPM_EMU5 ,M5 }, +/* dispc2_data17 */ + {DPM_EMU6 ,M5 }, +/* dispc2_hsync */ + {DPM_EMU7 ,M5 }, +/* dispc2_pclk */ + {DPM_EMU8 ,M5 }, +/* dispc2_vsync */ + {DPM_EMU9 ,M5 }, +/* dispc2_de */ + {DPM_EMU10 ,M5 }, +/* dispc2_data8 */ + {DPM_EMU11 ,M5 }, +/* dispc2_data7 */ + {DPM_EMU12 ,M5 }, +/* dispc2_data6 */ + {DPM_EMU13 ,M5 }, +/* dispc2_data5 */ + {DPM_EMU14 ,M5 }, +/* dispc2_data4 */ + {DPM_EMU15 ,M5 }, +/* dispc2_data3 */ + {DPM_EMU16 ,M5 }, +/* dispc2_data2 */ + {DPM_EMU17 ,M5 }, +/* dispc2_data1 */ + {DPM_EMU18 ,M5 }, +/* dispc2_data0 */ + {DPM_EMU19 ,M5 }, +/* safe_mode */ + {CSI22_DX2 ,IEN |PTD |M7 }, +/* safe_mode */ + {CSI22_DY2 ,IEN |PTD |M7 }, +}; + +static const struct pad_conf_entry wkup_padconf_array[] = { +/* sr_scl */ + {SR_SCL ,IEN }, +/* sr_sda */ + {SR_SDA ,IEN }, +/* fref_clk0_out */ + {FREF_CLK0_OUT ,M0 }, +/* gpio_wk30 */ + {FREF_CLK3_REQ ,M3 }, +/* gpio_wk7 */ /* tps62361_vsel0 */ + {FREF_CLK4_REQ ,IEN |PTU |M3 }, +}; + +void set_muxconf_regs (void ){ +omap4_do_set_mux (OMAP44XX_CONTROL_PADCONF_CORE , + core_padconf_array,ARRAY_SIZE (core_padconf_array)); +omap4_do_set_mux (OMAP44XX_CONTROL_PADCONF_WKUP , + wkup_padconf_array,ARRAY_SIZE (wkup_padconf_array)); + +/* gpio_wk7 is used for controlling TPS on 4460 */ +if (omap4_revision () >=OMAP4460_ES1_0 ) { +writew (M3 ,OMAP44XX_CONTROL_PADCONF_WKUP +FREF_CLK4_REQ ); +/* Enable GPIO-1 clocks before TPS initialization */ +omap4_enable_gpio1_wup_clocks (); + } +}arch/arm/boards/archosg9/mux.h new file +6
-0@@ -0,0 +1,6 @@ +#ifndef _MUX_H +#define _MUX_H + +void set_muxconf_regs (void ); + +#endif /* _MUX_H */ arch/arm/configs/archosg9_defconfig new file +70
-0@@ -0,0 +1,70 @@ +CONFIG_MACH_ARCHOSG9=y +CONFIG_ARCH_OMAP=y +CONFIG_ARCH_OMAP4=y +CONFIG_AEABI=y +# CONFIG_MACH_DO_LOWLEVEL_INIT is not set +CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y +CONFIG_ARM_UNWIND=y +# CONFIG_MMU is not set +CONFIG_OMAP4_USBBOOT=y +CONFIG_TEXT_BASE=0xa0000000 +CONFIG_MALLOC_BASE=0x90000000 +CONFIG_MALLOC_SIZE=0x10000000 +CONFIG_KALLSYMS=y +CONFIG_PROMPT="barebox> " +CONFIG_LONGHELP=y +CONFIG_GLOB=y +CONFIG_HUSH_FANCY_PROMPT=y +CONFIG_CMDLINE_EDITING=y +CONFIG_AUTO_COMPLETE=y +# CONFIG_CONSOLE_ACTIVATE_FIRST is not set +CONFIG_CONSOLE_ACTIVATE_ALL=y +# CONFIG_TIMESTAMP is not set +CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y +CONFIG_DEFAULT_ENVIRONMENT_PATH="defaultenv-2 arch/arm/boards/archosg9/env" +CONFIG_CMD_EDIT=y +CONFIG_CMD_SLEEP=y +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_EXPORT=y +CONFIG_CMD_PRINTENV=y +CONFIG_CMD_READLINE=y +CONFIG_CMD_TIME=y +CONFIG_CMD_ECHO_E=y +CONFIG_CMD_LOADB=y +CONFIG_CMD_IOMEM=y +CONFIG_CMD_FLASH=y +CONFIG_CMD_MD5SUM=y +CONFIG_CMD_SHA1SUM=y +CONFIG_CMD_SHA224SUM=y +CONFIG_CMD_SHA256SUM=y +CONFIG_CMD_BOOTM_SHOW_TYPE=y +CONFIG_CMD_BOOTM_VERBOSE=y +CONFIG_CMD_BOOTM_INITRD=y +CONFIG_CMD_BOOTM_OFTREE=y +CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y +CONFIG_CMD_BOOTM_AIMAGE=y +CONFIG_CMD_RESET=y +CONFIG_CMD_GO=y +CONFIG_CMD_TIMEOUT=y +CONFIG_CMD_PARTITION=y +CONFIG_CMD_MAGICVAR=y +CONFIG_CMD_MAGICVAR_HELP=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_UNCOMPRESS=y +CONFIG_CMD_I2C=y +CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y +CONFIG_DRIVER_SERIAL_NS16550=y +CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y +CONFIG_BAUDRATE=1000000 +# CONFIG_SPI is not set +CONFIG_I2C=y +CONFIG_I2C_OMAP=y +CONFIG_I2C_TWLCORE=y +CONFIG_I2C_TWL6030=y +CONFIG_MCI=y +CONFIG_MCI_STARTUP=y +CONFIG_MCI_OMAP_HSMMC=y +CONFIG_FS_FAT=y +CONFIG_FS_FAT_WRITE=y +CONFIG_FS_FAT_LFN=y +CONFIG_FS_OMAP4_USBBOOT=yarch/arm/configs/archosg9_xload_defconfig new file +24
-0@@ -0,0 +1,24 @@ +CONFIG_MACH_ARCHOSG9=y +CONFIG_ARCH_OMAP=y +CONFIG_ARCH_OMAP4=y +# CONFIG_OMAP_GPMC is not set +CONFIG_OMAP_BUILD_IFT=y +CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xC000 +CONFIG_AEABI=y +CONFIG_OMAP4_USBBOOT=y +# CONFIG_CMD_ARM_CPUINFO is not set +CONFIG_TEXT_BASE=0x40300000 +CONFIG_MEMORY_LAYOUT_FIXED=y +CONFIG_STACK_BASE=0x8f000000 +CONFIG_MALLOC_BASE=0x84000000 +CONFIG_MALLOC_SIZE=0x2000000 +CONFIG_SHELL_NONE=y +# CONFIG_ERRNO_MESSAGES is not set +# CONFIG_TIMESTAMP is not set +# CONFIG_CONSOLE_FULL is not set +# CONFIG_DEFAULT_ENVIRONMENT is not set +CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT=y +# CONFIG_SPI is not set +# CONFIG_FS_RAMFS is not set +# CONFIG_FS_DEVFS is not set +CONFIG_FS_OMAP4_USBBOOT=yarch/arm/mach-omap/Kconfig +2
-0@@ -92,6 +92,7 @@ config OMAP4_USBBOOT Please read oamp4_usb_booting.txt for more information. config BOARDINFO + default "Archos G9" if MACH_ARCHOSG9 default "Texas Instrument's SDP343x" if MACH_OMAP343xSDP default "Texas Instrument's Beagle" if MACH_BEAGLE default "Texas Instrument's OMAP3EVM" if MACH_OMAP3EVM@@ -131,6 +132,14 @@ config MACH_PANDA help Say Y here if you are using OMAP4 Panda board +config MACH_ARCHOSG9
arch/arm/mach-omap/Kconfig config MACH_PANDA · line 145
Quoted 10 lines
arch/arm/mach-omap/Kconfig +7
-0+ bool "Archos G9 tablets" + select HAVE_NOSHELL + select MACH_HAS_LOWLEVEL_INIT + depends on ARCH_OMAP4 + help + Say Y here if you are using OMAP4-based Archos G9 tablet + config MACH_PCM049 bool "Phytec phyCORE pcm049" select HAVE_NOSHELL
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 14/14] Add support for Archos G9 tablet
Quoted 79 lines · Jan Weitzel
Quoted 38 lines
arch/arm/boards/archosg9/lowlevel.c new file +32
-0@@ -0,0 +1,79 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <common.h> +#include <io.h> +#include <init.h> +#include <mach/omap4-mux.h> +#include <mach/omap4-silicon.h> +#include <mach/omap4-clock.h> +#include <mach/syslib.h> +#include <asm/barebox-arm.h> +#include <asm/barebox-arm-head.h> +#include "mux.h" + +#define TPS62361_VSEL0_GPIO 7 + +static const struct ddr_regs ddr_regs_400_mhz_2cs = { + .tim1 =0x10EB0662 , + .tim2 =0x20370DD2 , + .tim3 =0x00B1C33F , + .phy_ctrl_1 =0x849FF408 , + .ref_ctrl =0x00000618 , + .config_init =0x80000EB9 ,arch/arm/boards/archosg9/lowlevel.c line 42
Quoted 10 lines
arch/arm/boards/archosg9/lowlevel.c new file +10
-0+ .config_final = 0x80001AB9, + .zq_config = 0xD00B3215, + .mr1 = 0x83, + .mr2 = 0x4 +}; + +static noinline void archosg9_init_lowlevel(void) +{ +struct dpll_param core =OMAP4_CORE_DPLL_PARAM_19M2_DDR400 ; +struct dpll_param mpu =OMAP4_MPU_DPLL_PARAM_19M2_MPU600 ;This if OPP100 for 4430, for 4460 OPP100 defines 700MHz.
Quoted 13 lines
arch/arm/boards/archosg9/lowlevel.c new file +13
-0+struct dpll_param iva =OMAP4_IVA_DPLL_PARAM_19M2 ; +struct dpll_param per =OMAP4_PER_DPLL_PARAM_19M2 ; +struct dpll_param abe =OMAP4_ABE_DPLL_PARAM_19M2 ; +struct dpll_param usb =OMAP4_USB_DPLL_PARAM_19M2 ; + +writel (CM_SYS_CLKSEL_19M2 ,CM_SYS_CLKSEL ); + +/* Configure all DPLL's at 100% OPP */ +omap4_configure_mpu_dpll (&mpu); +omap4_configure_iva_dpll (&iva); +omap4_configure_per_dpll (&per); +omap4_configure_abe_dpll (&abe); +omap4_configure_usb_dpll (&usb);arch/arm/boards/archosg9/lowlevel.c line 65
Quoted 10 lines
arch/arm/boards/archosg9/lowlevel.c new file +10
-0+ +/* Enable all clocks */ +omap4_enable_all_clocks (); + +set_muxconf_regs (); + +omap4_ddr_init (&ddr_regs_400_mhz_2cs, &core); + +/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */ +omap4_scale_vcores (TPS62361_VSEL0_GPIO );According to TIs DM the sequence for going into a higher OPP is to first raise the voltage. I saw this is also wrong on pandaboard. They also say rise core freq before mpu freq so the order should be
omap4_scale_vcoresomap4_ddr_initomap4_configure_mpu_dpll
Quoted 3 lines
I'll fix and test the order on PCM049
Jan
The only way I could make it work on archosG9 is with this order:
set_muxconf_regs();
writel(CM_SYS_CLKSEL_19M2, CM_SYS_CLKSEL); omap4_enable_all_clocks(); omap4_scale_vcores(TPS62361_VSEL0_GPIO); omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core); omap4_configure_mpu_dpll(&mpu);
...
Is this correct? That is, enable_all_clocks can be done before scale_vcores? It will depend on the default clock frequencies, I think.
Vicente
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 14/14] Add support for Archos G9 tablet
Am Sonntag, den 21.10.2012, 03:00 +0200 schrieb vj:
Quoted 84 lines · Jan Weitzel
Quoted 79 lines
Quoted 38 lines
arch/arm/boards/archosg9/lowlevel.c new file +32
-0@@ -0,0 +1,79 @@ +/* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <common.h> +#include <io.h> +#include <init.h> +#include <mach/omap4-mux.h> +#include <mach/omap4-silicon.h> +#include <mach/omap4-clock.h> +#include <mach/syslib.h> +#include <asm/barebox-arm.h> +#include <asm/barebox-arm-head.h> +#include "mux.h" + +#define TPS62361_VSEL0_GPIO 7 + +static const struct ddr_regs ddr_regs_400_mhz_2cs = { + .tim1 =0x10EB0662 , + .tim2 =0x20370DD2 , + .tim3 =0x00B1C33F , + .phy_ctrl_1 =0x849FF408 , + .ref_ctrl =0x00000618 , + .config_init =0x80000EB9 ,arch/arm/boards/archosg9/lowlevel.c line 42
Quoted 10 lines
arch/arm/boards/archosg9/lowlevel.c new file +10
-0+ .config_final = 0x80001AB9, + .zq_config = 0xD00B3215, + .mr1 = 0x83, + .mr2 = 0x4 +}; + +static noinline void archosg9_init_lowlevel(void) +{ +struct dpll_param core =OMAP4_CORE_DPLL_PARAM_19M2_DDR400 ; +struct dpll_param mpu =OMAP4_MPU_DPLL_PARAM_19M2_MPU600 ;This if OPP100 for 4430, for 4460 OPP100 defines 700MHz.
Quoted 13 lines
arch/arm/boards/archosg9/lowlevel.c new file +13
-0+struct dpll_param iva =OMAP4_IVA_DPLL_PARAM_19M2 ; +struct dpll_param per =OMAP4_PER_DPLL_PARAM_19M2 ; +struct dpll_param abe =OMAP4_ABE_DPLL_PARAM_19M2 ; +struct dpll_param usb =OMAP4_USB_DPLL_PARAM_19M2 ; + +writel (CM_SYS_CLKSEL_19M2 ,CM_SYS_CLKSEL ); + +/* Configure all DPLL's at 100% OPP */ +omap4_configure_mpu_dpll (&mpu); +omap4_configure_iva_dpll (&iva); +omap4_configure_per_dpll (&per); +omap4_configure_abe_dpll (&abe); +omap4_configure_usb_dpll (&usb);arch/arm/boards/archosg9/lowlevel.c line 65
Quoted 10 lines
arch/arm/boards/archosg9/lowlevel.c new file +10
-0+ +/* Enable all clocks */ +omap4_enable_all_clocks (); + +set_muxconf_regs (); + +omap4_ddr_init (&ddr_regs_400_mhz_2cs, &core); + +/* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */ +omap4_scale_vcores (TPS62361_VSEL0_GPIO );According to TIs DM the sequence for going into a higher OPP is to first raise the voltage. I saw this is also wrong on pandaboard. They also say rise core freq before mpu freq so the order should be
omap4_scale_vcoresomap4_ddr_initomap4_configure_mpu_dpllQuoted 3 lines
I'll fix and test the order on PCM049
Jan
Quoted 8 lines
The only way I could make it work on archosG9 is with this order:
set_muxconf_regs();
writel(CM_SYS_CLKSEL_19M2, CM_SYS_CLKSEL);omap4_enable_all_clocks();omap4_scale_vcores(TPS62361_VSEL0_GPIO);omap4_ddr_init(&ddr_regs_400_mhz_2cs, &core);omap4_configure_mpu_dpll(&mpu);
...
I think you need al least omap4_enable_gpio1_wup_clocks for using TPS62361_VSEL0_GPIO.
Jan
Quoted 4 lines
Is this correct? That is,
enable_all_clockscan be done beforescale_vcores? It will depend on the default clock frequencies, I think.Vicente
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 5 lines · Vicente
This patch series is the same as before except for:
[PATCH 03/13] ARM: ensure irqs are disabled
imported irq handling from linux
[PATCH 07/13] uimage: improve transfer speed
solved a compile warning
I applied most of this series, please check the result in the -next branch.
Quoted 6 lines
Vicente (14):
twl6030: add debug info
omap4: add rename definitions to match datasheet
ARM: import irq handling from linux
ARM: ensure irqs are disabled
I haven't applied these two. I don't think it's worth adding the linux irq headers. I liked the last version better which only missed the define for a flag.
I just posted a series making multiple ARM architectures possible, so we would need a arm_architecture() around the call to disable the irqs, not an ifdef. You could either change this in a new version or give me some time until I do it.
Quoted 1 line
omap: revert gpiolib
Of course haven't applied this one
Quoted 4 lines
omap4: add usb boot source
bootm: close open filesuimage: improve transfer speed
Haven't applied this one as you haven't answered my question how much improvement (and on which media) we get.
Quoted 6 lines
fs: improve robustness
omap4: add support for booting cpu from usb
omap4: add serial communications over usb boot
omap4: add filesystem support over usb boot
omap4: add support for loading second stage from usb Add support for Archos G9 tablet
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
A message that is not in the archive (sent off-list or not yet received): CAAMcf8D0Xn6aWztkD=8dnv3P1qxNgxSV-2Q37kGOaRsOQE7xVA@mail.gmail.com
Quoted 8 lines · vj
Quoted 7 lines · Sascha Hauer
Quoted 5 lines · Vicente
This patch series is the same as before except for:
[PATCH 03/13] ARM: ensure irqs are disabled
imported irq handling from linux
[PATCH 07/13] uimage: improve transfer speed
solved a compile warning
Quoted 5 lines
Quoted 3 lines
I applied most of this series, please check the result in the -next branch.
I'll check this week
Thanks.
Quoted 4 lines
Quoted 2 lines
Of course haven't applied this one
It wasn't meant to be applied
I know, just thought I'd mention it anyway
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
omap4: add usb boot source
bootm: close open filesuimage: improve transfer speed
Haven't applied this one as you haven't answered my question how much improvement (and on which media) we get.
Yes, it's answered, see:
http://lists.infradead.org/pipermail/barebox/2012-October/010208.html
Ups, missed that. That's really a huge speed gain. I wonder why this happens. Maybe the overhead of request/release sdram region is significant with MMU disabled. Could you play with the BUFSIZ parameter to see if there's a good compromise between speeding up your transfer and still sensible buffer sizes?
BTW I wonder if it would be possible to use the MMU in your setup. We have a 1:1 flat mapping which should be no problem for the ROM code. You probably would have to use dma_alloc_coherent to allocate the buffers which are used for USB transfers.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 9 lines · Sascha Hauer
Quoted 8 lines · vj
Quoted 7 lines · Sascha Hauer
Quoted 5 lines · Vicente
This patch series is the same as before except for:
[PATCH 03/13] ARM: ensure irqs are disabled
imported irq handling from linux
[PATCH 07/13] uimage: improve transfer speed
solved a compile warning
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I applied most of this series, please check the result in the -next branch.
I'll check this week
Thanks.
The -next branch works "out-of-the-box".
So exiting from barebox leaving the interrupts enabled is not critical.
Quoted 17 lines
Quoted 5 lines
Quoted 3 lines
Of course haven't applied this one
It wasn't meant to be applied
I know, just thought I'd mention it anyway
Quoted 9 lines
Quoted 8 lines
Quoted 5 lines
omap4: add usb boot source
bootm: close open filesuimage: improve transfer speed
Haven't applied this one as you haven't answered my question how much improvement (and on which media) we get.
Quoted 8 lines
Quoted 2 lines
Yes, it's answered, see:
http://lists.infradead.org/pipermail/barebox/2012-October/010208.htmlUps, missed that. That's really a huge speed gain. I wonder why this happens. Maybe the overhead of request/release sdram region is significant with MMU disabled. Could you play with the BUFSIZ parameter to see if there's a good compromise between speeding up your transfer and still sensible buffer sizes?
Here are the results:
13133*PAGE_SIZE: Transferred 53789775 bytes in 3.326 seconds at 15.419 MBps
64*PAGE_SIZE: Transferred 53789775 bytes in 3.478 seconds at 14.748 MBps 32*PAGE_SIZE: Transferred 53789775 bytes in 3.655 seconds at 14.031 MBps 16*PAGE_SIZE: Transferred 53789775 bytes in 3.987 seconds at 12.865 MBps
8*PAGE_SIZE: Transferred 53789775 bytes in 4.540 seconds at 11.297 MBps
4*PAGE_SIZE: Transferred 53789775 bytes in 5.876 seconds at 8.729 MBps
2*PAGE_SIZE: Transferred 53789775 bytes in 8.249 seconds at 6.218 MBpsNote: 13133 is reading the file at once.
Quoted 5 lines
BTW I wonder if it would be possible to use the MMU in your setup. We have a 1:1 flat mapping which should be no problem for the ROM code. You probably would have to use
dma_alloc_coherentto allocate the buffers which are used for USB transfers.
Tested with MMU enabled having the buffers on local stack: fail with buffers allocated with xzalloc: fail
with dma_alloc_coherent: fail
all of them freezes when calling the ROM function omap4_usbboot_pdata.io->write(...)
also tried this initcalls, all with same result:core_initcall(omap4_usbboot_init); postmmu_initcall(omap4_usbboot_init);
Why it doesn't work? I don't know. But if anybody wants to investigate attached is the ROM code which is placed at offset 0x00030000. The entry points used by barebox are:omap4_usbboot_pdata.io->init : 0x000340e3 omap4_usbboot_pdata.io->read : 0x00034289 omap4_usbboot_pdata.io->write : 0x00034259 omap4_usbboot_pdata.io->close : 0x00034075 omap4_usbboot_pdata.io->config: 0x000342bb
which surely are wrong because aren't dword aligned! I'm lost.
Quoted 9 lines
Sascha
--
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
A message that is not in the archive (sent off-list or not yet received): CAAMcf8CLimKWZddBfctSCct0wOJOk7tgTJpM7m_w8h5dOQRt1Q@mail.gmail.com
Quoted 15 lines · vj
Quoted 5 lines
Ups, missed that. That's really a huge speed gain. I wonder why this happens. Maybe the overhead of request/release sdram region is significant with MMU disabled. Could you play with the BUFSIZ parameter to see if there's a good compromise between speeding up your transfer and still sensible buffer sizes?
Here are the results:
13133*PAGE_SIZE: Transferred 53789775 bytes in 3.326747 seconds at 15.419848 MBps
64*PAGE_SIZE: Transferred 53789775 bytes in 3.478078 seconds at
14.748928 MBps
32*PAGE_SIZE: Transferred 53789775 bytes in 3.655790 seconds at
14.031968 MBps
16*PAGE_SIZE: Transferred 53789775 bytes in 3.987313 seconds at
12.865286 MBps
Quoted 7 lines
8*PAGE_SIZE: Transferred 53789775 bytes in 4.540697 seconds at 11.297368 MBps 4*PAGE_SIZE: Transferred 53789775 bytes in 5.876598 seconds at 8.729188 MBps 2*PAGE_SIZE: Transferred 53789775 bytes in 8.249404 seconds at6.218380 MBps
Note: 13133 is reading the file at once.
So 32 * PAGE_SIZE could be a good compromise. That is still a fine enough granularity for requesting SDRAM regions.
Quoted 16 lines
Quoted 6 lines
BTW I wonder if it would be possible to use the MMU in your setup. We have a 1:1 flat mapping which should be no problem for the ROM code. You probably would have to use
dma_alloc_coherentto allocate the buffers which are used for USB transfers.Tested with MMU enabled having the buffers on local stack: fail with buffers allocated with xzalloc: fail
withdma_alloc_coherent: fail
all of them freezes when calling the ROM functionomap4_usbboot_pdata.io->write(...)
also tried this initcalls, all with same result:core_initcall(omap4_usbboot_init);postmmu_initcall(omap4_usbboot_init);
Quoted 4 lines
Why it doesn't work? I don't know. But if anybody wants to investigate attached is the ROM code. At the top of the file are the entry points used by barebox, which
surely are wrong because aren't dword aligned!
I have no idea. That's probably the point where a jtag debugger could help.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox