Re: [U-Boot] [PATCH 0/4] USB multi controller
Hi Stephen, Am Dienstag, den 04.09.2012, 17:05 -0600 schrieb Stephen Warren: On 08/30/2012 10:03 AM, Lucas Stach wrote: Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Patches are based on a Tegra tree with some relevant changes from u-boot-usb picked over, so they should apply to u-boot-usb/master. Can you explain what this series is based on in a little more detail? I tried applying it to Tegra's for-next today, and it wouldn't apply. I managed to apply using plain patch rather then git am, but then I get a bunch of compile errors:-( At the time I wrote those patches the u-boot-usb and u-boot-tegra trees didn't merge cleanly and I wasted quite some time trying to fix up the failed merge. In the end I ended up just picking the following over to my tegra tree, which should be enough to avoid any conflicts with the usb tree: cdeb916120a4 ehci: cosmetic: Define the number of qt_buffers 44ae0be7461f ehci: Fail for multi-transaction interrupt transfers 14eb79b7a086 ehci: cosmetic: Define used constants 5cec214ecd7d ehci-hcd: Boost transfer speed cffcc5035809 usb_storage: Restore non-EHCI support 4bee5c83ea46 usb_storage: Remove EHCI constraints 3e8581bb9589 usb_stor_BBB_transport: Do not delay when not required db19134615dd ehci: Optimize qTD allocations HTH, Lucas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] USB multi controller
Dear Lucas Stach, Hi Stephen, Am Dienstag, den 04.09.2012, 17:05 -0600 schrieb Stephen Warren: On 08/30/2012 10:03 AM, Lucas Stach wrote: Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Patches are based on a Tegra tree with some relevant changes from u-boot-usb picked over, so they should apply to u-boot-usb/master. Can you explain what this series is based on in a little more detail? I tried applying it to Tegra's for-next today, and it wouldn't apply. I managed to apply using plain patch rather then git am, but then I get a bunch of compile errors:-( At the time I wrote those patches the u-boot-usb and u-boot-tegra trees didn't merge cleanly and I wasted quite some time trying to fix up the failed merge. In the end I ended up just picking the following over to my tegra tree, which should be enough to avoid any conflicts with the usb tree: cdeb916120a4 ehci: cosmetic: Define the number of qt_buffers 44ae0be7461f ehci: Fail for multi-transaction interrupt transfers 14eb79b7a086 ehci: cosmetic: Define used constants 5cec214ecd7d ehci-hcd: Boost transfer speed cffcc5035809 usb_storage: Restore non-EHCI support 4bee5c83ea46 usb_storage: Remove EHCI constraints 3e8581bb9589 usb_stor_BBB_transport: Do not delay when not required db19134615dd ehci: Optimize qTD allocations u-boot-usb master is updated to master and pushed for your enjoyment. HTH, Lucas Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fdt: Check if the FDT address is configured
In case the fdt addr command wasn't ran yet and any other fdt subcommand was issued, the system crashed due to NULL pointer being used. This is caused by fdt addr command setting up a pointer to the FDT memory location. Prior issuing fdt addr, the pointer is NULL so calling any other subcommands crashed the u-boot. Signed-off-by: Marek Vasut ma...@denx.de Cc: Simon Glass s...@chromium.org --- common/cmd_fdt.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) Note: Damn, I'm falling asleep already :-( I hope the text above at least makes sense though. diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 9a5c53e..e2225c4 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -114,10 +114,21 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } } + return CMD_RET_SUCCESS; + } + + if (!working_fdt) { + puts( + No FDT memory address configured. Please configure\n + the FDT address via \fdt addr address\ command.\n + Aborting!\n); + return CMD_RET_FAILURE; + } + /* * Move the working_fdt */ - } else if (strncmp(argv[1], mo, 2) == 0) { + if (strncmp(argv[1], mo, 2) == 0) { struct fdt_header *newaddr; int len; int err; -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PULL] Please pull u-boot-atmel/master
Hi Andreas, On Tue, 4 Sep 2012 23:04:44 +0200, Andreas Bießmann andreas.de...@googlemail.com wrote: Dear Albert Aribaud, these are the missing patches for 2012.10 release. They where missed in the last request some days ago. At this time I did not rebase u-boot-atmel/master on u-boot-arm/master. The following changes since commit a9f1a4893364ddbb8b7942cded91d4c17c4f5948: lsxl: support power switch (2012-09-03 17:48:51 +0530) are available in the git repository at: git://git.denx.de/u-boot-atmel.git master for you to fetch changes up to 7d899c14cc1842004e5f94a376082e7b6cf5988d: Fixes the crippled console output on PortuxG20. (2012-09-04 22:06:19 +0200) Jens Scharsig (2): eb_cpux9k2: fix chip select atmel: eb_cpux9k2: add ram target configuration Markus Hubig (2): arm: Adds board_postclk_init to the init_sequence. Fixes the crippled console output on PortuxG20. arch/arm/lib/board.c |3 +++ board/BuS/eb_cpux9k2/cpux9k2.c |6 +++--- board/taskit/stamp9g20/stamp9g20.c | 21 + boards.cfg |3 ++- include/configs/eb_cpux9k2.h |7 ++- include/configs/stamp9g20.h|1 + 6 files changed, 32 insertions(+), 9 deletions(-) Best regards Andreas Bießmann Applied (merged) to u-boot-arm/master, thanks! Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 0/4] common/lcd cleanup
Hi guys, This series is waiting for several month already. Only the V3 is one month old and hasn't got any comments so far. So, if Anatolij for some reason cannot deal with it, please merge it via a staging tree of yours. Thanks On 08/09/12 13:14, Nikita Kiryanov wrote: This patch series attempts to simplify #ifdef complexity in common/lcd.c. It was compile tested on Arm and PowerPC using MAKEALL Changes in V3: - Rebased on latest u-boot-video - Removed volatile qualifiers in patch 3 since the use of volatile is discouraged and it looks like it is safe to remove them. Changes in V2: - Rebased on u-boot-video - patches 2 and 3 of original patchset dropped because I'm not sure what to do about them - simplify lcd_logo: used bitmap_display() to further simplify code - simplify lcd_display_bitmap: fixed pointer increment error - simplify lcd_display_bitmap: change to simplify lcd_logo breaks MCC200 board because it does not #define CONFIG_CMD_BMP. Added a local implementation of bitmap_display(). Nikita Kiryanov (4): common lcd: simplify lcd_logo common lcd: simplify lcd_display common lcd: simplify core functions common lcd: simplify lcd_display_bitmap board/mcc200/lcd.c | 20 +++ common/lcd.c | 145 +++- 2 files changed, 96 insertions(+), 69 deletions(-) -- Regards, Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 0/4] common/lcd cleanup
Dear Igor Grinberg, Hi guys, This series is waiting for several month already. Only the V3 is one month old and hasn't got any comments so far. So, if Anatolij for some reason cannot deal with it, please merge it via a staging tree of yours. Anatolij, poke? It was probably forgotten, simple bump would suffice. Sorry for the delay. Thanks On 08/09/12 13:14, Nikita Kiryanov wrote: This patch series attempts to simplify #ifdef complexity in common/lcd.c. It was compile tested on Arm and PowerPC using MAKEALL Changes in V3: - Rebased on latest u-boot-video - Removed volatile qualifiers in patch 3 since the use of volatile is discouraged and it looks like it is safe to remove them. Changes in V2: - Rebased on u-boot-video - patches 2 and 3 of original patchset dropped because I'm not sure what to do about them - simplify lcd_logo: used bitmap_display() to further simplify code - simplify lcd_display_bitmap: fixed pointer increment error - simplify lcd_display_bitmap: change to simplify lcd_logo breaks MCC200 board because it does not #define CONFIG_CMD_BMP. Added a local implementation of bitmap_display(). Nikita Kiryanov (4): common lcd: simplify lcd_logo common lcd: simplify lcd_display common lcd: simplify core functions common lcd: simplify lcd_display_bitmap board/mcc200/lcd.c | 20 +++ common/lcd.c | 145 +++- 2 files changed, 96 insertions(+), 69 deletions(-) Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] MX: set a common place to share code for Freescale i.MX
Up now only MX5 and MX6 can share code, because they have a common source directory in cpu/armv7. Other not armv7 i.MX can profit of the same shared code. Move these files into a directory accessible for all, similar to plat-mxc in linux. Signed-off-by: Stefano Babic sba...@denx.de --- Changes in v2: - Use the common path for all i.MX SOCs in Makefile Makefile|7 ++- arch/arm/{cpu/armv7 = }/imx-common/Makefile|2 ++ arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c |0 arch/arm/{cpu/armv7 = }/imx-common/cpu.c |0 arch/arm/{cpu/armv7 = }/imx-common/i2c.c |0 arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c |0 arch/arm/{cpu/armv7 = }/imx-common/speed.c |0 arch/arm/{cpu/armv7 = }/imx-common/timer.c |0 8 files changed, 4 insertions(+), 5 deletions(-) rename arch/arm/{cpu/armv7 = }/imx-common/Makefile (97%) rename arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/cpu.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/i2c.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/speed.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/timer.c (100%) diff --git a/Makefile b/Makefile index d27bb17..0826055 100644 --- a/Makefile +++ b/Makefile @@ -305,11 +305,8 @@ ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o endif -ifeq ($(SOC),mx5) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o -endif -ifeq ($(SOC),mx6) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o endif ifeq ($(SOC),s5pc1xx) diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/imx-common/Makefile similarity index 97% rename from arch/arm/cpu/armv7/imx-common/Makefile rename to arch/arm/imx-common/Makefile index 16fba8d..453f822 100644 --- a/arch/arm/cpu/armv7/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -27,8 +27,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libimx-common.o +ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) COBJS-y= iomux-v3.o timer.o cpu.o speed.o COBJS-$(CONFIG_I2C_MXC) += i2c.o +endif COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o COBJS := $(sort $(COBJS-y)) diff --git a/arch/arm/cpu/armv7/imx-common/cmd_bmode.c b/arch/arm/imx-common/cmd_bmode.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cmd_bmode.c rename to arch/arm/imx-common/cmd_bmode.c diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/imx-common/cpu.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cpu.c rename to arch/arm/imx-common/cpu.c diff --git a/arch/arm/cpu/armv7/imx-common/i2c.c b/arch/arm/imx-common/i2c.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/i2c.c rename to arch/arm/imx-common/i2c.c diff --git a/arch/arm/cpu/armv7/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/iomux-v3.c rename to arch/arm/imx-common/iomux-v3.c diff --git a/arch/arm/cpu/armv7/imx-common/speed.c b/arch/arm/imx-common/speed.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/speed.c rename to arch/arm/imx-common/speed.c diff --git a/arch/arm/cpu/armv7/imx-common/timer.c b/arch/arm/imx-common/timer.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/timer.c rename to arch/arm/imx-common/timer.c -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] MX: set a common place to share code for Freescale i.MX
Dear Stefano Babic, Up now only MX5 and MX6 can share code, because they have a common source directory in cpu/armv7. Other not armv7 i.MX can profit of the same shared code. Move these files into a directory accessible for all, similar to plat-mxc in linux. Add in my Reviewed-by: Marek Vasut ma...@denx.de ... not that there's too much to review :) Signed-off-by: Stefano Babic sba...@denx.de --- Changes in v2: - Use the common path for all i.MX SOCs in Makefile Makefile|7 ++- arch/arm/{cpu/armv7 = }/imx-common/Makefile|2 ++ arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c |0 arch/arm/{cpu/armv7 = }/imx-common/cpu.c |0 arch/arm/{cpu/armv7 = }/imx-common/i2c.c |0 arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c |0 arch/arm/{cpu/armv7 = }/imx-common/speed.c |0 arch/arm/{cpu/armv7 = }/imx-common/timer.c |0 8 files changed, 4 insertions(+), 5 deletions(-) rename arch/arm/{cpu/armv7 = }/imx-common/Makefile (97%) rename arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/cpu.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/i2c.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/speed.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/timer.c (100%) diff --git a/Makefile b/Makefile index d27bb17..0826055 100644 --- a/Makefile +++ b/Makefile @@ -305,11 +305,8 @@ ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o endif -ifeq ($(SOC),mx5) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o -endif -ifeq ($(SOC),mx6) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o endif ifeq ($(SOC),s5pc1xx) diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/imx-common/Makefile similarity index 97% rename from arch/arm/cpu/armv7/imx-common/Makefile rename to arch/arm/imx-common/Makefile index 16fba8d..453f822 100644 --- a/arch/arm/cpu/armv7/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -27,8 +27,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libimx-common.o +ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) COBJS-y = iomux-v3.o timer.o cpu.o speed.o COBJS-$(CONFIG_I2C_MXC) += i2c.o +endif COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o COBJS:= $(sort $(COBJS-y)) diff --git a/arch/arm/cpu/armv7/imx-common/cmd_bmode.c b/arch/arm/imx-common/cmd_bmode.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cmd_bmode.c rename to arch/arm/imx-common/cmd_bmode.c diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/imx-common/cpu.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cpu.c rename to arch/arm/imx-common/cpu.c diff --git a/arch/arm/cpu/armv7/imx-common/i2c.c b/arch/arm/imx-common/i2c.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/i2c.c rename to arch/arm/imx-common/i2c.c diff --git a/arch/arm/cpu/armv7/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/iomux-v3.c rename to arch/arm/imx-common/iomux-v3.c diff --git a/arch/arm/cpu/armv7/imx-common/speed.c b/arch/arm/imx-common/speed.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/speed.c rename to arch/arm/imx-common/speed.c diff --git a/arch/arm/cpu/armv7/imx-common/timer.c b/arch/arm/imx-common/timer.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/timer.c rename to arch/arm/imx-common/timer.c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] gpio:fix: Proper handling of GPIO subsystem parts at Samsung devices
Now proper GPIO parts numbering is handled at Samsung devices. This fix is necessary for code using GPIO located at other banks than first. Test HW: - Exynos4210 - Trats - S5PC110 - goni Signed-off-by: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com --- arch/arm/include/asm/arch-exynos/gpio.h | 19 +++ arch/arm/include/asm/arch-s5pc1xx/gpio.h |7 ++- drivers/gpio/s5p_gpio.c |6 -- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-exynos/gpio.h b/arch/arm/include/asm/arch-exynos/gpio.h index 7a9bb90..fdb52fa 100644 --- a/arch/arm/include/asm/arch-exynos/gpio.h +++ b/arch/arm/include/asm/arch-exynos/gpio.h @@ -204,6 +204,25 @@ static inline unsigned int s5p_gpio_base(int nr) return 0; } +static inline unsigned int s5p_gpio_part_max(int nr) +{ + if (cpu_is_exynos5()) { + if (nr EXYNOS5_GPIO_PART1_MAX) + return 0; + else if (nr EXYNOS5_GPIO_PART2_MAX) + return EXYNOS5_GPIO_PART1_MAX; + else + return EXYNOS5_GPIO_PART2_MAX; + + } else if (cpu_is_exynos4()) { + if (nr EXYNOS4_GPIO_PART1_MAX) + return 0; + else + return EXYNOS4_GPIO_PART1_MAX; + } + + return 0; +} #endif /* Pin configurations */ diff --git a/arch/arm/include/asm/arch-s5pc1xx/gpio.h b/arch/arm/include/asm/arch-s5pc1xx/gpio.h index 76b901b..00e498d 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/gpio.h +++ b/arch/arm/include/asm/arch-s5pc1xx/gpio.h @@ -143,7 +143,12 @@ static inline unsigned int s5p_gpio_base(int nr) return S5PC110_GPIO_BASE; } -#define s5pc110_gpio_get_nr(bank, pin) \ +static inline unsigned int s5p_gpio_part_max(int nr) +{ + return 0; +} + +#define s5pc110_gpio_get_nr(bank, pin) \ ((unsigned int)(((struct s5pc110_gpio *)S5PC110_GPIO_BASE)-bank))\ - S5PC110_GPIO_BASE) / sizeof(struct s5p_gpio_bank)) \ * GPIO_PER_BANK) + pin) diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index 47f3213..656bf4a 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -144,9 +144,11 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode) struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio) { - int bank = gpio / GPIO_PER_BANK; - bank *= sizeof(struct s5p_gpio_bank); + int bank; + unsigned g = gpio - s5p_gpio_part_max(gpio); + bank = g / GPIO_PER_BANK; + bank *= sizeof(struct s5p_gpio_bank); return (struct s5p_gpio_bank *) (s5p_gpio_base(gpio) + bank); } -- 1.7.2.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/5] usb: ulpi: add indicator configuration function
Hi Lucas, Tom, I'm sorry for the late reply. I understand, that Tom has already applied this to tegra/next, but as the changes/follow up patches are required, may be we can do this in another fashion... 1) Thanks for the patch and working on extending the generic framework! 2) This patch has no dependencies on tegra specific patches, so I think, it should go through Marex usb tree, but doing this will require the right merge order, so bisectability will not suffer. So, Marek, Tom, you should decide which way is fine with you both. Tom, Yesterday, I was wondering if the patch was already applied, and I had no clue what's its status. Also, the patchwork says New. So, if it is not hard for you in the future, I'd like a short reply to the list, saying something like: Applied, thanks., like most custodians do. Thanks! On 08/21/12 23:18, Lucas Stach wrote: Allows for easy configuration of the VBUS indicator related ULPI config bits. Also move the external indicator setup from ulpi_set_vbus() to the new function. Signed-off-by: Lucas Stach d...@lynxeye.de After the below comments are fixed: Acked-by: Igor Grinberg grinb...@compulab.co.il --- drivers/usb/ulpi/ulpi.c | 26 ++ include/usb/ulpi.h | 13 +++-- 2 Dateien geändert, 33 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/drivers/usb/ulpi/ulpi.c b/drivers/usb/ulpi/ulpi.c index dde2585..f358bde 100644 --- a/drivers/usb/ulpi/ulpi.c +++ b/drivers/usb/ulpi/ulpi.c @@ -106,20 +106,38 @@ int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed) return ulpi_write(ulpi_vp, ulpi-function_ctrl, val); } -int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power, - int ext_ind) +int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power) { u32 flags = ULPI_OTG_DRVVBUS; u8 *reg = on ? ulpi-otg_ctrl_set : ulpi-otg_ctrl_clear; if (ext_power) flags |= ULPI_OTG_DRVVBUS_EXT; - if (ext_ind) - flags |= ULPI_OTG_EXTVBUSIND; return ulpi_write(ulpi_vp, reg, flags); } +int ulpi_set_vbus_indicator(struct ulpi_viewport *ulpi_vp, int external, + int passthu, int complement) +{ + u8 *reg; + int ret; + + reg = external ? ulpi-otg_ctrl_set : ulpi-otg_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_OTG_EXTVBUSIND))) + return ret; + + reg = passthu ? ulpi-iface_ctrl_set : ulpi-iface_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_PASSTHRU))) + return ret; + + reg = complement ? ulpi-iface_ctrl_set : ulpi-iface_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_EXTVBUS_COMPLEMENT))) + return ret; These are fine, two requests though: 1) As Tom already pointed in the private email: ERROR: do not use assignment in if condition #361: FILE: drivers/usb/ulpi/ulpi.c:127: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_OTG_EXTVBUSIND))) ERROR: do not use assignment in if condition #365: FILE: drivers/usb/ulpi/ulpi.c:131: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_PASSTHRU))) ERROR: do not use assignment in if condition #369: FILE: drivers/usb/ulpi/ulpi.c:135: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_EXTVBUS_COMPLEMENT))) those must be fixed. 2) Can you make only one access for each register? Use flags/val variable (like in other places) and do only one access per register. Can you? + + return 0; +} + int ulpi_set_pd(struct ulpi_viewport *ulpi_vp, int enable) { u32 val = ULPI_OTG_DP_PULLDOWN | ULPI_OTG_DM_PULLDOWN; diff --git a/include/usb/ulpi.h b/include/usb/ulpi.h index 9a75c24..99166c4 100644 --- a/include/usb/ulpi.h +++ b/include/usb/ulpi.h @@ -61,8 +61,17 @@ int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed); * * returns 0 on success, ULPI_ERROR on failure. */ -int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, - int on, int ext_power, int ext_ind); +int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power); + +/* + * Configure VBUS indicator + * @external - external VBUS over-current indicator is used + * @passthru - disables ANDing of internal VBUS comparator + *with external VBUS input + * @complement - inverts the external VBUS input + */ +int ulpi_set_vbus_indicator(struct ulpi_viewport *ulpi_vp, int external, + int passthru, int complement); /* * Enable/disable pull-down resistors on D+ and D- USB lines. -- Regards, Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 5/5] tegra20: add USB ULPI init code
On 08/21/12 23:18, Lucas Stach wrote: This adds the required code to set up a ULPI USB port. It is mostly a port of the Linux ULPI setup code with some tweaks added for more correctness, discovered along the way of debugging this. To use this both CONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORT have to be set in the board configuration file. v2: - move all controller init stuff in the respective functions to make them self contained - let board define ULPI_REF_CLK to account for the possibility that some ULPI phys need a other ref clk than 24MHz - don't touch ULPI regs directly, use ULPI framework functions - don't hide error messages under debug() Signed-off-by: Lucas Stach d...@lynxeye.de --- arch/arm/cpu/armv7/tegra20/usb.c| 154 +++- arch/arm/include/asm/arch-tegra20/usb.h | 29 -- 2 Dateien geändert, 155 Zeilen hinzugefügt(+), 28 Zeilen entfernt(-) diff --git a/arch/arm/cpu/armv7/tegra20/usb.c b/arch/arm/cpu/armv7/tegra20/usb.c index 77966e5..351300b 100644 --- a/arch/arm/cpu/armv7/tegra20/usb.c +++ b/arch/arm/cpu/armv7/tegra20/usb.c [...] +/* set up the ULPI USB controller with the parameters provided */ +static int init_ulpi_usb_controller(struct fdt_usb *config, + struct usb_ctlr *usbctlr) +{ +#ifdef CONFIG_USB_ULPI +/* if board file does not set a ULPI reference frequency we default to 24MHz */ +#ifndef ULPI_REF_CLK +#define ULPI_REF_CLK 2400 +#endif I would really like the above ifdefs out of any function. So, how about something like: #ifdef CONFIG_USB_ULPI #ifndef ULPI_REF_CLK #define ULPI_REF_CLK 2400 #endif static int init_ulpi_usb_controller(struct fdt_usb *config, struct usb_ctlr *usbctlr) { ... } #else static int init_ulpi_usb_controller(struct fdt_usb *config, struct usb_ctlr *usbctlr) { printf(No code to set up ULPI controller, please enable CONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORT); return -1; } #endif This way all the ifdef are out of the functions and it makes code really cleaner and pleasant to read. Also, if this is to work from config files, then we should make it CONFIG_ULPI_REF_CLK and add some documentation to the README. + u32 val; + int loop_count; + struct ulpi_viewport ulpi_vp; + + /* set up ULPI reference clock on pllp_out4 */ + clock_enable(PERIPH_ID_DEV2_OUT); + clock_set_pllout(CLOCK_ID_PERIPH, PLL_OUT4, ULPI_REF_CLK); + + /* reset ULPI phy */ + if (fdt_gpio_isvalid(config-phy_reset_gpio)) { + fdtdec_setup_gpio(config-phy_reset_gpio); + gpio_direction_output(config-phy_reset_gpio.gpio, 0); + mdelay(5); + gpio_set_value(config-phy_reset_gpio.gpio, 1); + } + + /* Reset the usb controller */ + clock_enable(config-periph_id); + usbf_reset_controller(config, usbctlr); + + /* enable pinmux bypass */ + setbits_le32(usbctlr-ulpi_timing_ctrl_0, + ULPI_CLKOUT_PINMUX_BYP | ULPI_OUTPUT_PINMUX_BYP); + + /* Select ULPI parallel interface */ + clrsetbits_le32(usbctlr-port_sc1, PTS_MASK, PTS_ULPI PTS_SHIFT); + + /* enable ULPI transceiver */ + setbits_le32(usbctlr-susp_ctrl, ULPI_PHY_ENB); + + /* configure ULPI transceiver timings */ + val = 0; + writel(val, usbctlr-ulpi_timing_ctrl_1); + + val |= ULPI_DATA_TRIMMER_SEL(4); + val |= ULPI_STPDIRNXT_TRIMMER_SEL(4); + val |= ULPI_DIR_TRIMMER_SEL(4); + writel(val, usbctlr-ulpi_timing_ctrl_1); + udelay(10); + + val |= ULPI_DATA_TRIMMER_LOAD; + val |= ULPI_STPDIRNXT_TRIMMER_LOAD; + val |= ULPI_DIR_TRIMMER_LOAD; + writel(val, usbctlr-ulpi_timing_ctrl_1); + + /* set up phy for host operation with external vbus supply */ + ulpi_vp.port_num = 0; + ulpi_vp.viewport_addr = (u32)usbctlr-ulpi_viewport; + + if (ulpi_init(ulpi_vp)) { + printf(Tegra ULPI viewport init failed\n); + return -1; + } + + ulpi_set_vbus(ulpi_vp, 1, 1); + ulpi_set_vbus_indicator(ulpi_vp, 1, 1, 0); + + /* enable wakeup events */ + setbits_le32(usbctlr-port_sc1, WKCN | WKDS | WKOC); + + setbits_le32(usbctlr-susp_ctrl, USB_SUSP_CLR); + /* Wait for the phy clock to become valid in 100 ms */ + for (loop_count = 10; loop_count != 0; loop_count--) { + if (readl(usbctlr-susp_ctrl) USB_PHY_CLK_VALID) + break; + udelay(1); + } an empty line here would be nice. + if (!loop_count) + return -1; and here. + clrbits_le32(usbctlr-susp_ctrl, USB_SUSP_CLR); + + return 0; +#else + printf(No code to set up ULPI controller, please enable + CONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORT); + return -1; +#endif }
Re: [U-Boot] [PATCH V3 0/4] common/lcd cleanup
Hi, On Wed, 05 Sep 2012 09:51:12 +0300 Igor Grinberg grinb...@compulab.co.il wrote: Hi guys, This series is waiting for several month already. Only the V3 is one month old and hasn't got any comments so far. So, if Anatolij for some reason cannot deal with it, please merge it via a staging tree of yours. Sorry for the delay, I'm really busy with other projects and have only very limitted capacity to process U-Boot patches. These are not lost, and assigned to me at patchwork. For now I've applied this series, hope it will not break anything for all these affected platforms. But please do not expect me pushing to u-boot/master this week, Wolfgang won't pull this week anyway, I'm afraid. Thanks for the patience, and sorry again Anatolij ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/5] usb: ulpi: add indicator configuration function
Dear Igor Grinberg, Hi Lucas, Tom, I'm sorry for the late reply. I understand, that Tom has already applied this to tegra/next, but as the changes/follow up patches are required, may be we can do this in another fashion... 1) Thanks for the patch and working on extending the generic framework! 2) This patch has no dependencies on tegra specific patches, so I think, it should go through Marex usb tree, but doing this will require the right merge order, so bisectability will not suffer. So, Marek, Tom, you should decide which way is fine with you both. _ALWAYS_ CC the right custodians. That is, me. Seeing this patch bypassed me completely, I'm really unhappy. Tom, Yesterday, I was wondering if the patch was already applied, and I had no clue what's its status. Also, the patchwork says New. So, if it is not hard for you in the future, I'd like a short reply to the list, saying something like: Applied, thanks., like most custodians do. Thanks! +1 On 08/21/12 23:18, Lucas Stach wrote: Allows for easy configuration of the VBUS indicator related ULPI config bits. Also move the external indicator setup from ulpi_set_vbus() to the new function. Signed-off-by: Lucas Stach d...@lynxeye.de After the below comments are fixed: Acked-by: Igor Grinberg grinb...@compulab.co.il --- drivers/usb/ulpi/ulpi.c | 26 ++ include/usb/ulpi.h | 13 +++-- 2 Dateien geändert, 33 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/drivers/usb/ulpi/ulpi.c b/drivers/usb/ulpi/ulpi.c index dde2585..f358bde 100644 --- a/drivers/usb/ulpi/ulpi.c +++ b/drivers/usb/ulpi/ulpi.c @@ -106,20 +106,38 @@ int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed) return ulpi_write(ulpi_vp, ulpi-function_ctrl, val); } -int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power, - int ext_ind) +int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power) { u32 flags = ULPI_OTG_DRVVBUS; u8 *reg = on ? ulpi-otg_ctrl_set : ulpi-otg_ctrl_clear; if (ext_power) flags |= ULPI_OTG_DRVVBUS_EXT; - if (ext_ind) - flags |= ULPI_OTG_EXTVBUSIND; return ulpi_write(ulpi_vp, reg, flags); } +int ulpi_set_vbus_indicator(struct ulpi_viewport *ulpi_vp, int external, + int passthu, int complement) +{ + u8 *reg; + int ret; + + reg = external ? ulpi-otg_ctrl_set : ulpi-otg_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_OTG_EXTVBUSIND))) + return ret; + + reg = passthu ? ulpi-iface_ctrl_set : ulpi-iface_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_PASSTHRU))) + return ret; + + reg = complement ? ulpi-iface_ctrl_set : ulpi-iface_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_EXTVBUS_COMPLEMENT))) + return ret; These are fine, two requests though: 1) As Tom already pointed in the private email: ERROR: do not use assignment in if condition #361: FILE: drivers/usb/ulpi/ulpi.c:127: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_OTG_EXTVBUSIND))) ERROR: do not use assignment in if condition #365: FILE: drivers/usb/ulpi/ulpi.c:131: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_PASSTHRU))) ERROR: do not use assignment in if condition #369: FILE: drivers/usb/ulpi/ulpi.c:135: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_EXTVBUS_COMPLEMENT))) those must be fixed. Agreed, _ALWAYS_ run checkpatch.pl before submitting. It's even better idea to add a git precommit hook for that. 2) Can you make only one access for each register? Use flags/val variable (like in other places) and do only one access per register. Can you? + + return 0; +} + int ulpi_set_pd(struct ulpi_viewport *ulpi_vp, int enable) { u32 val = ULPI_OTG_DP_PULLDOWN | ULPI_OTG_DM_PULLDOWN; diff --git a/include/usb/ulpi.h b/include/usb/ulpi.h index 9a75c24..99166c4 100644 --- a/include/usb/ulpi.h +++ b/include/usb/ulpi.h @@ -61,8 +61,17 @@ int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed); * * returns 0 on success, ULPI_ERROR on failure. */ -int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, - int on, int ext_power, int ext_ind); +int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power); + +/* + * Configure VBUS indicator + * @external - external VBUS over-current indicator is used + * @passthru - disables ANDing of internal VBUS comparator + *with external VBUS input + * @complement - inverts the external VBUS input + */ +int ulpi_set_vbus_indicator(struct ulpi_viewport *ulpi_vp, int external, + int passthru, int complement);
[U-Boot] [RFC] [PATCH] PXE: FDT: Add support for fdt in PXE
Now DT support is becomming common for all new SoC's. Hence it is better to have option for getting specific FDT from the remote server. This patch adds support for new lable i.e. fdt. If fdt_addr is specified then load fdt blob from the remote server to fdt_address. Signed-off-by: Chander Kashyap chander.kash...@linaro.org --- common/cmd_pxe.c | 29 + 1 file changed, 29 insertions(+) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 6b31dea..11cde21 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -450,6 +450,7 @@ struct pxe_label { char *kernel; char *append; char *initrd; + char *fdt; int attempted; int localboot; struct list_head list; @@ -517,6 +518,9 @@ static void label_destroy(struct pxe_label *label) if (label-initrd) free(label-initrd); + if (label-fdt) + free(label-fdt); + free(label); } @@ -541,6 +545,9 @@ static void label_print(void *data) if (label-initrd) printf(\t\tinitrd: %s\n, label-initrd); + + if (label-fdt) + printf(\tfdt: %s\n, label-fdt); } /* @@ -633,6 +640,21 @@ static void label_boot(struct pxe_label *label) */ bootm_argv[3] = getenv(fdt_addr); + /* if fdt label is defined then get fdt from server */ + if (bootm_argv[3] label-fdt) { + if (get_relfile_envaddr(label-fdt, fdt_addr) 0) { + printf(Skipping %s for failure retrieving fdt\n, + label-name); + return; + } + } + + /* +* fdt usage is optional. If there is an fdt_addr specified, we will +* pass it along to bootm, and adjust argc appropriately. +*/ + bootm_argv[3] = getenv(fdt_addr); + if (bootm_argv[3]) bootm_argc = 4; @@ -658,6 +680,7 @@ enum token_type { T_DEFAULT, T_PROMPT, T_INCLUDE, + T_FDT, T_INVALID }; @@ -685,6 +708,7 @@ static const struct token keywords[] = { {append, T_APPEND}, {initrd, T_INITRD}, {include, T_INCLUDE}, + {fdt, T_FDT}, {NULL, T_INVALID} }; @@ -1074,6 +1098,11 @@ static int parse_label(char **c, struct pxe_menu *cfg) err = parse_sliteral(c, label-initrd); break; + case T_FDT: + if (!label-fdt) + err = parse_sliteral(c, label-fdt); + break; + case T_LOCALBOOT: err = parse_integer(c, label-localboot); break; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ubifs: Fix ubifsload when using ZLIB
Using ZLIB compression with UBIFS fails if last data node is not a size of UBIFS_BLOCK_SIZE (4096 bytes). Easiest way to test this is trying to read a file smaller than 4k: = ubifsload 4100 /etc/fstab Loading file '/etc/fstab' to addr 0x4100 with size 704 (0x02c0)... UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506) UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22 Error reading file '/etc/fstab' /etc/fstab not found! exit not allowed from main input shell. = With this patch: = ubifsload 4100 /etc/fstab Loading file '/etc/fstab' to addr 0x4100 with size 704 (0x02c0)... Done = Signed-off-by: Veli-Pekka Peltola veli-pekka.pelt...@bluegiga.com --- fs/ubifs/ubifs.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index c68802b..6a68437 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -37,8 +37,7 @@ DECLARE_GLOBAL_DATA_PTR; static int gzip_decompress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len) { - unsigned long len = in_len; - return zunzip(out, *out_len, (unsigned char *)in, len, 0, 0); + return zunzip(out, *out_len, (unsigned char *)in, (long unsigned int *)out_len, 0, 0); } /* Fake description object for the none compressor */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 2/2] i2c:soft:multi: Enable soft I2C multibus at Trats development board
This commit enables multibus handling at Samsung's Trats development board. Signed-off-by: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Cc: Minkyu Kang mk7.k...@samsung.com --- Changes for v2: - CONFIG_SOFT_I2C_MULTI_BUS flag added to Trats configuration Changes for v3: - correct definition of TRATS I2C_1 pins Changes for v4: - Assign I2C numbers reflecting the HW structure of Trats board - Change the max I2C numbers to 15 from 7 - i2c_init_board() function defined for trats board --- board/samsung/trats/trats.c | 15 +++ include/configs/trats.h | 24 +--- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c index 4f9cb5a..e11a892 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -75,6 +75,21 @@ int board_init(void) return 0; } +void i2c_init_board(void) +{ + struct exynos4_gpio_part1 *gpio1 = + (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1(); + struct exynos4_gpio_part2 *gpio2 = + (struct exynos4_gpio_part2 *)samsung_get_base_gpio_part2(); + + /* I2C_5 - PMIC */ + s5p_gpio_direction_output(gpio1-b, 7, 1); + s5p_gpio_direction_output(gpio1-b, 6, 1); + /* I2C_9 - FG */ + s5p_gpio_direction_output(gpio2-y4, 0, 1); + s5p_gpio_direction_output(gpio2-y4, 1, 1); +} + int dram_init(void) { gd-ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) + diff --git a/include/configs/trats.h b/include/configs/trats.h index c6fb2e0..866c047 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -235,18 +235,28 @@ #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - GENERATED_GBL_DATA_SIZE) #define CONFIG_SYS_CACHELINE_SIZE 32 -#include asm/arch/gpio.h -/* - * I2C Settings - */ -#define CONFIG_SOFT_I2C_GPIO_SCL exynos4_gpio_part1_get_nr(b, 7) -#define CONFIG_SOFT_I2C_GPIO_SDA exynos4_gpio_part1_get_nr(b, 6) #define CONFIG_SOFT_I2C #define CONFIG_SOFT_I2C_READ_REPEATED_START +#define CONFIG_SYS_I2C_INIT_BOARD #define CONFIG_SYS_I2C_SPEED 5 #define CONFIG_I2C_MULTI_BUS -#define CONFIG_SYS_MAX_I2C_BUS 7 +#define CONFIG_SOFT_I2C_MULTI_BUS +#define CONFIG_SYS_MAX_I2C_BUS 15 + +#include asm/arch/gpio.h + +/* I2C PMIC */ +#define CONFIG_SOFT_I2C_I2C5_SCL exynos4_gpio_part1_get_nr(b, 7) +#define CONFIG_SOFT_I2C_I2C5_SDA exynos4_gpio_part1_get_nr(b, 6) + +/* I2C FG */ +#define CONFIG_SOFT_I2C_I2C9_SCL exynos4_gpio_part2_get_nr(y4, 1) +#define CONFIG_SOFT_I2C_I2C9_SDA exynos4_gpio_part2_get_nr(y4, 0) + +#define CONFIG_SOFT_I2C_GPIO_SCL get_multi_scl_pin() +#define CONFIG_SOFT_I2C_GPIO_SDA get_multi_sda_pin() +#define I2C_INIT multi_i2c_init() #define CONFIG_PMIC #define CONFIG_PMIC_I2C -- 1.7.2.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 0/2] i2c:soft:multi: Support for multiple soft I2C buses at TRATS
Those patches add multiple I2C support for Samsung boards and enables it on Trats. Lukasz Majewski (2): i2c:soft:multi: Support for multiple soft I2C buses at Samsung boards i2c:soft:multi: Enable soft I2C multibus at Trats development board board/samsung/common/Makefile| 43 + board/samsung/common/multi_i2c.c | 65 ++ board/samsung/trats/trats.c | 15 + include/configs/trats.h | 24 ++ include/i2c.h| 12 +++ 5 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 board/samsung/common/Makefile create mode 100644 board/samsung/common/multi_i2c.c -- 1.7.2.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 1/2] i2c:soft:multi: Support for multiple soft I2C buses at Samsung boards
Support for multiple soft I2C buses. Multibus I2C support is achieved by defining get_multi_{sda|scl}_pin functions to switch between multiple soft I2C buses. Common definition of I2C_X I2C buses is provided at i2c.h. TEST HW: Samsung's Exynos4210 evt.0.1 - Trats development board Signed-off-by: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Cc: Heiko Schocher h...@denx.de Cc: Minkyu Kang mk7.k...@samsung.com --- Changes for v2: - Common Samsung code has been put to board/samsung/common/multi_i2c.c file - I2C_{4|5} have been renamed to I2C_{0|1} - *soft_i2c_name[] table has been removed Changes for v3: - None Changes for v4: - Common definitions of available I2C buses are now defined at i2c.h - Compatibility layer (I2C_0) has been added temporarily to not break the Trats I2C communication with PMIC. It will be removed when redesigned PMIC will be posted --- board/samsung/common/Makefile| 43 + board/samsung/common/multi_i2c.c | 65 ++ include/i2c.h| 12 +++ 3 files changed, 120 insertions(+), 0 deletions(-) create mode 100644 board/samsung/common/Makefile create mode 100644 board/samsung/common/multi_i2c.c diff --git a/board/samsung/common/Makefile b/board/samsung/common/Makefile new file mode 100644 index 000..0bcd594 --- /dev/null +++ b/board/samsung/common/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2012 Samsung Electronics +# Lukasz Majewski l.majew...@samsung.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)libsamsung.o + +COBJS-$(CONFIG_SOFT_I2C_MULTI_BUS) += multi_i2c.o + +SRCS:= $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/samsung/common/multi_i2c.c b/board/samsung/common/multi_i2c.c new file mode 100644 index 000..d6c3d37 --- /dev/null +++ b/board/samsung/common/multi_i2c.c @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 Samsung Electronics + * Lukasz Majewski l.majew...@samsung.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include common.h +#include i2c.h + +/* Handle multiple I2C buses instances */ +int get_multi_scl_pin(void) +{ + unsigned int bus = I2C_GET_BUS(); + + switch (bus) { + case I2C_0: /* I2C_0 definition - compatibility layer */ + case I2C_5: + return CONFIG_SOFT_I2C_I2C5_SCL; + case I2C_9: + return CONFIG_SOFT_I2C_I2C9_SCL; + default: + printf(I2C_%d not supported!\n, bus); + }; + + return 0; +} + +int get_multi_sda_pin(void) +{ + unsigned int bus = I2C_GET_BUS(); + + switch (bus) { + case I2C_0: /* I2C_0 definition - compatibility layer */ + case I2C_5: + return CONFIG_SOFT_I2C_I2C5_SDA; + case I2C_9: + return CONFIG_SOFT_I2C_I2C9_SDA; + default: + printf(I2C_%d not supported!\n, bus); + }; + + return 0; +} + +int multi_i2c_init(void) +{ + return 0; +} diff --git a/include/i2c.h b/include/i2c.h index 1f35acf..16f099d 100644
[U-Boot] [PATCH v2] PXE: FDT: Add support for fdt in PXE
Now DT support is becomming common for all new SoC's. Hence it is better to have option for getting specific FDT from the remote server. This patch adds support for new lable i.e. fdt. If fdt_addr is specified then load fdt blob from the remote server to fdt_address. Signed-off-by: Chander Kashyap chander.kash...@linaro.org --- Changes in v2: Removed the duplicate code. common/cmd_pxe.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 6b31dea..0c81e08 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -450,6 +450,7 @@ struct pxe_label { char *kernel; char *append; char *initrd; + char *fdt; int attempted; int localboot; struct list_head list; @@ -517,6 +518,9 @@ static void label_destroy(struct pxe_label *label) if (label-initrd) free(label-initrd); + if (label-fdt) + free(label-fdt); + free(label); } @@ -541,6 +545,9 @@ static void label_print(void *data) if (label-initrd) printf(\t\tinitrd: %s\n, label-initrd); + + if (label-fdt) + printf(\tfdt: %s\n, label-fdt); } /* @@ -633,6 +640,15 @@ static void label_boot(struct pxe_label *label) */ bootm_argv[3] = getenv(fdt_addr); + /* if fdt label is defined then get fdt from server */ + if (bootm_argv[3] label-fdt) { + if (get_relfile_envaddr(label-fdt, fdt_addr) 0) { + printf(Skipping %s for failure retrieving fdt\n, + label-name); + return; + } + } + if (bootm_argv[3]) bootm_argc = 4; @@ -658,6 +674,7 @@ enum token_type { T_DEFAULT, T_PROMPT, T_INCLUDE, + T_FDT, T_INVALID }; @@ -685,6 +702,7 @@ static const struct token keywords[] = { {append, T_APPEND}, {initrd, T_INITRD}, {include, T_INCLUDE}, + {fdt, T_FDT}, {NULL, T_INVALID} }; @@ -1074,6 +1092,11 @@ static int parse_label(char **c, struct pxe_menu *cfg) err = parse_sliteral(c, label-initrd); break; + case T_FDT: + if (!label-fdt) + err = parse_sliteral(c, label-fdt); + break; + case T_LOCALBOOT: err = parse_integer(c, label-localboot); break; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Atmel: sam9g10/9m10/9x5: Add support to boot DT kernel
The mainline linux kernel is moving to flatten device tree support Add the CONFIG_OF_LIBFDT option to support booting DT linux kernel Signed-off-by: Bo Shen voice.s...@atmel.com --- include/configs/at91sam9261ek.h|2 ++ include/configs/at91sam9m10g45ek.h |2 ++ include/configs/at91sam9x5ek.h |2 ++ 3 files changed, 6 insertions(+) diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h index 1e1fbe5..611e3e2 100644 --- a/include/configs/at91sam9261ek.h +++ b/include/configs/at91sam9261ek.h @@ -48,6 +48,8 @@ #define CONFIG_DISPLAY_CPUINFO +#define CONFIG_OF_LIBFDT + #define CONFIG_ATMEL_LEGACY #define CONFIG_SYS_TEXT_BASE 0x21f0 diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h index 4ca280a..e988d81 100644 --- a/include/configs/at91sam9m10g45ek.h +++ b/include/configs/at91sam9m10g45ek.h @@ -47,6 +47,8 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_DISPLAY_CPUINFO +#define CONFIG_OF_LIBFDT + /* general purpose I/O */ #define CONFIG_ATMEL_LEGACY/* required until (g)pio is fixed */ #define CONFIG_AT91_GPIO diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h index 1ceb31a..cbdc3e9 100644 --- a/include/configs/at91sam9x5ek.h +++ b/include/configs/at91sam9x5ek.h @@ -42,6 +42,8 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_DISPLAY_CPUINFO +#define CONFIG_OF_LIBFDT + /* general purpose I/O */ #define CONFIG_ATMEL_LEGACY/* required until (g)pio is fixed */ #define CONFIG_AT91_GPIO -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Fix strict-aliasing warning in dlmalloc
Dear all, On 04.09.2012 23:31, andreas.de...@googlemail.com wrote: From: Simon Glass s...@chromium.org This fixes the following warnings in dlmalloc seen with my gcc 4.6. dlmalloc.c: In function 'malloc_bin_reloc': dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules dlmalloc.c:1490: note: initialized from here dlmalloc.c:1493: note: initialized from here This version is tested on avr32 arch boards. Signed-off-by: Simon Glass s...@chromium.org Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com --- if no one complains I will apply this through u-boot-avr32 next weekend. Best regards Andreas Bießmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Exynos5250: Enable PXE Support
Add PXE support for the Exynos5250. Signed-off-by: Chander Kashyap chander.kash...@linaro.org --- include/configs/smdk5250.h |6 ++ 1 file changed, 6 insertions(+) diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h index 27dab76..2029ad3 100644 --- a/include/configs/smdk5250.h +++ b/include/configs/smdk5250.h @@ -216,6 +216,12 @@ #define CONFIG_ENV_SROM_BANK 1 #endif /*CONFIG_CMD_NET*/ +/* Enable PXE Support */ +#ifdef CONFIG_CMD_NET +#define CONFIG_CMD_PXE +#define CONFIG_MENU +#endif + /* Enable devicetree support */ #define CONFIG_OF_LIBFDT -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/6] video: cfb_console: logo can be positioned via the splashpos variable
Hello Anatolij, [U-Boot] [PATCH v2 3/6] video: cfb_console: logo can be positioned via the splashpos variable From: Bastian Ruppert bastian.rupp...@sewerin.de Extend the driver for placing the video/bmp logo as specified by splashpos environment variable. Signed-off-by: Bastian Ruppert bastian.rupp...@sewerin.de Signed-off-by: Anatolij Gustschin ag...@denx.de CC: Tom Rini tr...@ti.com CC: Stefano Babic sba...@denx.de --- v2: - remove some ifdefs - revise commit log - adjust video_logo_height by video_logo_ypos and thus fix return address for video console offset - add BMP_ALIGN_CENTER case to logo_plot() for proper logo offset calculation if m specifier is used in splashpos drivers/video/cfb_console.c | 88 + + 1 files changed, 63 insertions(+), 25 deletions(-) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 19d061f..81e5e08 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -66,7 +66,11 @@ * CONFIG_CONSOLE_TIME - display time/date in upper right *corner, needs CONFIG_CMD_DATE and *CONFIG_CONSOLE_CURSOR - * CONFIG_VIDEO_LOGO - display Linux Logo in upper left corner + * CONFIG_VIDEO_LOGO - display Linux Logo in upper left corner. + *Use CONFIG_SPLASH_SCREEN_ALIGN with + *environment variable splashpos to place + *the logo on other position. In this case + *no CONSOLE_EXTRA_INFO is possible. * CONFIG_VIDEO_BMP_LOGO - use bmp_logo instead of linux_logo * CONFIG_CONSOLE_EXTRA_INFO - display additional board information *strings that normaly goes to serial @@ -369,6 +373,8 @@ static void *video_fb_address; /* frame bufferaddress */ static void *video_console_address; /* console buffer start address */ static int video_logo_height = VIDEO_LOGO_HEIGHT; +static int video_logo_xpos; +static int video_logo_ypos; static int __maybe_unused cursor_state; static int __maybe_unused old_col; @@ -1488,8 +1494,21 @@ void logo_plot(void *screen, int width, int x, int y) int ycount = video_logo_height; unsigned char r, g, b, *logo_red, *logo_blue, *logo_green; unsigned char *source; - unsigned char *dest = (unsigned char *) screen + - ((y * width * VIDEO_PIXEL_SIZE) + x * VIDEO_PIXEL_SIZE); + unsigned char *dest; + +#ifdef CONFIG_SPLASH_SCREEN_ALIGN + if (x == BMP_ALIGN_CENTER) + x = max(0, (VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH) / 2); + else if (x 0) + x = max(0, VIDEO_VISIBLE_COLS - VIDEO_LOGO_WIDTH + x + 1); + + if (y == BMP_ALIGN_CENTER) + y = max(0, (VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT) / 2); + else if (y 0) + y = max(0, VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT + y + 1); +#endif /* CONFIG_SPLASH_SCREEN_ALIGN */ + + dest = (unsigned char *)screen + (y * width + x) * VIDEO_PIXEL_SIZE; #ifdef CONFIG_VIDEO_BMP_LOGO source = bmp_logo_bitmap; @@ -1592,42 +1611,61 @@ static void *video_logo(void) char info[128]; int space, len; __maybe_unused int y_off = 0; + __maybe_unused ulong addr; + __maybe_unused char *s; -#ifdef CONFIG_SPLASH_SCREEN - char *s; - ulong addr; - - s = getenv(splashimage); +#ifdef CONFIG_SPLASH_SCREEN_ALIGN + s = getenv(splashpos); if (s != NULL) { - int x = 0, y = 0; + if (s[0] == 'm') + video_logo_xpos = BMP_ALIGN_CENTER; + else + video_logo_xpos = simple_strtol(s, NULL, 0); - addr = simple_strtoul(s, NULL, 16); -#ifdef CONFIG_SPLASH_SCREEN_ALIGN - s = getenv(splashpos); + s = strchr(s + 1, ','); if (s != NULL) { - if (s[0] == 'm') -x = BMP_ALIGN_CENTER; + if (s[1] == 'm') +video_logo_ypos = BMP_ALIGN_CENTER; else -x = simple_strtol(s, NULL, 0); - - s = strchr(s + 1, ','); - if (s != NULL) { -if (s[1] == 'm') - y = BMP_ALIGN_CENTER; -else - y = simple_strtol(s + 1, NULL, 0); - } +video_logo_ypos = simple_strtol(s + 1, NULL, 0); } + } #endif /* CONFIG_SPLASH_SCREEN_ALIGN */ - if (video_display_bitmap(addr, x, y) == 0) { +#ifdef CONFIG_SPLASH_SCREEN + s = getenv(splashimage); + if (s != NULL) { + + addr = simple_strtoul(s, NULL, 16); + + + if (video_display_bitmap(addr, + video_logo_xpos, + video_logo_ypos) == 0) { video_logo_height = 0; return ((void *) (video_fb_address)); } } #endif /* CONFIG_SPLASH_SCREEN */ - logo_plot(video_fb_address, VIDEO_COLS, 0, 0); + logo_plot(video_fb_address, VIDEO_COLS, +video_logo_xpos, video_logo_ypos); + +#ifdef CONFIG_SPLASH_SCREEN_ALIGN + /* +* when using splashpos for video_logo, skip any info +
Re: [U-Boot] [PATCH 3/6] video: cfb_console: logo can be positioned via the splashpos variable
Hi Bastian, Hello Anatolij, there is a number of issues with this patch, please see comments below. On Fri, 10 Aug 2012 09:26:43 +0200 Bastian Ruppert bastian.rupp...@sewerin.de wrote: Signed-off-by: Bastian Ruppert bastian.rupp...@sewerin.de CC: Anatolij Gustschin ag...@denx.de CC: Tom Rini tr...@ti.com CC: Stefano Babic sba...@denx.de --- drivers/video/cfb_console.c | 61 +++ +--- 1 files changed, 40 insertions(+), 21 deletions(-) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 19d061f..21b52bd 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -66,7 +66,11 @@ * CONFIG_CONSOLE_TIME - display time/date in upper right *corner, needs CONFIG_CMD_DATE and *CONFIG_CONSOLE_CURSOR - * CONFIG_VIDEO_LOGO - display Linux Logo in upper left corner + * CONFIG_VIDEO_LOGO - display Linux Logo in upper left corner. + *Use CONFIG_SPLASH_SCREEN_ALIGN with + *environment variable splashpos to place + *the logo on other position. In this case + *no CONSOLE_EXTRA_INFO is possible. * CONFIG_VIDEO_BMP_LOGO - use bmp_logo instead of linux_logo * CONFIG_CONSOLE_EXTRA_INFO - display additional board information *strings that normaly goes to serial @@ -369,6 +373,8 @@ static void *video_fb_address; /* frame buffer address */ static void *video_console_address; /* console buffer start address */ static int video_logo_height = VIDEO_LOGO_HEIGHT; +static int video_logo_xpos; +static int video_logo_ypos; static int __maybe_unused cursor_state; static int __maybe_unused old_col; @@ -1594,40 +1600,53 @@ static void *video_logo(void) __maybe_unused int y_off = 0; #ifdef CONFIG_SPLASH_SCREEN - char *s; ulong addr; - - s = getenv(splashimage); +#endif +#if defined(CONFIG_SPLASH_SCREEN) || defined (CONFIG_SPLASH_SCREEN_ALIGN) + char *s; +#endif these ifdefs should be better reduced, I think we can use __maybe_unused here, like for y_off above. OK. +#ifdef CONFIG_SPLASH_SCREEN_ALIGN + s = getenv(splashpos); if (s != NULL) { - int x = 0, y = 0; + if (s[0] == 'm') + video_logo_xpos = BMP_ALIGN_CENTER; The 'm' case will work with splashscreen, but not with the video logo. There is no proper offset calculation in logo_plot() if xpos or ypos are set to BMP_ALIGN_CENTER. As a result the logo offset will be wrong and an access to wrong offset can even brick the board (on boards with small frame buffers). ... + + if (video_display_bitmap(addr, \ + video_logo_xpos, \ no need to use \ here. ... + logo_plot(video_fb_address, \ + VIDEO_COLS, \ + video_logo_xpos, \ ditto. ... OK. +#ifdef CONFIG_SPLASH_SCREEN_ALIGN + /* when using splashpos for video_logo, no console output */ + return (video_fb_address + video_logo_height * VIDEO_LINE_LEN); The returned address is used as text console offset, so if the logo is moved down, the video_logo_height should be increased by video_logo_ypos. Otherwise the text and cursor positions will be wrong in the video console. I've fixed these issues and submitted a patch v2 3/6. Please test. Thanks, Anatolij Thank you for your effort, Bastian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/6] video: cfb_console: logo can be positioned via the splashpos variable
Hello Bastian, On Wed, 5 Sep 2012 12:52:59 +0200 bastian.rupp...@sewerin.de wrote: ... + video_logo_height += video_logo_ypos; + return video_fb_address + video_logo_height * VIDEO_LINE_LEN; + } +#endif I have some trouble with this version when using splashpos = m,m . In this case video_logo_ypos is 32767 (BMP_ALIGN_CENTER) here. Following extension isworking for me: Ah, indeed. Thanks for testing and catching it. #ifdef CONFIG_SPLASH_SCREEN_ALIGN /* * when using splashpos for video_logo, skip any info * output on video console if the logo is not at 0,0 */ if (video_logo_xpos || video_logo_ypos) { /* * video_logo_height is used in text and cursor offset * calculations. Since the console is below the logo, * we need to adjust the logo height */ if (video_logo_ypos == BMP_ALIGN_CENTER) video_logo_height += max(0, (VIDEO_VISIBLE_ROWS - \ VIDEO_LOGO_HEIGHT) / 2); else if (video_logo_ypos = 0) video_logo_height += video_logo_ypos; OK. But please use else if (video_logo_ypos 0) video_logo_height += video_logo_ypos; ... Should i post a version 3 for this patch? Yes, please. Thanks, Anatolij ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/2] Loop block device for sandbox
This driver uses files as block devices, can be used for testing disk operations on sandbox. A new command sata_loop is introduced to load files in runtime. Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com CC: Marek Vasut ma...@denx.de CC: Mike Frysinger vap...@gentoo.org --- Changes for v3: introduce sata_loop command Changes for v2: split sandbox config off into separate patch (2/2) rename file to signify exported API style fixes show end of long filenames rather than beginning check for lseek errors to indicate non-regular file drivers/block/Makefile| 1 + drivers/block/sata_loopback.c | 200 ++ 2 files changed, 201 insertions(+) create mode 100644 drivers/block/sata_loopback.c diff --git a/drivers/block/Makefile b/drivers/block/Makefile index f1ebdcc..c95651a 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -40,6 +40,7 @@ COBJS-$(CONFIG_SATA_SIL) += sata_sil.o COBJS-$(CONFIG_IDE_SIL680) += sil680.o COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o COBJS-$(CONFIG_SYSTEMACE) += systemace.o +COBJS-${CONFIG_SATA_LOOP} += sata_loopback.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/block/sata_loopback.c b/drivers/block/sata_loopback.c new file mode 100644 index 000..0e6923b --- /dev/null +++ b/drivers/block/sata_loopback.c @@ -0,0 +1,200 @@ +/* + * (C) Copyright 2012 + * Pavel Herrmann morpheus.i...@gmail.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include common.h +#include part.h +#include ata.h +#include libata.h +#include errno.h +#include os.h +#include command.h +#include malloc.h + +static const char revision[] = 0.0; +static const char vendor[] = SATA loopback; + +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; + +extern block_dev_desc_t sata_dev_desc[]; + +int init_sata(int dev) +{ + static int zeroed = 0; + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd, old_fd; + + + if (!zeroed) { + int i; + for (i = 0; i CONFIG_SYS_SATA_MAX_DEVICE; i++) + filenames[i]=strdup(); + zeroed = 1; + } + + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + + fd = os_open(filenames[dev], OS_O_RDWR); + /* This is ugly, but saves allocation for 1 int. */ + old_fd = (long) pdev-priv; + pdev-priv = (void *) (long) fd; + /* +* sadly we cannot set -1 to all as above, because sata init will zero +* this value before calling sata_init. +*/ + if ((old_fd 2) || (old_fd 0)) + os_close(old_fd); + + return 0; +} + +lbaint_t sata_read(int dev, lbaint_t start, lbaint_t blkcnt, void *buffer) +{ + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd = (long) pdev-priv; + lbaint_t start_byte = ATA_SECT_SIZE * start; + lbaint_t length_byte = ATA_SECT_SIZE * blkcnt; + lbaint_t retval; + + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) + return -1; + + retval = os_read(fd, buffer, length_byte); + + return retval/ATA_SECT_SIZE; +} + +lbaint_t sata_write(int dev, lbaint_t start, lbaint_t blkcnt, void *buffer) +{ + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd = (long) pdev-priv; + lbaint_t start_byte = ATA_SECT_SIZE * start; + lbaint_t length_byte = ATA_SECT_SIZE * blkcnt; + lbaint_t retval; + + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) + return -1; + + retval = os_write(fd, buffer, length_byte); + + return retval/ATA_SECT_SIZE; +} + +int scan_sata(int dev) +{ + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd = (long) pdev-priv; + int namelen; + const char *filename = filenames[dev]; + lbaint_t bytes = 0; + + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + + memcpy(pdev-vendor, vendor, sizeof(vendor)); + memcpy(pdev-revision, revision,
[U-Boot] [PATCH v3 2/2] Use loop block device in sandbox board
Enable SATA_LOOP and a few disk-related commands for sandbox Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com --- Changes for v3: drop static names for loop devices Changes for v2: add a few words of description include/configs/sandbox.h | 8 1 file changed, 8 insertions(+) diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 0220386..c238feb 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -93,4 +93,12 @@ stdout=serial\0 \ stderr=serial\0 +/* SATA loopback device */ +#define CONFIG_CMD_SATA +#define CONFIG_SATA_LOOP +#define CONFIG_SYS_SATA_MAX_DEVICE 3 +#define CONFIG_DOS_PARTITION +#define CONFIG_CMD_FAT +#define CONFIG_CMD_EXT2 + #endif -- 1.7.12 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] How to manage RMOBILE patches?
Hi Nobuhiro, On Wed, 5 Sep 2012 11:26:37 +0900, Nobuhiro Iwamatsu iwama...@nigauri.org wrote: Hi, On Wed, Sep 5, 2012 at 2:36 AM, Tom Rini tr...@ti.com wrote: On Mon, Sep 03, 2012 at 09:15:56PM +0200, Wolfgang Denk wrote: Dear Nobuhiro Iwamatsu, In message CABMQnVLBEEjcEtfTzdeThHfTLp=b24qsognfjbzr-8ywytj...@mail.gmail.com you wrote: I am working supporting Renesas RMOBILE to U-Boot. Renesas's RMOBILE SoC family contains an ARM Cortex-A9, and this uses the same IP as SH. (For example, timer, ether, serial, etc.) I already sent to patches of rmobile, I got review from some developers. And the patch is managed by the arm/rmobile branch of u-boot-sh[0] which I have maintained, now. Since I had you take the patch of rmobile into an ARM repository, I consulted with Albert about the future development approach. We thought two methods are considered. One is Albert picks up a patch from ML to ARM repository, As this is ARM code, this appears the most natural approach to me. Another is whether to have pull from the repository by having a repository for rmobile made. If this is an ARM SoC, then it should go through the ARM repo - even if we should later decide that there is so much traffic that a separate rmobile repo would be sustified, thi would still be a sub-repo, which Albert would pull from. Another option, which Mike is using for, iirc, sf and blackfin, is just to add rmobile-master / rmobile-next as branches to the u-boot-sh repository. Yes, this is one of easy way. But Albert won't pull form u-boot-sh, if If my understanding is not wrong. This just means that they'll end up on u-boot/master from u-boot.sh (and from there into u-boot-arm later on). Best regards, Nobuhiro Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
Dear Pavel Herrmann, This driver uses files as block devices, can be used for testing disk operations on sandbox. A new command sata_loop is introduced to load files in runtime. Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com CC: Marek Vasut ma...@denx.de CC: Mike Frysinger vap...@gentoo.org ERROR: foo * bar should be foo *bar #136: FILE: drivers/block/sata_loopback.c:36: +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; WARNING: externs should be avoided in .c files #138: FILE: drivers/block/sata_loopback.c:38: +extern block_dev_desc_t sata_dev_desc[]; ERROR: do not initialise statics to 0 or NULL #142: FILE: drivers/block/sata_loopback.c:42: + static int zeroed = 0; ERROR: spaces required around that '=' (ctx:VxV) #150: FILE: drivers/block/sata_loopback.c:50: + filenames[i]=strdup(); ^ ERROR: space prohibited after that open parenthesis '(' #181: FILE: drivers/block/sata_loopback.c:81: + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) ERROR: space prohibited after that open parenthesis '(' #197: FILE: drivers/block/sata_loopback.c:97: + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) ERROR: do not initialise statics to 0 or NULL #256: FILE: drivers/block/sata_loopback.c:156: + static int zeroed = 0; total: 6 errors, 1 warnings, 207 lines checked Checkpatch and I never sleep, don't even try ;-) --- Changes for v3: introduce sata_loop command Changes for v2: split sandbox config off into separate patch (2/2) rename file to signify exported API style fixes show end of long filenames rather than beginning check for lseek errors to indicate non-regular file drivers/block/Makefile| 1 + drivers/block/sata_loopback.c | 200 ++ 2 files changed, 201 insertions(+) create mode 100644 drivers/block/sata_loopback.c diff --git a/drivers/block/Makefile b/drivers/block/Makefile index f1ebdcc..c95651a 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -40,6 +40,7 @@ COBJS-$(CONFIG_SATA_SIL) += sata_sil.o COBJS-$(CONFIG_IDE_SIL680) += sil680.o COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o COBJS-$(CONFIG_SYSTEMACE) += systemace.o +COBJS-${CONFIG_SATA_LOOP} += sata_loopback.o COBJS:= $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/block/sata_loopback.c b/drivers/block/sata_loopback.c new file mode 100644 index 000..0e6923b --- /dev/null +++ b/drivers/block/sata_loopback.c @@ -0,0 +1,200 @@ +/* + * (C) Copyright 2012 + * Pavel Herrmann morpheus.i...@gmail.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include common.h +#include part.h +#include ata.h +#include libata.h +#include errno.h +#include os.h +#include command.h +#include malloc.h + +static const char revision[] = 0.0; +static const char vendor[] = SATA loopback; + +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; + +extern block_dev_desc_t sata_dev_desc[]; + +int init_sata(int dev) +{ + static int zeroed = 0; Is this really needed here and below? Pull this crap out. + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd, old_fd; + + Redundant newline + if (!zeroed) { + int i; + for (i = 0; i CONFIG_SYS_SATA_MAX_DEVICE; i++) + filenames[i]=strdup(); + zeroed = 1; + } + + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + + fd = os_open(filenames[dev], OS_O_RDWR); + /* This is ugly, but saves allocation for 1 int. */ + old_fd = (long) pdev-priv; + pdev-priv = (void *) (long) fd; + /* + * sadly we cannot set -1 to all as above, because sata init will zero + * this value before calling sata_init. Sorry, I can't parse this. + */ + if ((old_fd 2) || (old_fd 0)) + os_close(old_fd); + + return 0; +} + +lbaint_t sata_read(int dev, lbaint_t start, lbaint_t blkcnt, void *buffer) +{ + block_dev_desc_t *pdev =
Re: [U-Boot] [Patch V5 2/4] MIPS: change address related header files
On Wed, Sep 5, 2012 at 6:25 AM, Daniel Schwierzeck daniel.schwierz...@gmail.com wrote: 2012/9/4 Zhizhou Zhang etou...@gmail.com: Prepare for upcoming mips64 support. This patch add mips64 address space support. Signed-off-by: Zhizhou Zhang etou...@gmail.com --- arch/mips/include/asm/addrspace.h |2 +- arch/mips/include/asm/asm.h |2 +- arch/mips/include/asm/io.h | 16 arch/mips/include/asm/posix_types.h |6 ++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index 3a1e6d6..b768bb5 100644 --- a/arch/mips/include/asm/addrspace.h +++ b/arch/mips/include/asm/addrspace.h @@ -136,7 +136,7 @@ cannot access physical memory directly from core */ #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x2000) #else /* !CONFIG_SOC_AU1X00 */ -#define UNCACHED_SDRAM(a) KSEG1ADDR(a) +#define UNCACHED_SDRAM(a) CKSEG1ADDR(a) #endif /* CONFIG_SOC_AU1X00 */ #endif /* __ASSEMBLY__ */ diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h index 608cfcf..933ccb1 100644 --- a/arch/mips/include/asm/asm.h +++ b/arch/mips/include/asm/asm.h @@ -401,7 +401,7 @@ symbol = value #ifdef CONFIG_SGI_IP28 /* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */ #include asm/cacheops.h -#define R10KCBARRIER(addr) cache Cache_Barrier, addr; +#define R10KCBARRIER(addr) cache CACHE_BARRIER, addr; this change is unrelated to this patch. I guess this belongs to patch 1/4 I'm so careless! Then what should I do now? need I resend these once again? I think that's not good.. #else #define R10KCBARRIER(addr) #endif diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 025012a..80eab75 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -120,12 +120,20 @@ static inline void set_io_port_base(unsigned long base) */ extern inline phys_addr_t virt_to_phys(volatile void * address) { +#ifndef CONFIG_64BIT return CPHYSADDR(address); +#else + return XPHYSADDR(address); +#endif } extern inline void * phys_to_virt(unsigned long address) { +#ifndef CONFIG_64BIT return (void *)KSEG0ADDR(address); +#else + return (void *)CKSEG0ADDR(address); +#endif } /* @@ -133,12 +141,20 @@ extern inline void * phys_to_virt(unsigned long address) */ extern inline unsigned long virt_to_bus(volatile void * address) { +#ifndef CONFIG_64BIT return CPHYSADDR(address); +#else + return XPHYSADDR(address); +#endif } extern inline void * bus_to_virt(unsigned long address) { +#ifndef CONFIG_64BIT return (void *)KSEG0ADDR(address); +#else + return (void *)CKSEG0ADDR(address); +#endif } /* diff --git a/arch/mips/include/asm/posix_types.h b/arch/mips/include/asm/posix_types.h index 879aae2..6566ad0 100644 --- a/arch/mips/include/asm/posix_types.h +++ b/arch/mips/include/asm/posix_types.h @@ -24,9 +24,15 @@ typedef int __kernel_pid_t; typedef int__kernel_ipc_pid_t; typedef int__kernel_uid_t; typedef int__kernel_gid_t; +#ifndef CONFIG_MIPS64 typedef unsigned int __kernel_size_t; typedef int__kernel_ssize_t; typedef int__kernel_ptrdiff_t; +#else +typedef unsigned long __kernel_size_t; +typedef long __kernel_ssize_t; +typedef long __kernel_ptrdiff_t; +#endif typedef long __kernel_time_t; typedef long __kernel_suseconds_t; typedef long __kernel_clock_t; -- 1.7.9.5 -- Best regards, Daniel -- Regards, Zhizhou Zhang ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch V5 4/4] MIPS: add board qemu-mips64 support
On Wed, Sep 5, 2012 at 7:12 AM, Daniel Schwierzeck daniel.schwierz...@gmail.com wrote: 2012/9/4 Zhizhou Zhang etou...@gmail.com: Both big-endian and little-endian are tested with below commands: Rom version: (Default, Now we config it as rom version) qemu-system-mips64el -M mips -bios u-boot.bin -cpu MIPS64R2-generic -nographic qemu-system-mips64 -M mips -bios u-boot.bin -cpu MIPS64R2-generic -nographic Ram version: qemu-system-mips64el -M mips -cpu MIPS64R2-generic -kernel u-boot -nographic qemu-system-mips64 -M mips -cpu MIPS64R2-generic -kernel u-boot -nographic Signed-off-by: Zhizhou Zhang etou...@gmail.com --- arch/mips/cpu/mips64/Makefile | 45 +++ arch/mips/cpu/mips64/cache.S | 229 + arch/mips/cpu/mips64/config.mk| 40 ++ arch/mips/cpu/mips64/cpu.c| 111 arch/mips/cpu/mips64/interrupts.c | 34 + arch/mips/cpu/mips64/start.S | 256 + arch/mips/cpu/mips64/time.c | 87 + board/qemu-mips/u-boot.lds|8 ++ boards.cfg|2 + examples/standalone/mips64.lds| 59 + include/configs/qemu-mips64.h | 171 + 11 files changed, 1042 insertions(+) create mode 100644 arch/mips/cpu/mips64/Makefile create mode 100644 arch/mips/cpu/mips64/cache.S create mode 100644 arch/mips/cpu/mips64/config.mk create mode 100644 arch/mips/cpu/mips64/cpu.c create mode 100644 arch/mips/cpu/mips64/interrupts.c create mode 100644 arch/mips/cpu/mips64/start.S create mode 100644 arch/mips/cpu/mips64/time.c create mode 100644 examples/standalone/mips64.lds create mode 100644 include/configs/qemu-mips64.h [...] diff --git a/include/configs/qemu-mips64.h b/include/configs/qemu-mips64.h new file mode 100644 index 000..216326d --- /dev/null +++ b/include/configs/qemu-mips64.h @@ -0,0 +1,171 @@ +/* + * (C) Copyright 2003 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * This file contains the configuration parameters for qemu-mips64 target. + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define CONFIG_MIPS64 /* MIPS64 CPU core */ +#define CONFIG_QEMU_MIPS1 +#define CONFIG_MISC_INIT_R + +#define CONFIG_BOOTDELAY 10 /* autoboot after 10 seconds */ + +#define CONFIG_BAUDRATE115200 + +/* valid baudrates */ +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } + +#define CONFIG_TIMESTAMP /* Print image info with timestamp */ +#undef CONFIG_BOOTARGS + +#define CONFIG_EXTRA_ENV_SETTINGS \ + addmisc=setenv bootargs ${bootargs} \ + console=ttyS0,${baudrate} \ + panic=1\0 \ + bootfile=/tftpboot/vmlinux\0 \ + load=tftp 8050 ${u-boot}\0\ + + why have you omitted this? #define CONFIG_BOOTCOMMAND bootp;bootelf #define CONFIG_CMD_ELF Because I haven't tested `bootelf' command. I'm not should it work or not. Another reason is that when I configure CONFIG_CMD_ELF I will get lots of warning such as: cmd_elf.c: In function 'load_elf_image_phdr': cmd_elf.c:289:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_elf.c: In function 'load_elf_image_shdr': cmd_elf.c:343:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_elf.c:346:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] +/* + * BOOTP options + */ +#define CONFIG_BOOTP_BOOTFILESIZE +#define CONFIG_BOOTP_BOOTPATH +#define CONFIG_BOOTP_GATEWAY +#define CONFIG_BOOTP_HOSTNAME + +/* + * Command line configuration. + */ +#include config_cmd_default.h +#define CONFIG_DP83902A +
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
On Wednesday 05 September 2012 13:33:13 Marek Vasut wrote: Dear Pavel Herrmann, This driver uses files as block devices, can be used for testing disk operations on sandbox. A new command sata_loop is introduced to load files in runtime. Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com CC: Marek Vasut ma...@denx.de CC: Mike Frysinger vap...@gentoo.org ERROR: foo * bar should be foo *bar #136: FILE: drivers/block/sata_loopback.c:36: +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; WARNING: externs should be avoided in .c files #138: FILE: drivers/block/sata_loopback.c:38: +extern block_dev_desc_t sata_dev_desc[]; ERROR: do not initialise statics to 0 or NULL #142: FILE: drivers/block/sata_loopback.c:42: + static int zeroed = 0; ERROR: spaces required around that '=' (ctx:VxV) #150: FILE: drivers/block/sata_loopback.c:50: + filenames[i]=strdup(); ^ ERROR: space prohibited after that open parenthesis '(' #181: FILE: drivers/block/sata_loopback.c:81: + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) ERROR: space prohibited after that open parenthesis '(' #197: FILE: drivers/block/sata_loopback.c:97: + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) ERROR: do not initialise statics to 0 or NULL #256: FILE: drivers/block/sata_loopback.c:156: + static int zeroed = 0; total: 6 errors, 1 warnings, 207 lines checked Checkpatch and I never sleep, don't even try ;-) sorry, my bad, i thought i had it on pre-commit --- Changes for v3: introduce sata_loop command Changes for v2: split sandbox config off into separate patch (2/2) rename file to signify exported API style fixes show end of long filenames rather than beginning check for lseek errors to indicate non-regular file drivers/block/Makefile| 1 + drivers/block/sata_loopback.c | 200 ++ 2 files changed, 201 insertions(+) create mode 100644 drivers/block/sata_loopback.c diff --git a/drivers/block/Makefile b/drivers/block/Makefile index f1ebdcc..c95651a 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -40,6 +40,7 @@ COBJS-$(CONFIG_SATA_SIL) += sata_sil.o COBJS-$(CONFIG_IDE_SIL680) += sil680.o COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o COBJS-$(CONFIG_SYSTEMACE) += systemace.o +COBJS-${CONFIG_SATA_LOOP} += sata_loopback.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/block/sata_loopback.c b/drivers/block/sata_loopback.c new file mode 100644 index 000..0e6923b --- /dev/null +++ b/drivers/block/sata_loopback.c @@ -0,0 +1,200 @@ +/* + * (C) Copyright 2012 + * Pavel Herrmann morpheus.i...@gmail.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include common.h +#include part.h +#include ata.h +#include libata.h +#include errno.h +#include os.h +#include command.h +#include malloc.h + +static const char revision[] = 0.0; +static const char vendor[] = SATA loopback; + +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; + +extern block_dev_desc_t sata_dev_desc[]; + +int init_sata(int dev) +{ + static int zeroed = 0; Is this really needed here and below? Pull this crap out. yes, because you dont know whetehr this gets called first from sata_loop or from sata init + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd, old_fd; + + Redundant newline + if (!zeroed) { + int i; + for (i = 0; i CONFIG_SYS_SATA_MAX_DEVICE; i++) + filenames[i]=strdup(); + zeroed = 1; + } + + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + + fd = os_open(filenames[dev], OS_O_RDWR); + /* This is ugly, but saves allocation for 1 int. */ + old_fd = (long) pdev-priv; + pdev-priv = (void *) (long) fd; + /* +* sadly we cannot set -1 to all as above,
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
second try... On Wednesday 05 September 2012 13:33:13 Marek Vasut wrote: Dear Pavel Herrmann, This driver uses files as block devices, can be used for testing disk operations on sandbox. A new command sata_loop is introduced to load files in runtime. Signed-off-by: Pavel Herrmann morpheus.i...@gmail.com CC: Marek Vasut ma...@denx.de CC: Mike Frysinger vap...@gentoo.org ERROR: foo * bar should be foo *bar #136: FILE: drivers/block/sata_loopback.c:36: +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; WARNING: externs should be avoided in .c files #138: FILE: drivers/block/sata_loopback.c:38: +extern block_dev_desc_t sata_dev_desc[]; ERROR: do not initialise statics to 0 or NULL #142: FILE: drivers/block/sata_loopback.c:42: + static int zeroed = 0; ERROR: spaces required around that '=' (ctx:VxV) #150: FILE: drivers/block/sata_loopback.c:50: + filenames[i]=strdup(); ^ ERROR: space prohibited after that open parenthesis '(' #181: FILE: drivers/block/sata_loopback.c:81: + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) ERROR: space prohibited after that open parenthesis '(' #197: FILE: drivers/block/sata_loopback.c:97: + if ( os_lseek(fd, start_byte, OS_SEEK_SET) != start_byte) ERROR: do not initialise statics to 0 or NULL #256: FILE: drivers/block/sata_loopback.c:156: + static int zeroed = 0; total: 6 errors, 1 warnings, 207 lines checked Checkpatch and I never sleep, don't even try ;-) sorry, my bad, i thought i had it on pre-commit --- Changes for v3: introduce sata_loop command Changes for v2: split sandbox config off into separate patch (2/2) rename file to signify exported API style fixes show end of long filenames rather than beginning check for lseek errors to indicate non-regular file drivers/block/Makefile| 1 + drivers/block/sata_loopback.c | 200 ++ 2 files changed, 201 insertions(+) create mode 100644 drivers/block/sata_loopback.c diff --git a/drivers/block/Makefile b/drivers/block/Makefile index f1ebdcc..c95651a 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile @@ -40,6 +40,7 @@ COBJS-$(CONFIG_SATA_SIL) += sata_sil.o COBJS-$(CONFIG_IDE_SIL680) += sil680.o COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o COBJS-$(CONFIG_SYSTEMACE) += systemace.o +COBJS-${CONFIG_SATA_LOOP} += sata_loopback.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/block/sata_loopback.c b/drivers/block/sata_loopback.c new file mode 100644 index 000..0e6923b --- /dev/null +++ b/drivers/block/sata_loopback.c @@ -0,0 +1,200 @@ +/* + * (C) Copyright 2012 + * Pavel Herrmann morpheus.i...@gmail.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include common.h +#include part.h +#include ata.h +#include libata.h +#include errno.h +#include os.h +#include command.h +#include malloc.h + +static const char revision[] = 0.0; +static const char vendor[] = SATA loopback; + +static char * filenames[CONFIG_SYS_SATA_MAX_DEVICE]; + +extern block_dev_desc_t sata_dev_desc[]; + +int init_sata(int dev) +{ + static int zeroed = 0; Is this really needed here and below? Pull this crap out. yes, because you dont know whether this gets called first from sata_loop or from sata init +int scan_sata(int dev) +{ + block_dev_desc_t *pdev = sata_dev_desc[dev]; + int fd = (long) pdev-priv; + int namelen; + const char *filename = filenames[dev]; + lbaint_t bytes = 0; + + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + + memcpy(pdev-vendor, vendor, sizeof(vendor)); + memcpy(pdev-revision, revision, sizeof(revision)); + namelen = strlen(filenames[dev]); + + if (namelen 20) { + /* take the last 17 chars, prepend them with ... */ + filename += (namelen - 17); +
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
Dear Pavel Herrmann, [...] move this out. besides, I think it'd be much systematic to just scream at user to call sata rescan and bail out instead of doing it for him. i dont actually need a sata rescan, i just need to make sure i have dynamically allocated names, so i can safely call free() later, otherwise this segfaults when called before sata scan See my previous email + /* make sure we have valid filenames */ + if (!zeroed) { + init_sata(0); + zeroed = 1; + } + + switch (argc) { + case 0: + case 1: + return CMD_RET_USAGE; + case 2: + dev = simple_strtoul(argv[1], NULL, 10); Ok, so if I run this command and ask for device 0xb00bf33d ... will this survive? Hint: it won't, rangecheck missing. hint - scan_sata does the range check in this codepath saw it, see below. Duplication of code is not good and is error prone. + return scan_sata(dev); + + case 3: + if (!strncmp(argv[1], inf, 3)) { + dev = simple_strtoul(argv[2], NULL, 10); Same here see above + return scan_sata(dev); + } + return CMD_RET_USAGE; + case 4: + if (!strncmp(argv[1], load, 4)) { + dev = simple_strtoul(argv[2], NULL, 10); + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { And here you have it ? Uh oh, I see, sata_scan() does it for you ... I'd say, abstract it out into lightweight static inline function. + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + free(filenames[dev]); + filenames[dev] = strdup(argv[3]); + init_sata(dev); + return scan_sata(dev); + } + return CMD_RET_USAGE; + } + return CMD_RET_USAGE; +} + +U_BOOT_CMD( + sata_loop, 4, 1, do_loop, + SATA loopback, + [info] devnum - show info about loop devnum\n Make this info part mandatory. Than you can cut the whole argc loop into simple if argc != 2 ; then fail . And do simple checking for the first letter of the argument being either i or d . wont help, still need argc 3 or 4 Makes is simpler, you can bail out if it's not 3 or 4 + sata_loop load devnum file - load file from host FS into loop devnum sata_loop is redundant above. really? how do you figure? Run help sata_loop and see the result ... Pavel Herrmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
Dear Pavel Herrmann, [...] besides, I think it'd be much systematic to just scream at user to call sata rescan and bail out instead of doing it for him. i dont actually need a sata rescan, i just need to make sure i have dynamically allocated names Sorry, I can't parse this ... but ... , so i can safely call free() later, otherwise this segfaults when called before sata scan The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is performed. So if you call free() on null pointer, nothing happens. Where's the real problem? + /* make sure we have valid filenames */ + if (!zeroed) { + init_sata(0); + zeroed = 1; + } + + switch (argc) { + case 0: + case 1: + return CMD_RET_USAGE; + case 2: + dev = simple_strtoul(argv[1], NULL, 10); Ok, so if I run this command and ask for device 0xb00bf33d ... will this survive? Hint: it won't, rangecheck missing. + return scan_sata(dev); + + case 3: + if (!strncmp(argv[1], inf, 3)) { + dev = simple_strtoul(argv[2], NULL, 10); Same here + return scan_sata(dev); + } + return CMD_RET_USAGE; + case 4: + if (!strncmp(argv[1], load, 4)) { + dev = simple_strtoul(argv[2], NULL, 10); + if ((dev 0) || (dev = CONFIG_SYS_SATA_MAX_DEVICE)) { And here you have it ? Uh oh, I see, sata_scan() does it for you ... I'd say, abstract it out into lightweight static inline function. + printf(File index %d is out of range.\n, dev); + return -EINVAL; + } + free(filenames[dev]); + filenames[dev] = strdup(argv[3]); + init_sata(dev); + return scan_sata(dev); + } + return CMD_RET_USAGE; + } + return CMD_RET_USAGE; +} + +U_BOOT_CMD( + sata_loop, 4, 1, do_loop, + SATA loopback, + [info] devnum - show info about loop devnum\n Make this info part mandatory. Than you can cut the whole argc loop into simple if argc != 2 ; then fail . And do simple checking for the first letter of the argument being either i or d . + sata_loop load devnum file - load file from host FS into loop devnum sata_loop is redundant above. +); ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] PXE: FDT: Add support for fdt in PXE
Chander, You should add a description of the new label to doc/README.pxe. Otherwise, it looks good. Jason On Wed, Sep 05, 2012 at 05:26:17AM -0400, Chander Kashyap wrote: Now DT support is becomming common for all new SoC's. Hence it is better to have option for getting specific FDT from the remote server. This patch adds support for new lable i.e. fdt. If fdt_addr is specified then load fdt blob from the remote server to fdt_address. Signed-off-by: Chander Kashyap chander.kash...@linaro.org --- Changes in v2: Removed the duplicate code. common/cmd_pxe.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 6b31dea..0c81e08 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -450,6 +450,7 @@ struct pxe_label { char *kernel; char *append; char *initrd; + char *fdt; int attempted; int localboot; struct list_head list; @@ -517,6 +518,9 @@ static void label_destroy(struct pxe_label *label) if (label-initrd) free(label-initrd); + if (label-fdt) + free(label-fdt); + free(label); } @@ -541,6 +545,9 @@ static void label_print(void *data) if (label-initrd) printf(\t\tinitrd: %s\n, label-initrd); + + if (label-fdt) + printf(\tfdt: %s\n, label-fdt); } /* @@ -633,6 +640,15 @@ static void label_boot(struct pxe_label *label) */ bootm_argv[3] = getenv(fdt_addr); + /* if fdt label is defined then get fdt from server */ + if (bootm_argv[3] label-fdt) { + if (get_relfile_envaddr(label-fdt, fdt_addr) 0) { + printf(Skipping %s for failure retrieving fdt\n, + label-name); + return; + } + } + if (bootm_argv[3]) bootm_argc = 4; @@ -658,6 +674,7 @@ enum token_type { T_DEFAULT, T_PROMPT, T_INCLUDE, + T_FDT, T_INVALID }; @@ -685,6 +702,7 @@ static const struct token keywords[] = { {append, T_APPEND}, {initrd, T_INITRD}, {include, T_INCLUDE}, + {fdt, T_FDT}, {NULL, T_INVALID} }; @@ -1074,6 +1092,11 @@ static int parse_label(char **c, struct pxe_menu *cfg) err = parse_sliteral(c, label-initrd); break; + case T_FDT: + if (!label-fdt) + err = parse_sliteral(c, label-fdt); + break; + case T_LOCALBOOT: err = parse_integer(c, label-localboot); break; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] PXE: FDT: Add support for fdt in PXE
Hi Jason, On 5 September 2012 19:33, Jason Hobbs jason.ho...@calxeda.com wrote: Chander, You should add a description of the new label to doc/README.pxe. Otherwise, it looks good. Jason I will do the same. -- with warm regards, Chander Kashyap ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] How to manage RMOBILE patches?
On 09/05/2012 04:18 AM, Albert ARIBAUD wrote: Hi Nobuhiro, On Wed, 5 Sep 2012 11:26:37 +0900, Nobuhiro Iwamatsu iwama...@nigauri.org wrote: Hi, On Wed, Sep 5, 2012 at 2:36 AM, Tom Rini tr...@ti.com wrote: On Mon, Sep 03, 2012 at 09:15:56PM +0200, Wolfgang Denk wrote: Dear Nobuhiro Iwamatsu, In message CABMQnVLBEEjcEtfTzdeThHfTLp=b24qsognfjbzr-8ywytj...@mail.gmail.com you wrote: I am working supporting Renesas RMOBILE to U-Boot. Renesas's RMOBILE SoC family contains an ARM Cortex-A9, and this uses the same IP as SH. (For example, timer, ether, serial, etc.) I already sent to patches of rmobile, I got review from some developers. And the patch is managed by the arm/rmobile branch of u-boot-sh[0] which I have maintained, now. Since I had you take the patch of rmobile into an ARM repository, I consulted with Albert about the future development approach. We thought two methods are considered. One is Albert picks up a patch from ML to ARM repository, As this is ARM code, this appears the most natural approach to me Another is whether to have pull from the repository by having a repository for rmobile made. If this is an ARM SoC, then it should go through the ARM repo - even if we should later decide that there is so much traffic that a separate rmobile repo would be sustified, thi would still be a sub-repo, which Albert would pull from. Another option, which Mike is using for, iirc, sf and blackfin, is just to add rmobile-master / rmobile-next as branches to the u-boot-sh repository. Yes, this is one of easy way. But Albert won't pull form u-boot-sh, if If my understanding is not wrong. This just means that they'll end up on u-boot/master from u-boot.sh (and from there into u-boot-arm later on). To be clear, what I'm saying is just add a few more branches to u-boot-sh that Albert will pull (since they're ARM stuff). Say u-boot-sh/rmobile/master and u-boot-sh/rmobile/next. Then not get too hung up on which repository a merge message comes from. :) -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [v3] arm: Fixed the offset for the no relocation.
On 04/09/12 23:57, Stefano Babic wrote: On 04/09/2012 16:03, Zhong Hongbo wrote: On 03/09/12 08:14, Marek Vasut wrote: Dear Zhong Hongbo, From: Zhong Hongbo bocui...@gmail.com When the u-boot address of destination equal to __start, no relocation. relocation offset(r9) = 0. Good, now what kind of issue does this patch fix? Hi Marek When you adopt CONFIG_SPL_BUILD framework, no CONFIG_NAND_SPL, if the addr of destination is equal to _start, we should skip u-boot relocation. In the last, u-boot will count the dest addr, see the below: adr r1, _start add lr, r0, r1 add lr, lr, r9 Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register. /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr I can confirm this issue - I see this when I ported SPL to a MX35 board. However, clearing r9 was not enough. I had to fix also _rel_dyn_* to make SPL working, and I did changing the start.S in the same way start.S for arv7 is built. Do you not have these issues ? Hi Stefano, That is enough for my smdk6400 board. Thanks, hongbo Regards, Stefano ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ubifs: Fix ubifsload when using ZLIB
On Wed, 05 Sep 2012 09:58:07 +0100, Veli-Pekka Peltola veli-pekka.pelt...@bluegiga.com wrote: Using ZLIB compression with UBIFS fails if last data node is not a size of UBIFS_BLOCK_SIZE (4096 bytes). Easiest way to test this is trying to read a file smaller than 4k: = ubifsload 4100 /etc/fstab Loading file '/etc/fstab' to addr 0x4100 with size 704 (0x02c0)... UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506) UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22 Error reading file '/etc/fstab' /etc/fstab not found! exit not allowed from main input shell. = With this patch: = ubifsload 4100 /etc/fstab Loading file '/etc/fstab' to addr 0x4100 with size 704 (0x02c0)... Done = Signed-off-by: Veli-Pekka Peltola veli-pekka.pelt...@bluegiga.com Tested-by: Jamie Lentin j...@lentin.co.uk This was affecting me also (UBIFS using ZLIB, on NAND of Kirkwood-based DNS-320), and your patch seems to have fixed loading small files. Thanks! --- fs/ubifs/ubifs.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index c68802b..6a68437 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -37,8 +37,7 @@ DECLARE_GLOBAL_DATA_PTR; static int gzip_decompress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len) { - unsigned long len = in_len; - return zunzip(out, *out_len, (unsigned char *)in, len, 0, 0); + return zunzip(out, *out_len, (unsigned char *)in, (long unsigned int *)out_len, 0, 0); } /* Fake description object for the none compressor */ -- Jamie Lentin ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] ubifs: Fix ubifsload when using ZLIB
Using ZLIB compression with UBIFS fails if last data node is not a size of UBIFS_BLOCK_SIZE (4096 bytes). Easiest way to test this is trying to read a file smaller than 4k: = ubifsload 4100 /etc/fstab Loading file '/etc/fstab' to addr 0x4100 with size 704 (0x02c0)... UBIFS error (pid 0): read_block: bad data node (block 0, inode 2506) UBIFS error (pid 0): do_readpage: cannot read page 0 of inode 2506, error -22 Error reading file '/etc/fstab' /etc/fstab not found! exit not allowed from main input shell. = With this patch: = ubifsload 4100 /etc/fstab Loading file '/etc/fstab' to addr 0x4100 with size 704 (0x02c0)... Done = Signed-off-by: Veli-Pekka Peltola veli-pekka.pelt...@bluegiga.com Cc: kmp...@infradead.org --- Changes for v2: use proper variable type fs/ubifs/ubifs.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index c68802b..d241774 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -37,8 +37,7 @@ DECLARE_GLOBAL_DATA_PTR; static int gzip_decompress(const unsigned char *in, size_t in_len, unsigned char *out, size_t *out_len) { - unsigned long len = in_len; - return zunzip(out, *out_len, (unsigned char *)in, len, 0, 0); + return zunzip(out, *out_len, (unsigned char *)in, (unsigned long *)out_len, 0, 0); } /* Fake description object for the none compressor */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] avr32: add atngw100mkii board
Around Tue 04 Sep 2012 23:33:29 +0200 or thereabout, andreas.de...@googlemail.com wrote: From: Andreas Bießmann andreas.de...@googlemail.com This patch is derived from an older patch provided by atmel in its buildroot-avr32-v3.0.0.tar.bz2 Many thanks for forward porting this. Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com cc: Hans-Christian Egtvedt egtv...@samfundet.no Acked-by: Hans-Christian Egtvedt egtv...@samfundet.no snipp diff -- mvh Hans-Christian Egtvedt ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/5] usb: ulpi: add indicator configuration function
Igor/Marek, -Original Message- From: Marek Vasut [mailto:ma...@denx.de] Sent: Wednesday, September 05, 2012 1:52 AM To: Igor Grinberg Cc: Lucas Stach; u-boot@lists.denx.de; Stephen Warren; Tom Warren Subject: Re: [PATCH v2 4/5] usb: ulpi: add indicator configuration function Dear Igor Grinberg, Hi Lucas, Tom, I'm sorry for the late reply. I understand, that Tom has already applied this to tegra/next, but as the changes/follow up patches are required, may be we can do this in another fashion... 1) Thanks for the patch and working on extending the generic framework! 2) This patch has no dependencies on tegra specific patches, so I think, it should go through Marex usb tree, but doing this will require the right merge order, so bisectability will not suffer. So, Marek, Tom, you should decide which way is fine with you both. I'm not sure how the USB and Tegra repos can coordinate on patches like this, since I don't pull from/rebase against USB, and AFAIK Marek doesn't reference Tegra when he updates his repo. I'm a sub-repo of ARM, which is a sub-repo of TOT (u-boot/master). What I usually do (and have always done) is to take the entire patchset that includes a Tegra component (USB, mmc, SPI, etc.) and hope (pray?) that anyone merging my changes upstream of me will be able to resolve the conflicts/pre-existing patches. So far, I haven't heard from anyone (Albert or Wolfgang) that's had a problem with that, perhaps because it's pretty rare. AFAICT, there's no other procedure outlined in the U-Boot wiki custodian's page. If there's a better procedure I should be following, let's get it documented and I'll be glad to hew to the line. I'm still on the learning curve for git merging, rebasing, etc. _ALWAYS_ CC the right custodians. That is, me. Seeing this patch bypassed me completely, I'm really unhappy. Tom, Yesterday, I was wondering if the patch was already applied, and I had no clue what's its status. Also, the patchwork says New. So, if it is not hard for you in the future, I'd like a short reply to the list, saying something like: Applied, thanks., like most custodians do. Thanks! +1 I _do_ owe the list, and the patch's author(s) an 'applied' message, as Igor points out. I've been viewing u-boot-tegra/next as just a staging area for patches that'll eventually go into master, and I've been copying patch authors and Tegra devs on pull requests, but I'll also send out a notice in the future when I apply a patch to /next. Thanks, Tom On 08/21/12 23:18, Lucas Stach wrote: Allows for easy configuration of the VBUS indicator related ULPI config bits. Also move the external indicator setup from ulpi_set_vbus() to the new function. Signed-off-by: Lucas Stach d...@lynxeye.de After the below comments are fixed: Acked-by: Igor Grinberg grinb...@compulab.co.il --- drivers/usb/ulpi/ulpi.c | 26 ++ include/usb/ulpi.h | 13 +++-- 2 Dateien geändert, 33 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-) diff --git a/drivers/usb/ulpi/ulpi.c b/drivers/usb/ulpi/ulpi.c index dde2585..f358bde 100644 --- a/drivers/usb/ulpi/ulpi.c +++ b/drivers/usb/ulpi/ulpi.c @@ -106,20 +106,38 @@ int ulpi_select_transceiver(struct ulpi_viewport *ulpi_vp, unsigned speed) return ulpi_write(ulpi_vp, ulpi-function_ctrl, val); } -int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int ext_power, - int ext_ind) +int ulpi_set_vbus(struct ulpi_viewport *ulpi_vp, int on, int +ext_power) { u32 flags = ULPI_OTG_DRVVBUS; u8 *reg = on ? ulpi-otg_ctrl_set : ulpi-otg_ctrl_clear; if (ext_power) flags |= ULPI_OTG_DRVVBUS_EXT; - if (ext_ind) - flags |= ULPI_OTG_EXTVBUSIND; return ulpi_write(ulpi_vp, reg, flags); } +int ulpi_set_vbus_indicator(struct ulpi_viewport *ulpi_vp, int external, + int passthu, int complement) +{ + u8 *reg; + int ret; + + reg = external ? ulpi-otg_ctrl_set : ulpi-otg_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_OTG_EXTVBUSIND))) + return ret; + + reg = passthu ? ulpi-iface_ctrl_set : ulpi-iface_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_PASSTHRU))) + return ret; + + reg = complement ? ulpi-iface_ctrl_set : ulpi-iface_ctrl_clear; + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_IFACE_EXTVBUS_COMPLEMENT))) + return ret; These are fine, two requests though: 1) As Tom already pointed in the private email: ERROR: do not use assignment in if condition #361: FILE: drivers/usb/ulpi/ulpi.c:127: + if ((ret = ulpi_write(ulpi_vp, reg, ULPI_OTG_EXTVBUSIND))) ERROR: do not use assignment in if condition #365: FILE: drivers/usb/ulpi/ulpi.c:131: + if ((ret = ulpi_write(ulpi_vp, reg,
Re: [U-Boot] [Patch V5 4/4] MIPS: add board qemu-mips64 support
2012/9/5 Zhi-zhou Zhang etou...@gmail.com: [...] why have you omitted this? #define CONFIG_BOOTCOMMAND bootp;bootelf #define CONFIG_CMD_ELF Because I haven't tested `bootelf' command. I'm not should it work or not. Another reason is that when I configure CONFIG_CMD_ELF I will get lots of warning such as: cmd_elf.c: In function 'load_elf_image_phdr': cmd_elf.c:289:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_elf.c: In function 'load_elf_image_shdr': cmd_elf.c:343:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_elf.c:346:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ok but there are similar warnings in other files too. We can fix those files later. My point is that all qemu_mips variants should be configured with the same options. [...] why have you omitted the flash support? qemu-system-mips supports flash emulation with the option -pflash. It already works with a qemu_mips32 U-boot. Yes, I have tested with -pflash in qemu_mips64 either. I have forgot why I omit it now. By the way, which commit should I base on of my next patch? it is still git://git.denx.de/u-boot-mips.git master -- Best regards, Daniel ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] ima3-mx53:Rename CONFIG_PRIME = CONFIG_ETHPRME, remove unused macro CONFIG_DISCOVER_PHY
From 2d37e7db8adc529ce00e09158710292c3beffe94 Mon Sep 17 00:00:00 2001 From: Ashok Kumar Reddy ashokkourla2...@gmail.com Date: Wed, 5 Sep 2012 22:09:37 +0530 Subject: [PATCH] ima3-mx53:Rename CONFIG_PRIME = CONFIG_ETHPRME, remove unused macro CONFIG_DISCOVER_PHY Signed-off-by: Ashok Kumar Reddy ashokkourla2...@gmail.com --- include/configs/ima3-mx53.h |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/configs/ima3-mx53.h b/include/configs/ima3-mx53.h index 567061a..dbc59b9 100644 --- a/include/configs/ima3-mx53.h +++ b/include/configs/ima3-mx53.h @@ -64,7 +64,6 @@ /* Ethernet on FEC */ #define CONFIG_NET_MULTI #define CONFIG_MII -#define CONFIG_DISCOVER_PHY #define CONFIG_FEC_MXC #define IMX_FEC_BASE FEC_BASE_ADDR @@ -72,7 +71,7 @@ #define CONFIG_PHY_ADDRCONFIG_FEC_MXC_PHYADDR #define CONFIG_RESET_PHY_R #define CONFIG_FEC_MXC_NO_ANEG -#define CONFIG_PRIME FEC0 +#define CONFIG_ETHPRIMEFEC0 /* SPI */ #define CONFIG_HARD_SPI -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4] kirkwood: add support for Iomega iConnect board
Add support for new board iConnect from Iomega. More information about the device can be found here: http://go.iomega.com/en/products/network-storage-desktop/wireless-data-station/network-hard-drive-iconnect/?partner=4735 Signed-off-by: Luka Perkov ub...@lukaperkov.net Tested-by: Wojciech Dubowik wojciech.dubo...@neratec.com Tested-by: Tim Fletcher t...@night-shade.org.uk --- Prafulla can you please take this one to your marvell branch? Changes from v3: * replace MPP12_GPIO with MPP12_GPO Changes from v2: * verify that kwbimage.cfg is unique * change CONFIG_IDENT_STRING * document kwmpp_config[] MPPs Changes from v1: * remove #ifdef CONFIG_CMD_IDE part from include/configs/iconnect.h (board does not have IDE ports) * add compression defines in include/configs/iconnect.h MAINTAINERS|1 + board/iomega/iconnect/Makefile | 43 ++ board/iomega/iconnect/iconnect.c | 107 +++ board/iomega/iconnect/iconnect.h | 39 + board/iomega/iconnect/kwbimage.cfg | 165 boards.cfg |1 + include/configs/iconnect.h | 129 7 files changed, 485 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4aabcff..cd637c2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -803,6 +803,7 @@ Veli-Pekka Peltola veli-pekka.pelt...@bluegiga.com Luka Perkov ub...@lukaperkov.net ib62x0 ARM926EJS + iconnectARM926EJS Dave Peverley dpever...@mpc-data.co.uk diff --git a/board/iomega/iconnect/Makefile b/board/iomega/iconnect/Makefile new file mode 100644 index 000..f77fcfb --- /dev/null +++ b/board/iomega/iconnect/Makefile @@ -0,0 +1,43 @@ +# +# (C) Copyright 2009 +# Marvell Semiconductor www.marvell.com +# Written-by: Prafulla Wadaskar prafu...@marvell.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := iconnect.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(call cmd_link_o_target, $(OBJS) $(SOBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/iomega/iconnect/iconnect.c b/board/iomega/iconnect/iconnect.c new file mode 100644 index 000..6ee2128 --- /dev/null +++ b/board/iomega/iconnect/iconnect.c @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2009-2012 + * Wojciech Dubowik wojciech.dubo...@neratec.com + * Luka Perkov ub...@lukaperkov.net + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +#include common.h +#include miiphy.h +#include asm/arch/cpu.h +#include asm/arch/kirkwood.h +#include asm/arch/mpp.h +#include iconnect.h + +DECLARE_GLOBAL_DATA_PTR; + +int board_early_init_f(void) +{ + /* +* default gpio configuration +* There are maximum 64 gpios controlled through 2 sets of registers +* the below configuration configures mainly initial LED status +*/ + kw_config_gpio(ICONNECT_OE_VAL_LOW, + ICONNECT_OE_VAL_HIGH, + ICONNECT_OE_LOW, ICONNECT_OE_HIGH); + + /* Multi-Purpose Pins Functionality configuration */ + u32 kwmpp_config[] = { + MPP0_NF_IO2, + MPP1_NF_IO3, + MPP2_NF_IO4, + MPP3_NF_IO5,
[U-Boot] [PATCH] kirkwood: fix mpp.h coding style
Signed-off-by: Luka Perkov ub...@lukaperkov.net --- arch/arm/include/asm/arch-kirkwood/mpp.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-kirkwood/mpp.h b/arch/arm/include/asm/arch-kirkwood/mpp.h index 8e50ee7..8ceea7b 100644 --- a/arch/arm/include/asm/arch-kirkwood/mpp.h +++ b/arch/arm/include/asm/arch-kirkwood/mpp.h @@ -85,7 +85,7 @@ #define MPP7_SPI_SCn MPP( 7, 0x2, 0, 1, 1, 1, 1, 1) #define MPP7_PTP_TRIG_GEN MPP( 7, 0x3, 0, 1, 1, 1, 1, 1) -#define MPP8_GPIO MPP( 8, 0x0, 1, 1, 1,1, 1, 1) +#define MPP8_GPIO MPP( 8, 0x0, 1, 1, 1, 1, 1, 1) #define MPP8_TW_SDAMPP( 8, 0x1, 1, 1, 1, 1, 1, 1) #define MPP8_UART0_RTS MPP( 8, 0x2, 0, 1, 1, 1, 1, 1) #define MPP8_UART1_RTS MPP( 8, 0x3, 0, 1, 1, 1, 1, 1) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] USB multi controller
On 09/05/2012 12:30 AM, Marek Vasut wrote: Dear Lucas Stach, Hi Stephen, Am Dienstag, den 04.09.2012, 17:05 -0600 schrieb Stephen Warren: On 08/30/2012 10:03 AM, Lucas Stach wrote: Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Patches are based on a Tegra tree with some relevant changes from u-boot-usb picked over, so they should apply to u-boot-usb/master. Can you explain what this series is based on in a little more detail? I tried applying it to Tegra's for-next today, and it wouldn't apply. I managed to apply using plain patch rather then git am, but then I get a bunch of compile errors:-( At the time I wrote those patches the u-boot-usb and u-boot-tegra trees didn't merge cleanly and I wasted quite some time trying to fix up the failed merge. In the end I ended up just picking the following over to my tegra tree, which should be enough to avoid any conflicts with the usb tree: cdeb916120a4 ehci: cosmetic: Define the number of qt_buffers 44ae0be7461f ehci: Fail for multi-transaction interrupt transfers 14eb79b7a086 ehci: cosmetic: Define used constants 5cec214ecd7d ehci-hcd: Boost transfer speed cffcc5035809 usb_storage: Restore non-EHCI support 4bee5c83ea46 usb_storage: Remove EHCI constraints 3e8581bb9589 usb_stor_BBB_transport: Do not delay when not required db19134615dd ehci: Optimize qTD allocations u-boot-usb master is updated to master and pushed for your enjoyment. The series doesn't appear to apply to u-boot-usb/master, nor to u-boot-tegra/master plus those cherry-picks listed above. Perhaps you can rebase on something (although I'm not sure which branch it's meant to go through) so I can apply/test it? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [v3] arm: Fixed the offset for the no relocation.
On 05/09/2012 16:45, Zhong Hongbo wrote: On 04/09/12 23:57, Stefano Babic wrote: On 04/09/2012 16:03, Zhong Hongbo wrote: On 03/09/12 08:14, Marek Vasut wrote: Dear Zhong Hongbo, From: Zhong Hongbo bocui...@gmail.com When the u-boot address of destination equal to __start, no relocation. relocation offset(r9) = 0. Good, now what kind of issue does this patch fix? Hi Marek When you adopt CONFIG_SPL_BUILD framework, no CONFIG_NAND_SPL, if the addr of destination is equal to _start, we should skip u-boot relocation. In the last, u-boot will count the dest addr, see the below: adr r1, _start add lr, r0, r1 add lr, lr, r9 Here, lr = lr + r9, r9 is the offset of u-boot, So when it do not neet to reolocat, we need to set the zero value for r9 register. /* setup parameters for board_init_r */ mov r0, r5 /* gd_t */ mov r1, r6 /* dest_addr */ /* jump to it ... */ mov pc, lr I can confirm this issue - I see this when I ported SPL to a MX35 board. However, clearing r9 was not enough. I had to fix also _rel_dyn_* to make SPL working, and I did changing the start.S in the same way start.S for arv7 is built. Do you not have these issues ? Hi Stefano, That is enough for my smdk6400 board. Ok, thanks. Then I will post a patch on top of yours, but here my: Tested-by: Stefano Babic sba...@denx.de Tested on a i.MX35 board (ARM1136) with SPL. Regards, Stefano -- = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] USB multi controller
Dear Stephen Warren, On 09/05/2012 12:30 AM, Marek Vasut wrote: Dear Lucas Stach, Hi Stephen, Am Dienstag, den 04.09.2012, 17:05 -0600 schrieb Stephen Warren: On 08/30/2012 10:03 AM, Lucas Stach wrote: Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Patches are based on a Tegra tree with some relevant changes from u-boot-usb picked over, so they should apply to u-boot-usb/master. Can you explain what this series is based on in a little more detail? I tried applying it to Tegra's for-next today, and it wouldn't apply. I managed to apply using plain patch rather then git am, but then I get a bunch of compile errors:-( At the time I wrote those patches the u-boot-usb and u-boot-tegra trees didn't merge cleanly and I wasted quite some time trying to fix up the failed merge. In the end I ended up just picking the following over to my tegra tree, which should be enough to avoid any conflicts with the usb tree: cdeb916120a4 ehci: cosmetic: Define the number of qt_buffers 44ae0be7461f ehci: Fail for multi-transaction interrupt transfers 14eb79b7a086 ehci: cosmetic: Define used constants 5cec214ecd7d ehci-hcd: Boost transfer speed cffcc5035809 usb_storage: Restore non-EHCI support 4bee5c83ea46 usb_storage: Remove EHCI constraints 3e8581bb9589 usb_stor_BBB_transport: Do not delay when not required db19134615dd ehci: Optimize qTD allocations u-boot-usb master is updated to master and pushed for your enjoyment. The series doesn't appear to apply to u-boot-usb/master, nor to u-boot-tegra/master plus those cherry-picks listed above. Perhaps you can rebase on something (although I'm not sure which branch it's meant to go through) so I can apply/test it? I'd say reorder 3/4 and 4/4 (swap them) and then repost the rebased result. I'll pick it all. That leads me to a question, why is the tegra usb driver goo still in arch/arm/ and not in drivers/ as it should be? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/6] gpt:doc: GPT (GUID Partition Table) documentation
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: Documentation of the GPT table format. +++ b/doc/README.gpt +Glossary: + +- UUID -(Universally Unique Identifier) +- GUID - (Globally Unique ID) +- EFI - (Extensible Firmware Interface) +- UEFI - (Unified EFI) - EFI evolution +- GPT (GUID Page Table) - it is the EFI standard part GUID Partition Table, not Page. +- partitions - lists of availavle partitions (defined at u-boot): + ./include/configs/{target}.h + +Introduction: += +This document describes the GPT partition table format when used with u-boot. + + +UUID introduction[5]: + What is [5]? +For instance, GUID of Linux data partition: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 +For u-boot GPT hyphens are omitted. I don't think U-Boot should omit any of the hyphens; it makes the UUIDs far more readable, and the strings can then be cut/paste to/from other applications that use/print UUIDs, without any manual conversion. +Historically there are 5 methods to generate this number. The oldest one is +combining machine's MAC address and timer (epoch) value. + +Successive versions are using MD5 hash, random numbers and SHA-1 hash. All major +OSes and programming languages are providing libraries to compute UUID. + +However it costs in terms of the computational power and memory footprint. +Therefore u-boot uses the crc32 with reading random block (512B) from MMC +storage device to generate UUID/GUID. That doesn't seem particularly relevant to general documentation about GPT; it's an implementation detail of the GPT creation command in a later patch, and could easily be changed. In fact, I wonder why not require the user to concoct UUIDs and pass them to your GPT creation command, rather than forming them using some non-standard process. +GUID brief explanation: Not GUID, but GPT. +== + + Layout: + --- + + -- + LBA 0 |Protective MBR | + -- + LBA 1 |Primary GPT Header | Primary + -- GPT + LBA 2 |Entry 1|Entry 2| Entry 3| Entry 4| + -- + LBA 3 |Entries 5 - 128 | +| | +| | + --- + LBA 34 |Partition 1 | The indentation looks inconsistent in this diagram +| | +--- +|Partition 2 | +| | +--- +|Partition n | +| | + --- + LBA -34 |Entry 1|Entry 2| Entry 3| Entry 4| Secondary + --- (bkp) + LBA 34 |Partition 1 | +| | +--- +|Partition 2 | +| | +--- +|Partition n | +| | That part of the diagram appears duplicated. + --- + LBA -34 |Entry 1|Entry 2| Entry 3| Entry 4| Secondary + --- (bkp) + LBA -33 |Entries 5 - 128 | GPT +| | +| | + LBA -2 | | + --- + LBA -1 |Secondary GPT Header | + --- + +Attribute flags (Don't used at u-boot): I wouldn't write Don't used at u-boot since that's potentially subject to change. For example, I'm expecting to send a patch to use the Legacy BIOS bootable attribute soon. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/6] gpt: Replace the leXX_to_int() calls with ones defined at compiler.h
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: Custom definitions of le_XX_to_int functions have been replaced with standard ones, defined at compiler.h Signed-off-by: Chang Hyun Park chchch.p...@samsung.com Signed-off-by: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Did Chang Hyun Park write this? If so, shouldn't git have generated a From header for him, to reflect his authorship upstream. I'm not sure how Kyungmin Park's S-o-b plays into this, since he's not sending the patch. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/6] gpt: Replacement of GPT structures members with ones indicating endianness and size
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: Replacement of several GPT related structures members with ones indicating its endianness and proper size. This patch seems reasonable to me, but I'm surprised it doesn't require /any/ changes to the code that uses these structures in order to avoid warnings/errors. Is git bisect maintained by this series? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/6] gpt: Replace the leXX_to_int() calls with ones defined at compiler.h
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: Custom definitions of le_XX_to_int functions have been replaced with standard ones, defined at compiler.h diff --git a/disk/part_efi.c b/disk/part_efi.c -/* Convert char[8] in little endian format to the host format integer - */ -static inline unsigned long long le64_to_int(unsigned char *le64) -{ So this original function takes a pointer to the value ... /* Check the first_usable_lba and last_usable_lba are within the disk. */ lastlba = (unsigned long long)dev_desc-lba; - if (le64_to_int(pgpt_head-first_usable_lba) lastlba) { + if (le64_to_cpu(pgpt_head-first_usable_lba) lastlba) { At this point in the series, first_usable_lba is a char[8], so this is passing the address of the first byte to both the original function le64_to_int(), and the replacement function le64_to_cpu(). However, le64_to_cpu() expects to receive the 64-bit value to swap, not a pointer to it - from compiler.h: #define _uswap_64(x, sfx) \ x) 0xff00##sfx) 56) | \ ... # define uswap_64(x) _uswap_64(x, ull) le: # define le64_to_cpu(x) (x) be: # define le64_to_cpu(x) uswap_64(x) So I think this patch breaks the code, and then the next patch fixes it, since it changes the type of first_usable_lba from char[8] to __le64? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] gpt: Support for GPT (GUID Partition Table) restoration
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: The restoration of GPT table (both primary and secondary) is now possible. Simple GUID generation is supported. diff --git a/include/part.h b/include/part.h +int set_gpt_table(block_dev_desc_t *dev_desc, +int parts, unsigned int *blocks, char *name[]); That interface seems very limiting; what if you want to select specific type UUIDs, set the partition attributes, leave gaps between the partitions, have the physical order of partitions (their block numbers) be different to the partition table ordering, etc. I wonder if it wouldn't be better to take an array of structures here, and have each entry define all the properties of the partition. That would allow fields to be added to the structure to describe more information as we add more functionality. I didn't review the implementation. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request for u-boot-marvell.git
On Mon, Sep 03, 2012 at 02:20:19AM -0700, Prafulla Wadaskar wrote: Dear Albert, Please pull The following changes since commit 6e2fbdea1b26d75314d87c380a36b0015bf824cf: Wolfgang Denk (1): Merge branch 'ag...@denx.de' of git://git.denx.de/u-boot-staging Hi Prafulla, Do you have some news about the board patches I sent you in early June ? Here are the patchwork urls: http://patchwork.ozlabs.org/patch/163192/ http://patchwork.ozlabs.org/patch/163193/ http://patchwork.ozlabs.org/patch/163195/ http://patchwork.ozlabs.org/patch/163194/ Thanks in advance. Simon signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] gpt: Support for new gpt command
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: New command - gpt is now supported. It shows and restores the GPT partition table. It looks into the partitions environment variable for partitions definition. It can be enabled at target configuration file with CONFIG_CMD_GPT. diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c +int set_gpt_info(block_dev_desc_t *dev_desc) +{ + char *ps[GPT_PARTS_NUM], *name[GPT_PARTS_NUM]; + unsigned int size[GPT_PARTS_NUM]; + char *tok, *t, *p, *s, *ss; + int i, ret; + + s = getenv(partitions); + if (s == NULL) { + printf(%s: \partitions\ env variable not defined!\n, +__func__); + return -1; + } It'd be nice to be able to pass the partition definition on the command-line instead of (or perhaps as an alternative to) reading an environment variable. Some documentation of the expected format of the partitions variable would be useful. From the following patch, the format appears to be: 8M(csa-mmc),60M(u-boot),60M(kernel),... That's not particularly extensible (think about allowing partition type UUID to or attributes to be specified), and the brackets are a bit painful. Can we use key/value for defining the values, and have a simple separate separator between fields and partitions, e.g. something like: size=8M,name=csa-mmc;size=60M,name=u-boot;size=60M,name=kernel;... That would allow us to very easily allow new fields to be specified per partition in the future, e.g.: uuid=X,size=512M,name=boot,type=21686148-6449-6E6F-744E-656564454649,attrs=2;uuid=Y,size=7000M,name=root,type=0FC63DAF-8483-4772-8E79-3D69D8477DE4,attrs=0;... +U_BOOT_CMD( + gpt,CONFIG_SYS_MAXARGS, 1, do_gpt, + GUID Partition Table, ... + gpt restore - reset GPT partition to defaults\n + gpt dev #num - set device number\n ... +static void set_gpt_dev(int dev) +{ + gpt_dev = dev; +} + Hmmm. I think it'd be better to specify the device each time the gpt command was invoked. That would be simpler to use, more flexible, and more consistent with how other commands such as ext2load operate. In other words, I would get rid of gpt dev completely, and instead of implementing gpt restore, implement gpt restore mmc 0. I'm not sure restore is the correct name, given that the command can write arbitrary new partition layouts, rather than just restoring some specific hard-coded table from e.g. a backup image. I'm not sure that gpt is even the best command name; it'd be nice if this were generic and could be extended to work with e.g. FAT in the future - something like: part write usb 1 gpt uuid=X,size=512M,name=boot,... part write mmc 0 fat size=512M,attrs=0x80;... +U_BOOT_CMD( + gpt,CONFIG_SYS_MAXARGS, 1, do_gpt, + GUID Partition Table, + show - show GPT\n s/show/gpt show/ +static void gpt_show(void) +{ + struct mmc *mmc = find_mmc_device(gpt_dev); + + print_part_efi(mmc-block_dev); +} Do we really need another way of showing partition tables; mmc part, usb part, ... already exist. I think if we want another way, it'd be better to add this functionality to my proposed part command, i.e. part show mmc 0. +static int gpt_default(void) +{ + struct mmc *mmc = find_mmc_device(gpt_dev); + + if (mmc == NULL) { + printf(%s: mmc dev %d NOT available\n, __func__, gpt_dev); + return CMD_RET_FAILURE; + } Why only allow mmc devices; what about USB for example? Other commands such as ext2load allow arbitrary device types to be used. Rob Herring recently posted some patches to unify how commands such as ext2load, ext2ls, fatload, fatls, ... all obtain a device/partition handle from their command-line - this patch should probably build on top of those patches. + puts(Using default GPT UUID\n); + + return set_gpt_info(mmc-block_dev); +} ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] MX: set a common place to share code for Freescale i.MX
On 9/5/2012 12:00 AM, Stefano Babic wrote: Up now only MX5 and MX6 can share code, because they have a common source directory in cpu/armv7. Other not armv7 i.MX can profit of the same shared code. Move these files into a directory accessible for all, similar to plat-mxc in linux. Signed-off-by: Stefano Babic sba...@denx.de --- Changes in v2: - Use the common path for all i.MX SOCs in Makefile Makefile|7 ++- arch/arm/{cpu/armv7 = }/imx-common/Makefile|2 ++ arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c |0 arch/arm/{cpu/armv7 = }/imx-common/cpu.c |0 arch/arm/{cpu/armv7 = }/imx-common/i2c.c |0 arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c |0 arch/arm/{cpu/armv7 = }/imx-common/speed.c |0 arch/arm/{cpu/armv7 = }/imx-common/timer.c |0 8 files changed, 4 insertions(+), 5 deletions(-) rename arch/arm/{cpu/armv7 = }/imx-common/Makefile (97%) rename arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/cpu.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/i2c.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/speed.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/timer.c (100%) diff --git a/Makefile b/Makefile index d27bb17..0826055 100644 --- a/Makefile +++ b/Makefile @@ -305,11 +305,8 @@ ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o endif -ifeq ($(SOC),mx5) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o -endif -ifeq ($(SOC),mx6) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o endif ifeq ($(SOC),s5pc1xx) diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/imx-common/Makefile similarity index 97% rename from arch/arm/cpu/armv7/imx-common/Makefile rename to arch/arm/imx-common/Makefile index 16fba8d..453f822 100644 --- a/arch/arm/cpu/armv7/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -27,8 +27,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libimx-common.o +ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) COBJS-y = iomux-v3.o timer.o cpu.o speed.o COBJS-$(CONFIG_I2C_MXC) += i2c.o shouldn't the endif be a line higher??? mx25_3stack.h:#define CONFIG_I2C_MXC1 +endif COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o COBJS := $(sort $(COBJS-y)) diff --git a/arch/arm/cpu/armv7/imx-common/cmd_bmode.c b/arch/arm/imx-common/cmd_bmode.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cmd_bmode.c rename to arch/arm/imx-common/cmd_bmode.c diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/imx-common/cpu.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cpu.c rename to arch/arm/imx-common/cpu.c diff --git a/arch/arm/cpu/armv7/imx-common/i2c.c b/arch/arm/imx-common/i2c.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/i2c.c rename to arch/arm/imx-common/i2c.c diff --git a/arch/arm/cpu/armv7/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/iomux-v3.c rename to arch/arm/imx-common/iomux-v3.c diff --git a/arch/arm/cpu/armv7/imx-common/speed.c b/arch/arm/imx-common/speed.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/speed.c rename to arch/arm/imx-common/speed.c diff --git a/arch/arm/cpu/armv7/imx-common/timer.c b/arch/arm/imx-common/timer.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/timer.c rename to arch/arm/imx-common/timer.c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] MX: set a common place to share code for Freescale i.MX
On 9/5/2012 1:10 PM, Troy Kisky wrote: On 9/5/2012 12:00 AM, Stefano Babic wrote: Up now only MX5 and MX6 can share code, because they have a common source directory in cpu/armv7. Other not armv7 i.MX can profit of the same shared code. Move these files into a directory accessible for all, similar to plat-mxc in linux. Signed-off-by: Stefano Babic sba...@denx.de --- Changes in v2: - Use the common path for all i.MX SOCs in Makefile Makefile|7 ++- arch/arm/{cpu/armv7 = }/imx-common/Makefile|2 ++ arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c |0 arch/arm/{cpu/armv7 = }/imx-common/cpu.c |0 arch/arm/{cpu/armv7 = }/imx-common/i2c.c |0 arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c |0 arch/arm/{cpu/armv7 = }/imx-common/speed.c |0 arch/arm/{cpu/armv7 = }/imx-common/timer.c |0 8 files changed, 4 insertions(+), 5 deletions(-) rename arch/arm/{cpu/armv7 = }/imx-common/Makefile (97%) rename arch/arm/{cpu/armv7 = }/imx-common/cmd_bmode.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/cpu.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/i2c.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/iomux-v3.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/speed.c (100%) rename arch/arm/{cpu/armv7 = }/imx-common/timer.c (100%) diff --git a/Makefile b/Makefile index d27bb17..0826055 100644 --- a/Makefile +++ b/Makefile @@ -305,11 +305,8 @@ ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) LIBS-y += $(CPUDIR)/omap-common/libomap-common.o endif -ifeq ($(SOC),mx5) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o -endif -ifeq ($(SOC),mx6) -LIBS-y += $(CPUDIR)/imx-common/libimx-common.o +ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx31 mx35)) +LIBS-y += arch/$(ARCH)/imx-common/libimx-common.o endif ifeq ($(SOC),s5pc1xx) diff --git a/arch/arm/cpu/armv7/imx-common/Makefile b/arch/arm/imx-common/Makefile similarity index 97% rename from arch/arm/cpu/armv7/imx-common/Makefile rename to arch/arm/imx-common/Makefile index 16fba8d..453f822 100644 --- a/arch/arm/cpu/armv7/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -27,8 +27,10 @@ include $(TOPDIR)/config.mk LIB = $(obj)libimx-common.o +ifeq ($(SOC),$(filter $(SOC),mx5 mx6)) COBJS-y= iomux-v3.o timer.o cpu.o speed.o COBJS-$(CONFIG_I2C_MXC) += i2c.o shouldn't the endif be a line higher??? mx25_3stack.h:#define CONFIG_I2C_MXC1 No, I guess your right Sorry for the noise. +endif COBJS-$(CONFIG_CMD_BMODE) += cmd_bmode.o COBJS:= $(sort $(COBJS-y)) diff --git a/arch/arm/cpu/armv7/imx-common/cmd_bmode.c b/arch/arm/imx-common/cmd_bmode.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cmd_bmode.c rename to arch/arm/imx-common/cmd_bmode.c diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/imx-common/cpu.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/cpu.c rename to arch/arm/imx-common/cpu.c diff --git a/arch/arm/cpu/armv7/imx-common/i2c.c b/arch/arm/imx-common/i2c.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/i2c.c rename to arch/arm/imx-common/i2c.c diff --git a/arch/arm/cpu/armv7/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/iomux-v3.c rename to arch/arm/imx-common/iomux-v3.c diff --git a/arch/arm/cpu/armv7/imx-common/speed.c b/arch/arm/imx-common/speed.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/speed.c rename to arch/arm/imx-common/speed.c diff --git a/arch/arm/cpu/armv7/imx-common/timer.c b/arch/arm/imx-common/timer.c similarity index 100% rename from arch/arm/cpu/armv7/imx-common/timer.c rename to arch/arm/imx-common/timer.c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] gpt: Support for GPT (GUID Partition Table) restoration
On 08/24/2012 02:13 AM, Lukasz Majewski wrote: The restoration of GPT table (both primary and secondary) is now possible. Simple GUID generation is supported. +/** + * guid_gen(): Generate UUID + * + * @param dev_desc - block device descriptor + * + * @return - generated UUID table + * + * NOTE: The entrophy of this function is small + */ +static u8 *guid_gen(block_dev_desc_t * dev_desc) +{ + int k = 0; + static int i = 1; + static u8 __aligned(CONFIG_SYS_CACHELINE_SIZE) guid[16]; Hmmm. Wouldn't it be better to take a pointer to the GUID as a parameter rather than returning a pointer to the same static over and over again. That way, the caller won't cause problems if they call this function 4 times, and cache the pointer each time. + static u8 __aligned(CONFIG_SYS_CACHELINE_SIZE) ent_pool[512]; + u32 *ptr = (u32 *) guid; + + /* Entrophy initialization - read random content of one SD sector */ + if (i == 1) { + debug(Init entropy:%x\n, (u32)(dev_desc-lba 14)); + + if (dev_desc-block_read(dev_desc-dev, (dev_desc-lba 14), + 1, (u32 *) ent_pool) != 1) { I imagine you might get more entropy out of just reading sector 0, or 1 (or both) than some random sector in the middle of the disk, which quite possibly won't ever have been written to. Is there any particular reason why 14 rather than any other shift? + printf(** Can't read from device %d **\n, +dev_desc-dev); + } + } + + for (k = 0; k 4; k++) { + *(ptr + k) = efi_crc32((const void *) ent_pool, +sizeof(ent_pool)); + ent_pool[511 - k] = *(ptr + k); + } + + ent_pool[0] = ((u8) i) 0xff; That doesn't quite implement a fully compliant UUID. According to: http://en.wikipedia.org/wiki/Universally_unique_identifier the variant (UUID) and version (4; random) should be encoded into a few specific bits of the final UUID value. + debug(GUID: ); + for (k = 0; k sizeof(guid); k++) + debug( %x , guid[k]); I think inventing (stealing from Linux) a proper UUID formatting function would be useful; that way it could be shared by print_part_efi() if that function was ever enhanced to print the partition UUID and partition type UUID. + debug( i:%d,\n, i); + + i++; + return guid; +} ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] gpt: GUID/UUID - GPT restoration - open questions
On 08/24/2012 02:48 AM, Lukasz Majewski wrote: Hi Stephen, I'm writing to you, since I've posted a patch series regarding GPT support for Samsung Trats board (you were on the CC). e.g. http://patchwork.ozlabs.org/patch/179785/ I think, that we can cooperate to provide better EFI/GPT support. In mine implementation the gpt command (with several sub commands) has been proposed - we can discuss if this is a correct way to go. Moreover, at this patch series a weak GUID generator is implemented. For now it is good enough, since I consider the restoration as an emergency situation. I think that (perhaps optionally) allowing the user to specify their own UUIDs would be a good idea; whatever was generating the script being executed might have access to a better entropy source. However,I wonder how can we provide better GUID (and in general random numbers pool) generator for u-boot. Maybe md5sum command can be used with some running clock (WDT, or system clock from u-boot start up) data to provide better entropy? If there's a standard way of retrieving wall-clock, MAC address, ... it'd definitely be a good idea to include those entropy sources. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
On Wednesday 05 of September 2012 14:48:40 Marek Vasut wrote: Dear Pavel Herrmann, [...] besides, I think it'd be much systematic to just scream at user to call sata rescan and bail out instead of doing it for him. i dont actually need a sata rescan, i just need to make sure i have dynamically allocated names Sorry, I can't parse this ... but ... , so i can safely call free() later, otherwise this segfaults when called before sata scan The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is performed. So if you call free() on null pointer, nothing happens. Where's the real problem? if you called sata init before setting all the loops you would get to open(NULL) and a strlen(NULL). i think its easier to supply valid empty string then check for NULL at every access. Make this info part mandatory. Than you can cut the whole argc loop into simple if argc != 2 ; then fail . And do simple checking for the first letter of the argument being either i or d . wont help, still need argc 3 or 4 Makes is simpler, you can bail out if it's not 3 or 4 still, i should have a sata_loop info work on all files, so theres a valid command with argc 2 + sata_loop load devnum file - load file from host FS into loop devnum sata_loop is redundant above. really? how do you figure? Run help sata_loop and see the result ... =help sata_loop sata_loop - SATA loopback Usage: sata_loop [info] devnum - show info about loop devnum sata_loop load devnum file - load file from host FS into loop devnum i dont see your problem Pavel Herrmann ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Please pull u-boot-ti/master
Hi Tom, On Tue, 4 Sep 2012 17:41:23 -0700, Tom Rini tr...@ti.com wrote: Hello, The following changes since commit e62b008fe341030f4a80a09b66952bba65027b70: integrator: break out common config (2012-09-04 08:51:13 -0700) are available in the git repository at: git://git.denx.de/u-boot-ti.git master for you to fetch changes up to 14dace70580df099deb9cdce8f9cfb16a31e9d1b: am33xx: Remove redundant timer config (2012-09-04 17:05:39 -0700) Arnout Vandecappelle (Essensium/Mind) (1): OMAP3: add definition of CTRL_WKUP_CTRL register Stefano Babic (9): OMAP3: tam3517: add function to read MAC from EEPROM OMAP3: twister : get MAC address from EEPROM OMAP3: mt_ventoux: Correct board pinmux OMAP3: mt_ventoux: activate GPIO4 OMAP3: mt_ventoux: read MAC address from EEPROM OMAP3: mt_ventoux: disable the buzzer at start-up video: drop duplicate set of DISPC_CONFIG register OMAP3: video: add macros to set display parameters OMAP3: mt_ventoux: added video support Tom Rini (1): am33xx: Remove redundant timer config arch/arm/cpu/armv7/am33xx/board.c | 20 -- arch/arm/include/asm/arch-omap3/dss.h | 11 +++- arch/arm/include/asm/arch-omap3/mux.h |5 ++ board/technexion/twister/twister.c| 10 +++ board/teejet/mt_ventoux/mt_ventoux.c | 113 + board/teejet/mt_ventoux/mt_ventoux.h | 80 ++- drivers/video/omap3_dss.c |3 +- include/configs/mt_ventoux.h | 17 + include/configs/tam3517-common.h | 66 +++ 9 files changed, 256 insertions(+), 69 deletions(-) A MAKEALL -a arm looks fine here. Applied to u-boot-arm/master, thanks! Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/4] USB multi controller
Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Tom, Stephen, can I get an ACK from you for this, so Marek can take this through his USB tree? All patches now rebased onto u-boot-usb/master. Patch 3 also includes some cosmetic changes, to make the output of the usb commands more readable. On my Colibri T20, with a total of 3 usb controllers of which 2 are enabled in the device tree, output now looks like this: Tegra20 (Colibri) # usb start (Re)start USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found USB1: USB EHCI 1.00 scanning bus 1 for devices... 2 USB Device(s) found USB2: lowlevel init failed scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 1 Ethernet Device(s) found Tegra20 (Colibri) # usb tree USB device tree: 1 Hub (480 Mb/s, 0mA) | u-boot EHCI Host Controller | +-2 Mass Storage (480 Mb/s, 200mA) SanDisk U3 Titanium 2845221DC342AE8F 3 Hub (480 Mb/s, 0mA) | u-boot EHCI Host Controller | +-4 Vendor specific (480 Mb/s, 4mA) ASIX Elec. Corp. AX88772B 01 Lucas Stach (4): usb: lowlevel interface change to support multiple controllers usb: ehci: rework to take advantage of new lowlevel interface usb: add support for multiple usb controllers tegra20: port to new ehci interface arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c | 4 +- arch/arm/cpu/armv7/tegra20/usb.c | 15 +--- arch/arm/include/asm/arch-tegra20/usb.h | 4 +- arch/arm/include/asm/ehci-omap.h | 10 ++- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 4 +- arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 4 +- arch/powerpc/cpu/ppc4xx/usb_ohci.c| 4 +- arch/sparc/cpu/leon3/usb_uhci.c | 4 +- arch/sparc/lib/bootm.c| 2 +- board/htkw/mcx/mcx.c | 6 +- board/mpl/common/usb_uhci.c | 4 +- board/technexion/twister/twister.c| 6 +- board/teejet/mt_ventoux/mt_ventoux.c | 6 +- board/ti/beagle/beagle.c | 6 +- board/ti/panda/panda.c| 6 +- common/cmd_usb.c | 16 +++- common/usb.c | 108 +++--- common/usb_hub.c | 2 +- common/usb_storage.c | 2 +- drivers/usb/eth/usb_ether.c | 2 +- drivers/usb/host/ehci-armada100.c | 15 ++-- drivers/usb/host/ehci-atmel.c | 11 ++- drivers/usb/host/ehci-core.h | 29 -- drivers/usb/host/ehci-exynos.c| 15 ++-- drivers/usb/host/ehci-fsl.c | 11 ++- drivers/usb/host/ehci-hcd.c | 124 ++ drivers/usb/host/ehci-ixp4xx.c| 15 ++-- drivers/usb/host/ehci-marvell.c | 15 ++-- drivers/usb/host/ehci-mpc512x.c | 25 ++ drivers/usb/host/ehci-mx5.c | 11 ++- drivers/usb/host/ehci-mx6.c | 11 ++- drivers/usb/host/ehci-mxc.c | 11 ++- drivers/usb/host/ehci-mxs.c | 28 +++--- drivers/usb/host/ehci-omap.c | 10 ++- drivers/usb/host/ehci-pci.c | 15 ++-- drivers/usb/host/ehci-ppc4xx.c| 11 ++- drivers/usb/host/ehci-tegra.c | 14 ++- drivers/usb/host/ehci-vct.c | 9 +- drivers/usb/host/ehci.h | 4 +- drivers/usb/host/isp116x-hcd.c| 4 +- drivers/usb/host/ohci-hcd.c | 4 +- drivers/usb/host/r8a66597-hcd.c | 4 +- drivers/usb/host/sl811-hcd.c | 4 +- drivers/usb/musb/musb_hcd.c | 4 +- include/usb.h | 10 ++- include/usb/mv_udc.h | 2 +- 46 Dateien geändert, 311 Zeilen hinzugefügt(+), 320 Zeilen entfernt(-) delete mode 100644 drivers/usb/host/ehci-core.h -- 1.7.11.4
[U-Boot] [PATCH v2 2/4] usb: ehci: rework to take advantage of new lowlevel interface
Kill off ehci-core.h It was used to specify some static controller data. To support more than one controller being active at any time we have to carry the controller data ourselfes. Change the ehci interface accordingly. NOTE: OMAP implemented the ehci stuff a bit backwards and should be fixed to do the same thing as other platforms. But the change for now is at least compile clean. Signed-off-by: Lucas Stach d...@lynxeye.de Reviewed-by: Marek Vasut ma...@denx.de --- arch/arm/include/asm/ehci-omap.h | 10 ++- board/htkw/mcx/mcx.c | 6 +- board/technexion/twister/twister.c | 6 +- board/teejet/mt_ventoux/mt_ventoux.c | 6 +- board/ti/beagle/beagle.c | 6 +- board/ti/panda/panda.c | 6 +- drivers/usb/host/ehci-armada100.c| 15 ++--- drivers/usb/host/ehci-atmel.c| 11 ++-- drivers/usb/host/ehci-core.h | 29 - drivers/usb/host/ehci-exynos.c | 15 ++--- drivers/usb/host/ehci-fsl.c | 11 ++-- drivers/usb/host/ehci-hcd.c | 120 +++ drivers/usb/host/ehci-ixp4xx.c | 15 ++--- drivers/usb/host/ehci-marvell.c | 15 ++--- drivers/usb/host/ehci-mpc512x.c | 25 +++- drivers/usb/host/ehci-mx5.c | 11 ++-- drivers/usb/host/ehci-mx6.c | 11 ++-- drivers/usb/host/ehci-mxc.c | 11 ++-- drivers/usb/host/ehci-mxs.c | 28 drivers/usb/host/ehci-omap.c | 10 +-- drivers/usb/host/ehci-pci.c | 15 ++--- drivers/usb/host/ehci-ppc4xx.c | 11 ++-- drivers/usb/host/ehci-tegra.c| 9 ++- drivers/usb/host/ehci-vct.c | 9 ++- drivers/usb/host/ehci.h | 4 +- 25 Dateien geändert, 197 Zeilen hinzugefügt(+), 218 Zeilen entfernt(-) delete mode 100644 drivers/usb/host/ehci-core.h diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h index e72c5df..77e8170 100644 --- a/arch/arm/include/asm/ehci-omap.h +++ b/arch/arm/include/asm/ehci-omap.h @@ -136,7 +136,15 @@ struct omap_ehci { u32 insreg08; /* 0xb0 */ }; -int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata); +/* + * FIXME: forward declaration of this structs needed because omap got the + * ehci implementation backwards. move out ehci_hcd_x from board files + */ +struct ehci_hccr; +struct ehci_hcor; + +int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata, + struct ehci_hccr **hccr, struct ehci_hcor **hcor); int omap_ehci_hcd_stop(void); #endif /* _OMAP_COMMON_EHCI_H_ */ diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c index 454ff0a..7c9d34a 100644 --- a/board/htkw/mcx/mcx.c +++ b/board/htkw/mcx/mcx.c @@ -46,12 +46,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor); } -int ehci_hcd_stop(void) +int ehci_hcd_stop(int index) { return omap_ehci_hcd_stop(); } diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c index c2b10ac..69b1cc2 100644 --- a/board/technexion/twister/twister.c +++ b/board/technexion/twister/twister.c @@ -67,12 +67,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor); } -int ehci_hcd_stop(void) +int ehci_hcd_stop(int index) { return omap_ehci_hcd_stop(); } diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c index 9fbaedd..7bbd536 100644 --- a/board/teejet/mt_ventoux/mt_ventoux.c +++ b/board/teejet/mt_ventoux/mt_ventoux.c @@ -67,12 +67,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor); } -int ehci_hcd_stop(void) +int ehci_hcd_stop(int index) { return omap_ehci_hcd_stop(); } diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 99f833f..59b9924 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -502,12 +502,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor);
[U-Boot] [PATCH v2 3/4] usb: add support for multiple usb controllers
Allows to initialize more than one USB controller at once. v2: print message when controller stop fails Signed-off-by: Lucas Stach d...@lynxeye.de Reviewed-by: Marek Vasut ma...@denx.de --- common/cmd_usb.c| 16 +-- common/usb.c| 106 +++- common/usb_storage.c| 2 +- drivers/usb/eth/usb_ether.c | 2 +- 4 Dateien geändert, 70 Zeilen hinzugefügt(+), 56 Zeilen entfernt(-) diff --git a/common/cmd_usb.c b/common/cmd_usb.c index a8e3ae5..6cefc0c 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -517,8 +517,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) bootstage_mark_name(BOOTSTAGE_ID_USB_START, usb_start); usb_stop(); printf((Re)start USB...\n); - i = usb_init(); - if (i = 0) { + if (usb_init() = 0) { #ifdef CONFIG_USB_STORAGE /* try to recognize storage devices immediately */ usb_stor_curr_dev = usb_stor_scan(1); @@ -527,6 +526,9 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* try to recognize ethernet devices immediately */ usb_ether_curr_dev = usb_host_eth_scan(1); #endif +#ifdef CONFIG_USB_KEYBOARD + drv_usb_kbd_init(); +#endif } return 0; } @@ -553,8 +555,14 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; } if (strncmp(argv[1], tree, 4) == 0) { - printf(\nDevice Tree:\n); - usb_show_tree(usb_get_dev_index(0)); + puts(USB device tree:\n); + for (i = 0; i USB_MAX_DEVICE; i++) { + dev = usb_get_dev_index(i); + if (dev == NULL) + break; + if (dev-parent == NULL) + usb_show_tree(dev); + } return 0; } if (strncmp(argv[1], inf, 3) == 0) { diff --git a/common/usb.c b/common/usb.c index e58b6f4..1c9763c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -72,45 +72,72 @@ static struct usb_device usb_dev[USB_MAX_DEVICE]; static int dev_index; -static int running; static int asynch_allowed; char usb_started; /* flag for the started/stopped USB status */ -void *ctrl; /* goes away in a following commit, but don't break bisect */ -/** - * some forward declerations... - */ -static void usb_scan_devices(void); +#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT +#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 +#endif /*** * Init USB Device */ - int usb_init(void) { - int result; + void *ctrl; + struct usb_device *dev; + int i, start_index = 0; - running = 0; dev_index = 0; asynch_allowed = 1; usb_hub_reset(); + + /* first make all devices unknown */ + for (i = 0; i USB_MAX_DEVICE; i++) { + memset(usb_dev[i], 0, sizeof(struct usb_device)); + usb_dev[i].devnum = -1; + } + /* init low_level USB */ - printf(USB: ); - result = usb_lowlevel_init(0, ctrl); - /* if lowlevel init is OK, scan the bus for devices -* i.e. search HUBs and configure them */ - if (result == 0) { - printf(scanning bus for devices... ); - running = 1; - usb_scan_devices(); + for (i = 0; i CONFIG_USB_MAX_CONTROLLER_COUNT; i++) { + /* init low_level USB */ + printf(USB%d: , i); + if (usb_lowlevel_init(i, ctrl)) { + puts(lowlevel init failed\n); + continue; + } + /* +* lowlevel init is OK, now scan the bus for devices +* i.e. search HUBs and configure them +*/ + start_index = dev_index; + printf(scanning bus %d for devices... , i); + dev = usb_alloc_new_device(ctrl); + /* +* device 0 is always present +* (root hub, so let it analyze) +*/ + if (dev) + usb_new_device(dev); + + if (start_index == dev_index) + puts(No USB Device found\n); + else + printf(%d USB Device(s) found\n, + dev_index - start_index); + usb_started = 1; - return 0; - } else { - printf(Error, couldn't init Lowlevel part\n); - usb_started = 0; + } + + USB_PRINTF(scan end\n); + /* if we were not able
[U-Boot] [PATCH v2 4/4] tegra20: port to new ehci interface
EHCI interface now supports more than one controller. Wire up our usb functions to use this new interface. Signed-off-by: Lucas Stach d...@lynxeye.de --- arch/arm/cpu/armv7/tegra20/usb.c| 15 --- arch/arm/include/asm/arch-tegra20/usb.h | 4 ++-- drivers/usb/host/ehci-tegra.c | 5 ++--- 3 Dateien geändert, 8 Zeilen hinzugefügt(+), 16 Zeilen entfernt(-) diff --git a/arch/arm/cpu/armv7/tegra20/usb.c b/arch/arm/cpu/armv7/tegra20/usb.c index 178bb13..9e87faa 100644 --- a/arch/arm/cpu/armv7/tegra20/usb.c +++ b/arch/arm/cpu/armv7/tegra20/usb.c @@ -77,7 +77,6 @@ struct fdt_usb { static struct fdt_usb port[USB_PORTS_MAX]; /* List of valid USB ports */ static unsigned port_count;/* Number of available ports */ -static int port_current; /* Current port (-1 = none) */ /* * This table has USB timing parameters for each Oscillator frequency we @@ -346,30 +345,25 @@ static int add_port(struct fdt_usb *config, const u32 timing[]) return 0; } -int tegrausb_start_port(unsigned portnum, u32 *hccr, u32 *hcor) +int tegrausb_start_port(int portnum, u32 *hccr, u32 *hcor) { struct usb_ctlr *usbctlr; if (portnum = port_count) return -1; - tegrausb_stop_port(); set_host_mode(port[portnum]); usbctlr = port[portnum].reg; *hccr = (u32)usbctlr-cap_length; *hcor = (u32)usbctlr-usb_cmd; - port_current = portnum; return 0; } -int tegrausb_stop_port(void) +int tegrausb_stop_port(int portnum) { struct usb_ctlr *usbctlr; - if (port_current == -1) - return -1; - - usbctlr = port[port_current].reg; + usbctlr = port[portnum].reg; /* Stop controller */ writel(0, usbctlr-usb_cmd); @@ -378,7 +372,7 @@ int tegrausb_stop_port(void) /* Initiate controller reset */ writel(2, usbctlr-usb_cmd); udelay(1000); - port_current = -1; + return 0; } @@ -454,7 +448,6 @@ int board_usb_init(const void *blob) return -1; set_host_mode(config); } - port_current = -1; return 0; } diff --git a/arch/arm/include/asm/arch-tegra20/usb.h b/arch/arm/include/asm/arch-tegra20/usb.h index 638033b..4bbd4aa 100644 --- a/arch/arm/include/asm/arch-tegra20/usb.h +++ b/arch/arm/include/asm/arch-tegra20/usb.h @@ -240,13 +240,13 @@ int board_usb_init(const void *blob); * @param hcor returns start address of EHCI HCOR registers * @return 0 if ok, -1 on error (generally invalid port number) */ -int tegrausb_start_port(unsigned portnum, u32 *hccr, u32 *hcor); +int tegrausb_start_port(int portnum, u32 *hccr, u32 *hcor); /** * Stop the current port * * @return 0 if ok, -1 if no port was active */ -int tegrausb_stop_port(void); +int tegrausb_stop_port(int portnum); #endif /* _TEGRA_USB_H_ */ diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index bb5a68e..a1c43f8 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -57,7 +57,7 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) * Select the first port, as we don't have a way of selecting others * yet */ - if (tegrausb_start_port(0, our_hccr, our_hcor)) + if (tegrausb_start_port(index, our_hccr, our_hcor)) return -1; *hccr = (struct ehci_hccr *)our_hccr; @@ -72,6 +72,5 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) */ int ehci_hcd_stop(int index) { - tegrausb_stop_port(); - return 0; + return tegrausb_stop_port(index); } -- 1.7.11.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 3/4] disk: part_msdos: parse and store partition UUID
From: Stephen Warren swar...@nvidia.com The MSDOS/MBR partition table includes a 32-bit unique ID, often referred to as the NT disk signature. When combined with a partition number within the table, this can form a unique ID similar in concept to EFI/GPT's partition UUID. This patch generates UUIDs in the format 0002dd75-01, which matches the format expected by the Linux kernel. Signed-off-by: Stephen Warren swar...@nvidia.com --- v2: New patch. --- disk/part_dos.c | 15 --- disk/part_dos.h |2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/disk/part_dos.c b/disk/part_dos.c index a43dd9c..f9b7931 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -163,7 +163,8 @@ static void print_partition_extended (block_dev_desc_t *dev_desc, int ext_part_s */ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part_sector, int relative, int part_num, -int which_part, disk_partition_t *info) +int which_part, disk_partition_t *info, +unsigned int disksig) { ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc-blksz); dos_partition_t *pt; @@ -182,6 +183,11 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part return -1; } +#ifdef CONFIG_PARTITION_UUIDS + if (!ext_part_sector) + disksig = le32_to_int(buffer[DOS_PART_DISKSIG_OFFSET]); +#endif + /* Print all primary/logical partitions */ pt = (dos_partition_t *) (buffer + DOS_PART_TBL_OFFSET); for (i = 0; i 4; i++, pt++) { @@ -222,6 +228,9 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part } /* sprintf(info-type, %d, pt-sys_ind); */ sprintf ((char *)info-type, U-Boot); +#ifdef CONFIG_PARTITION_UUIDS + sprintf(info-uuid, %08x-%02x, disksig, part_num); +#endif return 0; } @@ -240,7 +249,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part return get_partition_info_extended (dev_desc, lba_start, ext_part_sector == 0 ? lba_start : relative, -part_num, which_part, info); +part_num, which_part, info, disksig); } } return -1; @@ -254,7 +263,7 @@ void print_part_dos (block_dev_desc_t *dev_desc) int get_partition_info_dos (block_dev_desc_t *dev_desc, int part, disk_partition_t * info) { - return get_partition_info_extended (dev_desc, 0, 0, 1, part, info); + return get_partition_info_extended(dev_desc, 0, 0, 1, part, info, 0); } diff --git a/disk/part_dos.h b/disk/part_dos.h index de75542..7b77c1d 100644 --- a/disk/part_dos.h +++ b/disk/part_dos.h @@ -24,7 +24,7 @@ #ifndef _DISK_PART_DOS_H #define _DISK_PART_DOS_H - +#define DOS_PART_DISKSIG_OFFSET0x1b8 #define DOS_PART_TBL_OFFSET0x1be #define DOS_PART_MAGIC_OFFSET 0x1fe #define DOS_PBR_FSTYPE_OFFSET 0x36 -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 1/4] disk: part_efi: range-check partition number
From: Stephen Warren swar...@nvidia.com Enhance get_partition_info_efi() to range-check the partition number. This prevents invalid partitions being accessed, and prevents access beyond the end of the gpt_pte[] array. Signed-off-by: Stephen Warren swar...@nvidia.com --- v2: New patch --- disk/part_efi.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index 02927a0..2962fd8 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -173,6 +173,13 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part, return -1; } + if (part le32_to_int(gpt_head-num_partition_entries) || + !is_pte_valid(gpt_pte[part - 1])) { + printf(%s: *** ERROR: Invalid partition number %d ***\n, + __func__, part); + return -1; + } + /* The ulong casting limits the maximum disk size to 2 TB */ info-start = (ulong) le64_to_int(gpt_pte[part - 1].starting_lba); /* The ending LBA is inclusive, to calculate size, add 1 to it */ -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 2/4] disk: part_efi: parse and store partition UUID
From: Stephen Warren swar...@nvidia.com Each EFI partition table entry contains a UUID. Extend U-Boot's struct disk_partition to be able to store this information, and modify get_partition_info_efi() to fill it in. The implementation of uuid_string() was stolen from the Linux kernel. Signed-off-by: Stephen Warren swar...@nvidia.com --- v2: Add #ifdef CONFIG_PARTITION_UUIDS around all new code and struct fields. --- disk/part.c |5 + disk/part_efi.c | 25 + include/part.h |3 +++ 3 files changed, 33 insertions(+), 0 deletions(-) diff --git a/disk/part.c b/disk/part.c index 76f3939..db422c4 100644 --- a/disk/part.c +++ b/disk/part.c @@ -294,6 +294,11 @@ void init_part (block_dev_desc_t * dev_desc) int get_partition_info (block_dev_desc_t *dev_desc, int part , disk_partition_t *info) { +#ifdef CONFIG_PARTITION_UUIDS + /* The common case is no UUID support */ + info-uuid[0] = 0; +#endif + switch (dev_desc-part_type) { #ifdef CONFIG_MAC_PARTITION case PART_TYPE_MAC: diff --git a/disk/part_efi.c b/disk/part_efi.c index 2962fd8..264ea9c 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -154,6 +154,28 @@ void print_part_efi(block_dev_desc_t * dev_desc) return; } +#ifdef CONFIG_PARTITION_UUIDS +static void uuid_string(unsigned char *uuid, char *str) +{ + static const u8 le[16] = {3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, + 12, 13, 14, 15}; + int i; + + for (i = 0; i 16; i++) { + sprintf(str, %02x, uuid[le[i]]); + str += 2; + switch (i) { + case 3: + case 5: + case 7: + case 9: + *str++ = '-'; + break; + } + } +} +#endif + int get_partition_info_efi(block_dev_desc_t * dev_desc, int part, disk_partition_t * info) { @@ -190,6 +212,9 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part, sprintf((char *)info-name, %s, print_efiname(gpt_pte[part - 1])); sprintf((char *)info-type, U-Boot); +#ifdef CONFIG_PARTITION_UUIDS + uuid_string(gpt_pte[part - 1].unique_partition_guid.b, info-uuid); +#endif debug(%s: start 0x%lX, size 0x%lX, name %s, __func__, info-start, info-size, info-name); diff --git a/include/part.h b/include/part.h index e1478f4..fde320a 100644 --- a/include/part.h +++ b/include/part.h @@ -93,6 +93,9 @@ typedef struct disk_partition { ulong blksz; /* block size in bytes */ uchar name[32]; /* partition name */ uchar type[32]; /* string type description */ +#ifdef CONFIG_PARTITION_UUIDS + charuuid[37]; /* filesystem UUID as string, if exists */ +#endif } disk_partition_t; /* Misc _get_dev functions */ -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 4/4] cmd_part: add partition-related command
From: Stephen Warren swar...@nvidia.com This implements the following: part uuid mmc 0:1 - print partition UUID part uuid mmc 0:1 uuid - set environment variable to partition UUID This can be useful when writing a bootcmd which searches all known devices for something bootable, and then wants the kernel to use the same partition as the root device, e.g.: part uuid ${devtype} ${devnum}:${rootpart} uuid setenv bootargs root=PARTUUID=${uuid} ... It is expected that further part sub-commands will be added later, e.g. to find which partition on a disk is marked bootable, to write new partition tables to disk, etc. Signed-off-by: Stephen Warren swar...@nvidia.com --- v2: validate that CONFIG_PARTITION_UUID is defined when CONFIG_CMD_PART is Note: If Rob Herring's proposed patch disk/part: introduce get_device_and_partition is applied, the body of do_partuuid() should be reworked to use Rob's new function get_device_and_partition(). --- common/Makefile |1 + common/cmd_part.c | 104 + 2 files changed, 105 insertions(+), 0 deletions(-) create mode 100644 common/cmd_part.c diff --git a/common/Makefile b/common/Makefile index 3d62775..449b390 100644 --- a/common/Makefile +++ b/common/Makefile @@ -129,6 +129,7 @@ COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o COBJS-$(CONFIG_CMD_NET) += cmd_net.o COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o +COBJS-$(CONFIG_CMD_PART) += cmd_part.o ifdef CONFIG_PCI COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o endif diff --git a/common/cmd_part.c b/common/cmd_part.c new file mode 100644 index 000..1b15ae9 --- /dev/null +++ b/common/cmd_part.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. + * + * made from cmd_ext2, which was: + * + * (C) Copyright 2004 + * esd gmbh www.esd-electronics.com + * Reinhard Arlt reinhard.a...@esd-electronics.com + * + * made from cmd_reiserfs by + * + * (C) Copyright 2003 - 2004 + * Sysgo Real-Time Solutions, AG www.elinos.com + * Pavel Bartusek p...@sysgo.com + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +#include common.h +#include config.h +#include command.h +#include part.h +#include vsprintf.h + +#ifndef CONFIG_PARTITION_UUIDS +#error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_PART to be enabled +#endif + +int do_partuuid(int argc, char * const argv[]) +{ + int dev; + int part; + char *ep; + block_dev_desc_t *dev_desc; + disk_partition_t info; + + if (argc 2) + return CMD_RET_USAGE; + if (argc 3) + return CMD_RET_USAGE; + + dev = (int)simple_strtoul(argv[1], ep, 16); + dev_desc = get_dev(argv[0], dev); + if (dev_desc == NULL) { + printf(Block device %s %d not supported\n, argv[0], dev); + return 1; + } + + if (*ep) { + if (*ep != ':') { + puts(Invalid device; use dev[:part]\n); + return 1; + } + part = (int)simple_strtoul(++ep, NULL, 16); + } else { + part = 1; + } + + if (get_partition_info(dev_desc, part, info)) { + printf(Bad partition %d\n, part); + return 1; + } + + if (argc 2) + setenv(argv[2], info.uuid); + else + printf(%s\n, info.uuid); + + return 0; +} + +int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + if (argc 2) + return CMD_RET_USAGE; + + if (!strcmp(argv[1], uuid)) + return do_partuuid(argc - 2, argv + 2); + + return CMD_RET_USAGE; +} + +U_BOOT_CMD( + part, 5, 1, do_part, + disk partition related commands, + part uuid interface dev[:part]\n + - print partition UUID\n + part uuid interface dev[:part] varname\n + - set environment variable to partition UUID +); -- 1.7.0.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] USB multi controller
Hi Marek, Stephen, Tom, Am Mittwoch, den 05.09.2012, 21:27 +0200 schrieb Marek Vasut: Dear Stephen Warren, On 09/05/2012 12:30 AM, Marek Vasut wrote: [...] u-boot-usb master is updated to master and pushed for your enjoyment. The series doesn't appear to apply to u-boot-usb/master, nor to u-boot-tegra/master plus those cherry-picks listed above. Perhaps you can rebase on something (although I'm not sure which branch it's meant to go through) so I can apply/test it? I'd say reorder 3/4 and 4/4 (swap them) and then repost the rebased result. I'll pick it all. I've just posted rebased patches to the list. That leads me to a question, why is the tegra usb driver goo still in arch/arm/ and not in drivers/ as it should be? Just because I like doing one thing at a time. Getting all the USB related changes integrated so far seemed to be enough work for me to keep up with. Moving the Tegra USB implementation is still somewhere on my list of things to do. Maybe it would be better to also take the whole Tegra ULPI patchset through the USB tree. This would minimize the dependencies of both trees and would allow to easily move the implementation in a follow-on patchset. But for this to work out we would have to agree to base all further Tegra USB patches for this cycle (if there are any) on the u-boot-usb tree. Thanks, Lucas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 01/10] dm: arm: Remove support for lpc2292
On Sun, Sep 02, 2012 at 06:15:02PM +0200, Marek Vasut wrote: Dear Wolfgang Denk, Dear Albert, In message 1342882947-9174-1-git-send-email-ma...@denx.de Marek Vasut wrote: This stuff has been rotting in the tree for a year now. Remove it. Signed-off-by: Marek Vasut ma...@denx.de Cc: Wolfgang Denk w...@denx.de Cc: Albert Aribaud albert.u.b...@aribaud.net Cc: U-Boot DM u-boot...@lists.denx.de In case you are going to apply any of these patches, please do make sure to drop the dm: string from all these subjects. At least add some ID so I can mine these patches back when we finish the project. If you drop them, I won't have any way to tell. You shouldn't need any. At the end of the project just do: $ git log --author=(regex|that|catches|everyone) --since=project-start -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/4] usb: lowlevel interface change to support multiple controllers
Carry an index in the lowlevel usb functions to make specify the respective usb controller. Also pass through an controller struct from lowlevel_init to the creation of the root usb device of this controller. Signed-off-by: Lucas Stach d...@lynxeye.de Reviewed-by: Marek Vasut ma...@denx.de --- arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c | 4 ++-- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 4 ++-- arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 4 ++-- arch/powerpc/cpu/ppc4xx/usb_ohci.c| 4 ++-- arch/sparc/cpu/leon3/usb_uhci.c | 4 ++-- arch/sparc/lib/bootm.c| 2 +- board/mpl/common/usb_uhci.c | 4 ++-- common/usb.c | 10 ++ common/usb_hub.c | 2 +- drivers/usb/host/ehci-hcd.c | 4 ++-- drivers/usb/host/isp116x-hcd.c| 4 ++-- drivers/usb/host/ohci-hcd.c | 4 ++-- drivers/usb/host/r8a66597-hcd.c | 4 ++-- drivers/usb/host/sl811-hcd.c | 4 ++-- drivers/usb/musb/musb_hcd.c | 4 ++-- include/usb.h | 10 +++--- include/usb/mv_udc.h | 2 +- 17 Dateien geändert, 40 Zeilen hinzugefügt(+), 34 Zeilen entfernt(-) diff --git a/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c b/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c index cf0335c..944bb32 100644 --- a/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c +++ b/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c @@ -1659,7 +1659,7 @@ static void hc_release_ohci(struct ohci *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio(); @@ -1738,7 +1738,7 @@ int usb_lowlevel_init(void) return 0; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c index 7647e11..c747767 100644 --- a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c +++ b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c @@ -1565,7 +1565,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { u32 pin_func; u32 sys_freqctrl, sys_clksrc; @@ -1707,7 +1707,7 @@ int usb_lowlevel_init(void) return -1; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ diff --git a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c index 6d91525..607034b 100644 --- a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c +++ b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c @@ -1561,7 +1561,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { /* Set the USB Clock */ @@ -1629,7 +1629,7 @@ int usb_lowlevel_init(void) return 0; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ diff --git a/arch/powerpc/cpu/ppc4xx/usb_ohci.c b/arch/powerpc/cpu/ppc4xx/usb_ohci.c index 14c6a28..4ce2726 100644 --- a/arch/powerpc/cpu/ppc4xx/usb_ohci.c +++ b/arch/powerpc/cpu/ppc4xx/usb_ohci.c @@ -1566,7 +1566,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { memset (gohci, 0, sizeof (ohci_t)); memset (urb_priv, 0, sizeof (urb_priv_t)); @@ -1624,7 +1624,7 @@ int usb_lowlevel_init(void) return 0; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ diff --git a/arch/sparc/cpu/leon3/usb_uhci.c b/arch/sparc/cpu/leon3/usb_uhci.c index 62cc25d..b3b8a4d 100644 --- a/arch/sparc/cpu/leon3/usb_uhci.c +++ b/arch/sparc/cpu/leon3/usb_uhci.c @@ -706,7 +706,7 @@ void handle_usb_interrupt(void) /* init uhci */ -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { unsigned char temp; ambapp_ahbdev ahbdev; @@ -745,7 +745,7 @@ int usb_lowlevel_init(void) /* stop uhci */ -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { if (grusb_irq == -1) return 1; diff --git a/arch/sparc/lib/bootm.c b/arch/sparc/lib/bootm.c index e5b933d..bcc6358 100644 ---
[U-Boot] [PATCH v3 0/4] USB multi controller
V3: Stephen ran into some problems applying this, as it seems my tree wasn't as clean as it should have been. Sorry for the inconvenience. This should now be fixed. Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Tom, Stephen, can I get an ACK from you for this, so Marek can take this through his USB tree? All patches now rebased onto u-boot-usb/master. Patch 3 also includes some cosmetic changes, to make the output of the usb commands more readable. On my Colibri T20, with a total of 3 usb controllers of which 2 are enabled in the device tree, output now looks like this: Tegra20 (Colibri) # usb start (Re)start USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found USB1: USB EHCI 1.00 scanning bus 1 for devices... 2 USB Device(s) found USB2: lowlevel init failed scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 1 Ethernet Device(s) found Tegra20 (Colibri) # usb tree USB device tree: 1 Hub (480 Mb/s, 0mA) | u-boot EHCI Host Controller | +-2 Mass Storage (480 Mb/s, 200mA) SanDisk U3 Titanium 2845221DC342AE8F 3 Hub (480 Mb/s, 0mA) | u-boot EHCI Host Controller | +-4 Vendor specific (480 Mb/s, 4mA) ASIX Elec. Corp. AX88772B 01 Lucas Stach (4): usb: lowlevel interface change to support multiple controllers usb: ehci: rework to take advantage of new lowlevel interface usb: add support for multiple usb controllers tegra20: port to new ehci interface arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c | 4 +- arch/arm/cpu/armv7/tegra20/usb.c | 15 +--- arch/arm/include/asm/arch-tegra20/usb.h | 4 +- arch/arm/include/asm/ehci-omap.h | 10 ++- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 4 +- arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 4 +- arch/powerpc/cpu/ppc4xx/usb_ohci.c| 4 +- arch/sparc/cpu/leon3/usb_uhci.c | 4 +- arch/sparc/lib/bootm.c| 2 +- board/htkw/mcx/mcx.c | 6 +- board/mpl/common/usb_uhci.c | 4 +- board/technexion/twister/twister.c| 6 +- board/teejet/mt_ventoux/mt_ventoux.c | 6 +- board/ti/beagle/beagle.c | 6 +- board/ti/panda/panda.c| 6 +- common/cmd_usb.c | 16 +++- common/usb.c | 108 +++--- common/usb_hub.c | 2 +- common/usb_storage.c | 2 +- drivers/usb/eth/usb_ether.c | 2 +- drivers/usb/host/ehci-armada100.c | 15 ++-- drivers/usb/host/ehci-atmel.c | 11 ++- drivers/usb/host/ehci-core.h | 29 -- drivers/usb/host/ehci-exynos.c| 15 ++-- drivers/usb/host/ehci-fsl.c | 11 ++- drivers/usb/host/ehci-hcd.c | 124 ++ drivers/usb/host/ehci-ixp4xx.c| 15 ++-- drivers/usb/host/ehci-marvell.c | 15 ++-- drivers/usb/host/ehci-mpc512x.c | 25 ++ drivers/usb/host/ehci-mx5.c | 11 ++- drivers/usb/host/ehci-mx6.c | 11 ++- drivers/usb/host/ehci-mxc.c | 11 ++- drivers/usb/host/ehci-mxs.c | 28 +++--- drivers/usb/host/ehci-omap.c | 10 ++- drivers/usb/host/ehci-pci.c | 15 ++-- drivers/usb/host/ehci-ppc4xx.c| 11 ++- drivers/usb/host/ehci-tegra.c | 14 ++- drivers/usb/host/ehci-vct.c | 9 +- drivers/usb/host/ehci.h | 4 +- drivers/usb/host/isp116x-hcd.c| 4 +- drivers/usb/host/ohci-hcd.c | 4 +- drivers/usb/host/r8a66597-hcd.c | 4 +- drivers/usb/host/sl811-hcd.c | 4 +- drivers/usb/musb/musb_hcd.c | 4 +- include/usb.h | 10 ++- include/usb/mv_udc.h
[U-Boot] [PATCH v3 4/4] tegra20: port to new ehci interface
EHCI interface now supports more than one controller. Wire up our usb functions to use this new interface. Signed-off-by: Lucas Stach d...@lynxeye.de --- arch/arm/cpu/armv7/tegra20/usb.c| 15 --- arch/arm/include/asm/arch-tegra20/usb.h | 4 ++-- drivers/usb/host/ehci-tegra.c | 5 ++--- 3 Dateien geändert, 8 Zeilen hinzugefügt(+), 16 Zeilen entfernt(-) diff --git a/arch/arm/cpu/armv7/tegra20/usb.c b/arch/arm/cpu/armv7/tegra20/usb.c index 178bb13..9e87faa 100644 --- a/arch/arm/cpu/armv7/tegra20/usb.c +++ b/arch/arm/cpu/armv7/tegra20/usb.c @@ -77,7 +77,6 @@ struct fdt_usb { static struct fdt_usb port[USB_PORTS_MAX]; /* List of valid USB ports */ static unsigned port_count;/* Number of available ports */ -static int port_current; /* Current port (-1 = none) */ /* * This table has USB timing parameters for each Oscillator frequency we @@ -346,30 +345,25 @@ static int add_port(struct fdt_usb *config, const u32 timing[]) return 0; } -int tegrausb_start_port(unsigned portnum, u32 *hccr, u32 *hcor) +int tegrausb_start_port(int portnum, u32 *hccr, u32 *hcor) { struct usb_ctlr *usbctlr; if (portnum = port_count) return -1; - tegrausb_stop_port(); set_host_mode(port[portnum]); usbctlr = port[portnum].reg; *hccr = (u32)usbctlr-cap_length; *hcor = (u32)usbctlr-usb_cmd; - port_current = portnum; return 0; } -int tegrausb_stop_port(void) +int tegrausb_stop_port(int portnum) { struct usb_ctlr *usbctlr; - if (port_current == -1) - return -1; - - usbctlr = port[port_current].reg; + usbctlr = port[portnum].reg; /* Stop controller */ writel(0, usbctlr-usb_cmd); @@ -378,7 +372,7 @@ int tegrausb_stop_port(void) /* Initiate controller reset */ writel(2, usbctlr-usb_cmd); udelay(1000); - port_current = -1; + return 0; } @@ -454,7 +448,6 @@ int board_usb_init(const void *blob) return -1; set_host_mode(config); } - port_current = -1; return 0; } diff --git a/arch/arm/include/asm/arch-tegra20/usb.h b/arch/arm/include/asm/arch-tegra20/usb.h index 638033b..4bbd4aa 100644 --- a/arch/arm/include/asm/arch-tegra20/usb.h +++ b/arch/arm/include/asm/arch-tegra20/usb.h @@ -240,13 +240,13 @@ int board_usb_init(const void *blob); * @param hcor returns start address of EHCI HCOR registers * @return 0 if ok, -1 on error (generally invalid port number) */ -int tegrausb_start_port(unsigned portnum, u32 *hccr, u32 *hcor); +int tegrausb_start_port(int portnum, u32 *hccr, u32 *hcor); /** * Stop the current port * * @return 0 if ok, -1 if no port was active */ -int tegrausb_stop_port(void); +int tegrausb_stop_port(int portnum); #endif /* _TEGRA_USB_H_ */ diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index bb5a68e..a1c43f8 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -57,7 +57,7 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) * Select the first port, as we don't have a way of selecting others * yet */ - if (tegrausb_start_port(0, our_hccr, our_hcor)) + if (tegrausb_start_port(index, our_hccr, our_hcor)) return -1; *hccr = (struct ehci_hccr *)our_hccr; @@ -72,6 +72,5 @@ int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) */ int ehci_hcd_stop(int index) { - tegrausb_stop_port(); - return 0; + return tegrausb_stop_port(index); } -- 1.7.11.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 3/4] usb: add support for multiple usb controllers
Allows to initialize more than one USB controller at once. v2: print message when controller stop fails Signed-off-by: Lucas Stach d...@lynxeye.de Reviewed-by: Marek Vasut ma...@denx.de --- common/cmd_usb.c| 16 +-- common/usb.c| 106 +++- common/usb_storage.c| 2 +- drivers/usb/eth/usb_ether.c | 2 +- 4 Dateien geändert, 70 Zeilen hinzugefügt(+), 56 Zeilen entfernt(-) diff --git a/common/cmd_usb.c b/common/cmd_usb.c index a8e3ae5..6cefc0c 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -517,8 +517,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) bootstage_mark_name(BOOTSTAGE_ID_USB_START, usb_start); usb_stop(); printf((Re)start USB...\n); - i = usb_init(); - if (i = 0) { + if (usb_init() = 0) { #ifdef CONFIG_USB_STORAGE /* try to recognize storage devices immediately */ usb_stor_curr_dev = usb_stor_scan(1); @@ -527,6 +526,9 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* try to recognize ethernet devices immediately */ usb_ether_curr_dev = usb_host_eth_scan(1); #endif +#ifdef CONFIG_USB_KEYBOARD + drv_usb_kbd_init(); +#endif } return 0; } @@ -553,8 +555,14 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; } if (strncmp(argv[1], tree, 4) == 0) { - printf(\nDevice Tree:\n); - usb_show_tree(usb_get_dev_index(0)); + puts(USB device tree:\n); + for (i = 0; i USB_MAX_DEVICE; i++) { + dev = usb_get_dev_index(i); + if (dev == NULL) + break; + if (dev-parent == NULL) + usb_show_tree(dev); + } return 0; } if (strncmp(argv[1], inf, 3) == 0) { diff --git a/common/usb.c b/common/usb.c index e58b6f4..1c9763c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -72,45 +72,72 @@ static struct usb_device usb_dev[USB_MAX_DEVICE]; static int dev_index; -static int running; static int asynch_allowed; char usb_started; /* flag for the started/stopped USB status */ -void *ctrl; /* goes away in a following commit, but don't break bisect */ -/** - * some forward declerations... - */ -static void usb_scan_devices(void); +#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT +#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 +#endif /*** * Init USB Device */ - int usb_init(void) { - int result; + void *ctrl; + struct usb_device *dev; + int i, start_index = 0; - running = 0; dev_index = 0; asynch_allowed = 1; usb_hub_reset(); + + /* first make all devices unknown */ + for (i = 0; i USB_MAX_DEVICE; i++) { + memset(usb_dev[i], 0, sizeof(struct usb_device)); + usb_dev[i].devnum = -1; + } + /* init low_level USB */ - printf(USB: ); - result = usb_lowlevel_init(0, ctrl); - /* if lowlevel init is OK, scan the bus for devices -* i.e. search HUBs and configure them */ - if (result == 0) { - printf(scanning bus for devices... ); - running = 1; - usb_scan_devices(); + for (i = 0; i CONFIG_USB_MAX_CONTROLLER_COUNT; i++) { + /* init low_level USB */ + printf(USB%d: , i); + if (usb_lowlevel_init(i, ctrl)) { + puts(lowlevel init failed\n); + continue; + } + /* +* lowlevel init is OK, now scan the bus for devices +* i.e. search HUBs and configure them +*/ + start_index = dev_index; + printf(scanning bus %d for devices... , i); + dev = usb_alloc_new_device(ctrl); + /* +* device 0 is always present +* (root hub, so let it analyze) +*/ + if (dev) + usb_new_device(dev); + + if (start_index == dev_index) + puts(No USB Device found\n); + else + printf(%d USB Device(s) found\n, + dev_index - start_index); + usb_started = 1; - return 0; - } else { - printf(Error, couldn't init Lowlevel part\n); - usb_started = 0; + } + + USB_PRINTF(scan end\n); + /* if we were not able
[U-Boot] [PATCH v3 2/4] usb: ehci: rework to take advantage of new lowlevel interface
Kill off ehci-core.h It was used to specify some static controller data. To support more than one controller being active at any time we have to carry the controller data ourselfes. Change the ehci interface accordingly. NOTE: OMAP implemented the ehci stuff a bit backwards and should be fixed to do the same thing as other platforms. But the change for now is at least compile clean. Signed-off-by: Lucas Stach d...@lynxeye.de Reviewed-by: Marek Vasut ma...@denx.de --- arch/arm/include/asm/ehci-omap.h | 10 ++- board/htkw/mcx/mcx.c | 6 +- board/technexion/twister/twister.c | 6 +- board/teejet/mt_ventoux/mt_ventoux.c | 6 +- board/ti/beagle/beagle.c | 6 +- board/ti/panda/panda.c | 6 +- drivers/usb/host/ehci-armada100.c| 15 ++--- drivers/usb/host/ehci-atmel.c| 11 ++-- drivers/usb/host/ehci-core.h | 29 - drivers/usb/host/ehci-exynos.c | 15 ++--- drivers/usb/host/ehci-fsl.c | 11 ++-- drivers/usb/host/ehci-hcd.c | 120 +++ drivers/usb/host/ehci-ixp4xx.c | 15 ++--- drivers/usb/host/ehci-marvell.c | 15 ++--- drivers/usb/host/ehci-mpc512x.c | 25 +++- drivers/usb/host/ehci-mx5.c | 11 ++-- drivers/usb/host/ehci-mx6.c | 11 ++-- drivers/usb/host/ehci-mxc.c | 11 ++-- drivers/usb/host/ehci-mxs.c | 28 drivers/usb/host/ehci-omap.c | 10 +-- drivers/usb/host/ehci-pci.c | 15 ++--- drivers/usb/host/ehci-ppc4xx.c | 11 ++-- drivers/usb/host/ehci-tegra.c| 9 ++- drivers/usb/host/ehci-vct.c | 9 ++- drivers/usb/host/ehci.h | 4 +- 25 Dateien geändert, 197 Zeilen hinzugefügt(+), 218 Zeilen entfernt(-) delete mode 100644 drivers/usb/host/ehci-core.h diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h index e72c5df..77e8170 100644 --- a/arch/arm/include/asm/ehci-omap.h +++ b/arch/arm/include/asm/ehci-omap.h @@ -136,7 +136,15 @@ struct omap_ehci { u32 insreg08; /* 0xb0 */ }; -int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata); +/* + * FIXME: forward declaration of this structs needed because omap got the + * ehci implementation backwards. move out ehci_hcd_x from board files + */ +struct ehci_hccr; +struct ehci_hcor; + +int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata, + struct ehci_hccr **hccr, struct ehci_hcor **hcor); int omap_ehci_hcd_stop(void); #endif /* _OMAP_COMMON_EHCI_H_ */ diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c index 454ff0a..7c9d34a 100644 --- a/board/htkw/mcx/mcx.c +++ b/board/htkw/mcx/mcx.c @@ -46,12 +46,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor); } -int ehci_hcd_stop(void) +int ehci_hcd_stop(int index) { return omap_ehci_hcd_stop(); } diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c index c2b10ac..69b1cc2 100644 --- a/board/technexion/twister/twister.c +++ b/board/technexion/twister/twister.c @@ -67,12 +67,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor); } -int ehci_hcd_stop(void) +int ehci_hcd_stop(int index) { return omap_ehci_hcd_stop(); } diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c index 9fbaedd..7bbd536 100644 --- a/board/teejet/mt_ventoux/mt_ventoux.c +++ b/board/teejet/mt_ventoux/mt_ventoux.c @@ -67,12 +67,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor); } -int ehci_hcd_stop(void) +int ehci_hcd_stop(int index) { return omap_ehci_hcd_stop(); } diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 99f833f..59b9924 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -502,12 +502,12 @@ static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED }; -int ehci_hcd_init(void) +int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { - return omap_ehci_hcd_init(usbhs_bdata); + return omap_ehci_hcd_init(usbhs_bdata, hccr, hcor);
Re: [U-Boot] How to manage RMOBILE patches?
Hi, Tom. On Wed, Sep 5, 2012 at 11:17 PM, Tom Rini tr...@ti.com wrote: On 09/05/2012 04:18 AM, Albert ARIBAUD wrote: Hi Nobuhiro, On Wed, 5 Sep 2012 11:26:37 +0900, Nobuhiro Iwamatsu iwama...@nigauri.org wrote: Hi, On Wed, Sep 5, 2012 at 2:36 AM, Tom Rini tr...@ti.com wrote: On Mon, Sep 03, 2012 at 09:15:56PM +0200, Wolfgang Denk wrote: Dear Nobuhiro Iwamatsu, In message CABMQnVLBEEjcEtfTzdeThHfTLp=b24qsognfjbzr-8ywytj...@mail.gmail.com you wrote: I am working supporting Renesas RMOBILE to U-Boot. Renesas's RMOBILE SoC family contains an ARM Cortex-A9, and this uses the same IP as SH. (For example, timer, ether, serial, etc.) I already sent to patches of rmobile, I got review from some developers. And the patch is managed by the arm/rmobile branch of u-boot-sh[0] which I have maintained, now. Since I had you take the patch of rmobile into an ARM repository, I consulted with Albert about the future development approach. We thought two methods are considered. One is Albert picks up a patch from ML to ARM repository, As this is ARM code, this appears the most natural approach to me Another is whether to have pull from the repository by having a repository for rmobile made. If this is an ARM SoC, then it should go through the ARM repo - even if we should later decide that there is so much traffic that a separate rmobile repo would be sustified, thi would still be a sub-repo, which Albert would pull from. Another option, which Mike is using for, iirc, sf and blackfin, is just to add rmobile-master / rmobile-next as branches to the u-boot-sh repository. Yes, this is one of easy way. But Albert won't pull form u-boot-sh, if If my understanding is not wrong. This just means that they'll end up on u-boot/master from u-boot.sh (and from there into u-boot-arm later on). To be clear, what I'm saying is just add a few more branches to u-boot-sh that Albert will pull (since they're ARM stuff). Say u-boot-sh/rmobile/master and u-boot-sh/rmobile/next. Then not get too hung up on which repository a merge message comes from. :) I was going to do by how to explain you. However, I think that Albert mistook by my shortage of explanation. Thank you for following up. Nobuhiro -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 2/4] disk: part_efi: parse and store partition UUID
On Wed, Sep 05, 2012 at 04:03:42PM -0600, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Each EFI partition table entry contains a UUID. Extend U-Boot's struct disk_partition to be able to store this information, and modify get_partition_info_efi() to fill it in. The implementation of uuid_string() was stolen from the Linux kernel. Don't say stolen, say borrowed and cite a release and file path. Thanks! -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/9] combine block device load commands into common function
On Thu, Aug 23, 2012 at 04:31:42PM -0500, Rob Herring wrote: From: Rob Herring rob.herr...@calxeda.com All the raw block load commands duplicate the same code. Starting with the ide version as it has progress updates convert ide, usb, and scsi boot commands to all use a common version. Signed-off-by: Rob Herring rob.herr...@calxeda.com [snip] diff --git a/common/cmd_disk.c b/common/cmd_disk.c new file mode 100644 index 000..38420dc --- /dev/null +++ b/common/cmd_disk.c @@ -0,0 +1,161 @@ +#include common.h +#include command.h Many companies have legal departments that get upset by files without license information. Please add a GPLv2+ message, thanks. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/9] combine block device load commands into common function
On 09/05/2012 06:36 PM, Tom Rini wrote: On Thu, Aug 23, 2012 at 04:31:42PM -0500, Rob Herring wrote: From: Rob Herring rob.herr...@calxeda.com All the raw block load commands duplicate the same code. Starting with the ide version as it has progress updates convert ide, usb, and scsi boot commands to all use a common version. Signed-off-by: Rob Herring rob.herr...@calxeda.com [snip] diff --git a/common/cmd_disk.c b/common/cmd_disk.c new file mode 100644 index 000..38420dc --- /dev/null +++ b/common/cmd_disk.c @@ -0,0 +1,161 @@ +#include common.h +#include command.h Many companies have legal departments that get upset by files without license information. Please add a GPLv2+ message, thanks. Probably whatever is on the ide code I copied this from is more appropriate, but yes I need to add that. Rob ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/4] USB multi controller
On 09/05/2012 05:12 PM, Lucas Stach wrote: V3: Stephen ran into some problems applying this, as it seems my tree wasn't as clean as it should have been. Sorry for the inconvenience. This should now be fixed. Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Tom, Stephen, can I get an ACK from you for this, so Marek can take this through his USB tree? All patches now rebased onto u-boot-usb/master. The series, Tested-by: Stephen Warren swar...@nvidia.com For reference, I tested on both Harmony (USB1+USB2 ULPI) and Seaboard (really Springbank) (USB1+USB3). I applied these patches on top of u-boot-usb/master, then merged in u-boot-tegra/next plus a few local patches, and resolved the one minor conflict. For the record so I can find it next time, the way to enable USB keyboard for stdin on Springbank is: setenv stdin serial,usbkbd. Thanks for rebasing! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/9] combine block device load commands into common function
On Wed, Sep 05, 2012 at 06:47:45PM -0500, Rob Herring wrote: On 09/05/2012 06:36 PM, Tom Rini wrote: On Thu, Aug 23, 2012 at 04:31:42PM -0500, Rob Herring wrote: From: Rob Herring rob.herr...@calxeda.com All the raw block load commands duplicate the same code. Starting with the ide version as it has progress updates convert ide, usb, and scsi boot commands to all use a common version. Signed-off-by: Rob Herring rob.herr...@calxeda.com [snip] diff --git a/common/cmd_disk.c b/common/cmd_disk.c new file mode 100644 index 000..38420dc --- /dev/null +++ b/common/cmd_disk.c @@ -0,0 +1,161 @@ +#include common.h +#include command.h Many companies have legal departments that get upset by files without license information. Please add a GPLv2+ message, thanks. Probably whatever is on the ide code I copied this from is more appropriate, but yes I need to add that. Yes, sorry, I meant the GPLv2+ message that all of the other files have some variant of. Copying the cmd_ide.c one on top sounds best. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/9] disk/part: introduce get_device_and_partition
On Thu, Aug 23, 2012 at 08:51:50PM -0600, Stephen Warren wrote: On 08/23/2012 07:57 PM, Rob Herring wrote: On 08/23/2012 05:36 PM, Stephen Warren wrote: On 08/23/2012 03:31 PM, Rob Herring wrote: From: Rob Herring rob.herr...@calxeda.com All block device related commands (scsiboot, fatload, ext2ls, etc.) have simliar duplicated device and partition parsing and selection code. This adds a common function to replace various implementations. The new function has some enhancements over current versions. If no device or partition is specified on the command line, the bootdevice env variable will be used (scsiboot does this). If the partition is not specified and the device has partitions, then the first bootable partition will be used. If a bootable partition is not found, the first valid partition is used. The ret value is not needed since part will be zero when no partition is found. Two thoughts on this patch: First, if I write mmc 0 right now, command will always attempt to access precisely partion 1, whereas after this patch, they will search for the first bootable, or valid, partition. This is a change in behavior. It's a pretty reasonable change, but I wonder if it might cause problems somewhere. Instead, perhaps this new feature should be explicitly requested, supporting the following device/partition specifications: # existing: dev 0:0# whole device dev 0:n# n = 1: explicit partition dev 0 # partition 1 # new: dev 0:valid# first valid partition dev 0:bootable # first bootable partition dev 0:default # first bootable partition if there is one, # else first valid I'm not sure we need to distinguish valid vs. bootable. Returning the first valid partition was really just to maintain somewhat backwards compatible behavior. Perhaps just 0:- would be sufficient. I guess that syntax would be fine if we don't need to distinguish all the cases. - isn't that descriptive though, and I've only seen it mean nothing in U-Boot commands. So, bike-shedding a bit, it doesn't seem exactly correct. Perhaps just auto? auto sounds like a good idea to me as well. [snip] Instead, I wonder if get_device_and_partition() should just support the existing 3 device specification options, and we introduce a new command to determine which partition to boot from, e.g.: # writes result to bootpart variable # or get-default or get-first-valid part get-first-bootable mmc 0 bootpart ext2load mmc 0:${bootpart} ${scriptaddr} boot.scr source ${scriptaddr} # script does: ext2load mmc 0:${bootpart} ${kernel_addr} zImage ext2load mmc 0:${bootpart} ${initrd_addr} initrd.bin ext2load mmc 0:${bootpart} ${fdt_addr} foo.dtb That solves those issues. Does anyone have any comment on the two approaches? I'm really open to either way. Another option would be for the first command run to set bootpart and then re-use that value on subsequent commands. That could work too, although commands using environment variables seems a little implicit/hidden. Agreed. We should be very careful when changing behavior. Adding a new command so that folks can use this as they see fit sounds like the best idea. I shudder to think what the partition table on some SD cards I have around looks like. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 4/4] cmd_part: add partition-related command
On Wed, Sep 05, 2012 at 06:51:58PM -0500, Rob Herring wrote: On 09/05/2012 05:03 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com This implements the following: part uuid mmc 0:1 - print partition UUID part uuid mmc 0:1 uuid - set environment variable to partition UUID What's the reason to not always both print out and set the uuid env var? Perhaps the env name should be partuuid or part_uuid as you could have uuid's for other purposes? This can be useful when writing a bootcmd which searches all known devices for something bootable, and then wants the kernel to use the same partition as the root device, e.g.: part uuid ${devtype} ${devnum}:${rootpart} uuid setenv bootargs root=PARTUUID=${uuid} ... It is expected that further part sub-commands will be added later, e.g. to find which partition on a disk is marked bootable, to write new partition tables to disk, etc. A list command would be useful and would be better located here than under scsi or other interface commands. Perhaps instead of printing a single part uuid, you should make a list command that prints all partitions and their UUIDs. That would address my first question. Sounds like a good idea to me as well. [snip] Signed-off-by: Stephen Warren swar...@nvidia.com --- v2: validate that CONFIG_PARTITION_UUID is defined when CONFIG_CMD_PART is Note: If Rob Herring's proposed patch disk/part: introduce get_device_and_partition is applied, the body of do_partuuid() should be reworked to use Rob's new function get_device_and_partition(). I think the best idea here would be to make the next version just depend on Rob's series. -- Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sh: ap_sh4a_4a: Fixed initialization value of DDR memory
The wrong value was set as value of column of DDR memory for ap_sh4a_4a. 10 is the right value. This fixed this problem. Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com --- board/alphaproject/ap_sh4a_4a/lowlevel_init.S |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/alphaproject/ap_sh4a_4a/lowlevel_init.S b/board/alphaproject/ap_sh4a_4a/lowlevel_init.S index f04b36b..cf9c225 100644 --- a/board/alphaproject/ap_sh4a_4a/lowlevel_init.S +++ b/board/alphaproject/ap_sh4a_4a/lowlevel_init.S @@ -330,7 +330,7 @@ init_dbsc3_ctrl_533: DBKIND_A: .long 0xFE800020 DBKIND_D: .long 0x0005 DBCONF_A: .long 0xFE800024 -DBCONF_D: .long 0x0D020901 +DBCONF_D: .long 0x0D020A01 DBTR0_A: .long 0xFE800040 DBTR0_D_533:.long 0x0004 -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/2] Loop block device for sandbox
Dear Pavel Herrmann, On Wednesday 05 of September 2012 14:48:40 Marek Vasut wrote: Dear Pavel Herrmann, [...] besides, I think it'd be much systematic to just scream at user to call sata rescan and bail out instead of doing it for him. i dont actually need a sata rescan, i just need to make sure i have dynamically allocated names Sorry, I can't parse this ... but ... , so i can safely call free() later, otherwise this segfaults when called before sata scan The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is performed. So if you call free() on null pointer, nothing happens. Where's the real problem? if you called sata init before setting all the loops you would get to open(NULL) and a strlen(NULL). i think its easier to supply valid empty string then check for NULL at every access. I'd say check for null on every access ... you'd lower memory requirements and the increase in code requirement should really be very minor. Also, it'd remove the zeroed static variable altogether, correct? Make this info part mandatory. Than you can cut the whole argc loop into simple if argc != 2 ; then fail . And do simple checking for the first letter of the argument being either i or d . wont help, still need argc 3 or 4 Makes is simpler, you can bail out if it's not 3 or 4 still, i should have a sata_loop info work on all files, so theres a valid command with argc 2 Understood. + sata_loop load devnum file - load file from host FS into loop devnum sata_loop is redundant above. really? how do you figure? Run help sata_loop and see the result ... =help sata_loop sata_loop - SATA loopback Usage: sata_loop [info] devnum - show info about loop devnum sata_loop load devnum file - load file from host FS into loop devnum i dont see your problem Ewww ... nevermind ... I just detected yet another stupid issue in the codebase. I'd say this sata_loop should be either omitted and filled by the macro or something. But that's for other time to solve ... so I'm fine with this now. Pavel Herrmann Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Linking error while generating the U-boot build for MPC837XEMDS board
On Tue, 4 Sep 2012 16:37:14 +0530 Brayan Pais brayan.p...@gmail.com wrote: Hi, I am Brayan. I was trying to build the u-boot build for the MPC837XERDB board using Sourcery G++ Lite 2011.03-39 on ubuntu. During the build generation, the source code comilation happens fine, but while linking I am getting the error failed to merge target specific data for few of the files from libgcc.a Attached is the error screenshot. please just cut-n-paste the text next time, it's easier to read. Appreciate any information regarding this. it's probably a toolchain issue - try using the ppc_6xx version provided with the ELDK. Kim ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request for u-boot-marvell.git
-Original Message- From: Simon Guinot [mailto:simon.gui...@sequanux.org] Sent: 05 September 2012 12:57 To: Prafulla Wadaskar Cc: Albert ARIBAUD; 'u-boot@lists.denx.de'; 'wolfg...@theia.denx.de; Ashish Karkare; Prabhanjan Sarnaik Subject: Re: [U-Boot] Pull request for u-boot-marvell.git On Mon, Sep 03, 2012 at 02:20:19AM -0700, Prafulla Wadaskar wrote: Dear Albert, Please pull The following changes since commit 6e2fbdea1b26d75314d87c380a36b0015bf824cf: Wolfgang Denk (1): Merge branch 'ag...@denx.de' of git://git.denx.de/u-boot- staging Hi Prafulla, Do you have some news about the board patches I sent you in early June ? Here are the patchwork urls: http://patchwork.ozlabs.org/patch/163192/ This looks Okay http://patchwork.ozlabs.org/patch/163193/ This change should go differently, ARM Maintainer should pull mach_types, we cannot modify this file locally. http://patchwork.ozlabs.org/patch/163195/ http://patchwork.ozlabs.org/patch/163194/ Thanks in advance. Hi Simon Thanks for pointing this out, I will pull them, but I doubt they will be applicable on latest u-boot, may you please confirm? Or it would be good if you can repost new patch series. Regards... Prafulla . . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] dm: net: Fixup the armada100 FEC driver
Hi Prafulla, On Mon, Sep 3, 2012 at 4:09 AM, Prafulla Wadaskar prafu...@marvell.com wrote: -Original Message- From: Prafulla Wadaskar Sent: 30 July 2012 12:02 To: 'Marek Vasut'; u-boot@lists.denx.de Cc: Joe Hershberger; u-boot...@lists.denx.de Subject: RE: [U-Boot] [PATCH] dm: net: Fixup the armada100 FEC driver -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot- boun...@lists.denx.de] On Behalf Of Marek Vasut Sent: 28 July 2012 01:20 To: u-boot@lists.denx.de Cc: Marek Vasut; Joe Hershberger; u-boot...@lists.denx.de Subject: [U-Boot] [PATCH] dm: net: Fixup the armada100 FEC driver Apply the following questionable adjustment to silence GCC. armada100_fec.c: In function 'armdfec_send': armada100_fec.c:589:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Signed-off-by: Marek Vasut ma...@denx.de Cc: Joe Hershberger joe.hershber...@ni.com --- drivers/net/armada100_fec.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/armada100_fec.c b/drivers/net/armada100_fec.c index d318a36..ed7cf20 100644 --- a/drivers/net/armada100_fec.c +++ b/drivers/net/armada100_fec.c @@ -565,7 +565,7 @@ static int armdfec_send(struct eth_device *dev, void *dataptr, int datasize) struct tx_desc *p_txdesc = darmdfec-p_txdesc; void *p = (void *)dataptr; int retry = PHY_WAIT_ITERATIONS * PHY_WAIT_MICRO_SECONDS; - u32 cmd_sts; + u32 cmd_sts, temp; /* Copy buffer if it's misaligned */ if ((u32)dataptr 0x07) { @@ -586,7 +586,8 @@ static int armdfec_send(struct eth_device *dev, void *dataptr, int datasize) p_txdesc-byte_cnt = datasize; /* Apply send command using high priority TX queue */ - writel((u32)p_txdesc, regs-txcdp[TXQ]); + temp = (u32)regs-txcdp[TXQ]; + writel((u32)p_txdesc, temp); writel(SDMA_CMD_TXDL | SDMA_CMD_TXDH | SDMA_CMD_ERD, regs- sdma_cmd); /* -- Acked-By: Prafulla Wadaskar prafu...@marvell.com Hi Joe May you please pull this patch? It's in my queue on patchwork. I'll try to get to the back-log next week. Cheers! -Joe ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] usb: do explicit unaligned accesses
Dear Lucas Stach, usb_hub_descriptor has to be packed as it's used for communication with the device. Member wHubCharacteristics violates the natural alignment rules. Doesn't apply, can you rebase on u-boot-usb ? I'll apply it then Use explicit unaligned access functions for this member. Fixes ARMv7 traping while using USB. v2: fix typo found by Thomas Langer Signed-off-by: Lucas Stach d...@lynxeye.de --- common/usb_hub.c| 14 +- drivers/usb/host/ehci-hcd.c | 7 +-- 2 Dateien geändert, 14 Zeilen hinzugefügt(+), 7 Zeilen entfernt(-) diff --git a/common/usb_hub.c b/common/usb_hub.c index 53d939c..e4a1201 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -43,6 +43,7 @@ #include common.h #include command.h #include asm/processor.h +#include asm/unaligned.h #include linux/ctype.h #include asm/byteorder.h #include asm/unaligned.h @@ -269,6 +270,7 @@ static int usb_hub_configure(struct usb_device *dev) int i; ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, USB_BUFSIZ); unsigned char *bitmap; + short hubCharacteristics; struct usb_hub_descriptor *descriptor; struct usb_hub_device *hub; #ifdef USB_HUB_DEBUG @@ -304,8 +306,9 @@ static int usb_hub_configure(struct usb_device *dev) } memcpy((unsigned char *)hub-desc, buffer, descriptor-bLength); /* adjust 16bit values */ - hub-desc.wHubCharacteristics = - le16_to_cpu(descriptor-wHubCharacteristics); + put_unaligned(le16_to_cpu(get_unaligned( + descriptor-wHubCharacteristics)), + hub-desc.wHubCharacteristics); /* set the bitmap */ bitmap = (unsigned char *)hub-desc.DeviceRemovable[0]; /* devices not removable by default */ @@ -322,7 +325,8 @@ static int usb_hub_configure(struct usb_device *dev) dev-maxchild = descriptor-bNbrPorts; USB_HUB_PRINTF(%d ports detected\n, dev-maxchild); - switch (hub-desc.wHubCharacteristics HUB_CHAR_LPSM) { + hubCharacteristics = get_unaligned(hub-desc.wHubCharacteristics); + switch (hubCharacteristics HUB_CHAR_LPSM) { case 0x00: USB_HUB_PRINTF(ganged power switching\n); break; @@ -335,12 +339,12 @@ static int usb_hub_configure(struct usb_device *dev) break; } - if (hub-desc.wHubCharacteristics HUB_CHAR_COMPOUND) + if (hubCharacteristics HUB_CHAR_COMPOUND) USB_HUB_PRINTF(part of a compound device\n); else USB_HUB_PRINTF(standalone hub\n); - switch (hub-desc.wHubCharacteristics HUB_CHAR_OCPM) { + switch (hubCharacteristics HUB_CHAR_OCPM) { case 0x00: USB_HUB_PRINTF(global over-current protection\n); break; diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index bfea192..d90e94d 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -22,6 +22,7 @@ */ #include common.h #include asm/byteorder.h +#include asm/unaligned.h #include usb.h #include asm/io.h #include malloc.h @@ -876,10 +877,12 @@ int usb_lowlevel_init(int index, void **controller) debug(Register %x NbrPorts %d\n, reg, descriptor.hub.bNbrPorts); /* Port Indicators */ if (HCS_INDICATOR(reg)) - descriptor.hub.wHubCharacteristics |= 0x80; + put_unaligned(get_unaligned(descriptor.hub.wHubCharacteristics) + | 0x80, descriptor.hub.wHubCharacteristics); /* Port Power Control */ if (HCS_PPC(reg)) - descriptor.hub.wHubCharacteristics |= 0x01; + put_unaligned(get_unaligned(descriptor.hub.wHubCharacteristics) + | 0x01, descriptor.hub.wHubCharacteristics); /* Start the host controller. */ cmd = ehci_readl(ehcic[index].hcor-or_usbcmd); ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 1/4] usb: lowlevel interface change to support multiple controllers
Dear Lucas Stach, Carry an index in the lowlevel usb functions to make specify the respective usb controller. Also pass through an controller struct from lowlevel_init to the creation of the root usb device of this controller. Signed-off-by: Lucas Stach d...@lynxeye.de Reviewed-by: Marek Vasut ma...@denx.de --- arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c | 4 ++-- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 4 ++-- arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 4 ++-- arch/powerpc/cpu/ppc4xx/usb_ohci.c| 4 ++-- arch/sparc/cpu/leon3/usb_uhci.c | 4 ++-- arch/sparc/lib/bootm.c| 2 +- board/mpl/common/usb_uhci.c | 4 ++-- common/usb.c | 10 ++ common/usb_hub.c | 2 +- drivers/usb/host/ehci-hcd.c | 4 ++-- drivers/usb/host/isp116x-hcd.c| 4 ++-- drivers/usb/host/ohci-hcd.c | 4 ++-- drivers/usb/host/r8a66597-hcd.c | 4 ++-- drivers/usb/host/sl811-hcd.c | 4 ++-- drivers/usb/musb/musb_hcd.c | 4 ++-- include/usb.h | 10 +++--- include/usb/mv_udc.h | 2 +- 17 Dateien geändert, 40 Zeilen hinzugefügt(+), 34 Zeilen entfernt(-) V3 ... what changed? V2 ... what changed? diff --git a/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c b/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c index cf0335c..944bb32 100644 --- a/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c +++ b/arch/arm/cpu/arm920t/s3c24x0/usb_ohci.c @@ -1659,7 +1659,7 @@ static void hc_release_ohci(struct ohci *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio(); @@ -1738,7 +1738,7 @@ int usb_lowlevel_init(void) return 0; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power(); diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c index 7647e11..c747767 100644 --- a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c +++ b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c @@ -1565,7 +1565,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { u32 pin_func; u32 sys_freqctrl, sys_clksrc; @@ -1707,7 +1707,7 @@ int usb_lowlevel_init(void) return -1; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ diff --git a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c index 6d91525..607034b 100644 --- a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c +++ b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c @@ -1561,7 +1561,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { /* Set the USB Clock */ @@ -1629,7 +1629,7 @@ int usb_lowlevel_init(void) return 0; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ diff --git a/arch/powerpc/cpu/ppc4xx/usb_ohci.c b/arch/powerpc/cpu/ppc4xx/usb_ohci.c index 14c6a28..4ce2726 100644 --- a/arch/powerpc/cpu/ppc4xx/usb_ohci.c +++ b/arch/powerpc/cpu/ppc4xx/usb_ohci.c @@ -1566,7 +1566,7 @@ static void hc_release_ohci (ohci_t *ohci) */ static char ohci_inited = 0; -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { memset (gohci, 0, sizeof (ohci_t)); memset (urb_priv, 0, sizeof (urb_priv_t)); @@ -1624,7 +1624,7 @@ int usb_lowlevel_init(void) return 0; } -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { /* this gets called really early - before the controller has */ /* even been initialized! */ diff --git a/arch/sparc/cpu/leon3/usb_uhci.c b/arch/sparc/cpu/leon3/usb_uhci.c index 62cc25d..b3b8a4d 100644 --- a/arch/sparc/cpu/leon3/usb_uhci.c +++ b/arch/sparc/cpu/leon3/usb_uhci.c @@ -706,7 +706,7 @@ void handle_usb_interrupt(void) /* init uhci */ -int usb_lowlevel_init(void) +int usb_lowlevel_init(int index, void **controller) { unsigned char temp; ambapp_ahbdev ahbdev; @@ -745,7 +745,7 @@ int usb_lowlevel_init(void) /* stop uhci */ -int usb_lowlevel_stop(void) +int usb_lowlevel_stop(int index) { if (grusb_irq
Re: [U-Boot] [PATCH v3 0/4] USB multi controller
Dear Stephen Warren, On 09/05/2012 05:12 PM, Lucas Stach wrote: V3: Stephen ran into some problems applying this, as it seems my tree wasn't as clean as it should have been. Sorry for the inconvenience. This should now be fixed. Hi all, this is a follow up on the patch USB: EHCI: Initialize multiple USB controllers at once from Jim Lin. It takes some of the code but has undergone some heavy reworking. When we remove the ifdef horror from the above mentioned patch it's mostly a big interface change to the usb subsystem. As this creates a lot of churn I've split this up into a series. Every patch is self contained so it doesn't break compiles and *should* not regress any functionality on it's own. At least the series is bisectable in case anything goes wrong. I've compile tested all the ARM configs. Both the lowlevel usb and ehci interface change are backward compatible, so implementations that only use one controller can choose to ignore the new interface. All implementations are updated to work with the new function prototypes. For Tegra I've included a patch to actually use the new ehci interface. Tom, Stephen, can I get an ACK from you for this, so Marek can take this through his USB tree? All patches now rebased onto u-boot-usb/master. The series, Tested-by: Stephen Warren swar...@nvidia.com For reference, I tested on both Harmony (USB1+USB2 ULPI) and Seaboard (really Springbank) (USB1+USB3). I applied these patches on top of u-boot-usb/master, then merged in u-boot-tegra/next plus a few local patches, and resolved the one minor conflict. For the record so I can find it next time, the way to enable USB keyboard for stdin on Springbank is: setenv stdin serial,usbkbd. Applied whole ting and pushed. Thanks Thanks for rebasing! Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 4/4] cmd_part: add partition-related command
On 09/05/2012 05:51 PM, Rob Herring wrote: On 09/05/2012 05:03 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com This implements the following: part uuid mmc 0:1 - print partition UUID part uuid mmc 0:1 uuid - set environment variable to partition UUID What's the reason to not always both print out and set the uuid env var? Perhaps the env name should be partuuid or part_uuid as you could have uuid's for other purposes? The idea is that if you're running the command interactively, you won't pass a variable name on the command-line, so the command will print out the UUID for you to read. In this case, it's pointless to set any environment variable. However, if you're writing a script, you want to capture the UUID into an environment variable, and it's quite unlikely you want to litter stdout with that content too. Hence, either-or, not both. Note that in the second command above, the final parameter uuid is the environment variable name, so you can save as many UUIDs for different partitions into whatever variables you want; IIRC in the scripts I wrote to use this, I did name the variable root_uuid or somesuch. This can be useful when writing a bootcmd which searches all known devices for something bootable, and then wants the kernel to use the same partition as the root device, e.g.: part uuid ${devtype} ${devnum}:${rootpart} uuid setenv bootargs root=PARTUUID=${uuid} ... It is expected that further part sub-commands will be added later, e.g. to find which partition on a disk is marked bootable, to write new partition tables to disk, etc. A list command would be useful and would be better located here than under scsi or other interface commands. Perhaps instead of printing a single part uuid, you should make a list command that prints all partitions and their UUIDs. That would address my first question. Yes, I wondered about part list mmc 0, which would do essentially the same thing as e.g. mmc dev 0; mmc part, and also expanding the partition printing functions to dump extra information, such as GPT's partition type UUID, partition UUID, and attributes. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 01/10] dm: arm: Remove support for lpc2292
Dear Tom Rini, On Sun, Sep 02, 2012 at 06:15:02PM +0200, Marek Vasut wrote: Dear Wolfgang Denk, Dear Albert, In message 1342882947-9174-1-git-send-email-ma...@denx.de Marek Vasut wrote: This stuff has been rotting in the tree for a year now. Remove it. Signed-off-by: Marek Vasut ma...@denx.de Cc: Wolfgang Denk w...@denx.de Cc: Albert Aribaud albert.u.b...@aribaud.net Cc: U-Boot DM u-boot...@lists.denx.de In case you are going to apply any of these patches, please do make sure to drop the dm: string from all these subjects. At least add some ID so I can mine these patches back when we finish the project. If you drop them, I won't have any way to tell. You shouldn't need any. At the end of the project just do: $ git log --author=(regex|that|catches|everyone) --since=project-start What about me generating gazilion of other patches? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 01/13] Blackfin: BF60x: new processor header files
Hi Wolfgang, Thank you for your review. On Sun, Sep 2, 2012 at 10:10 PM, Wolfgang Denk w...@denx.de wrote: Dear Bob Liu, In message 1345526833-10804-1-git-send-email-lliu...@gmail.com you wrote: Add header files for blackfin new processor bf60x. Signed-off-by: Bob Liu lliu...@gmail.com --- arch/blackfin/include/asm/blackfin_cdef.h |3 + arch/blackfin/include/asm/blackfin_def.h |5 + arch/blackfin/include/asm/blackfin_local.h|3 + arch/blackfin/include/asm/mach-bf609/BF609_cdef.h | 543 +++ arch/blackfin/include/asm/mach-bf609/BF609_def.h | 3758 + arch/blackfin/include/asm/mach-bf609/anomaly.h| 128 + arch/blackfin/include/asm/mach-bf609/def_local.h |5 + arch/blackfin/include/asm/mach-bf609/portmux.h| 257 ++ arch/blackfin/include/asm/mach-bf609/ports.h | 103 + arch/blackfin/include/asm/mach-common/bits/cgu.h | 80 + arch/blackfin/include/asm/mach-common/bits/dde.h | 88 + arch/blackfin/include/asm/mach-common/bits/mpu.h |6 +- arch/blackfin/include/asm/mach-common/bits/pll.h |5 + 13 files changed, 4983 insertions(+), 1 deletion(-) create mode 100644 arch/blackfin/include/asm/mach-bf609/BF609_cdef.h create mode 100644 arch/blackfin/include/asm/mach-bf609/BF609_def.h create mode 100644 arch/blackfin/include/asm/mach-bf609/anomaly.h create mode 100644 arch/blackfin/include/asm/mach-bf609/def_local.h create mode 100644 arch/blackfin/include/asm/mach-bf609/portmux.h create mode 100644 arch/blackfin/include/asm/mach-bf609/ports.h create mode 100644 arch/blackfin/include/asm/mach-common/bits/cgu.h create mode 100644 arch/blackfin/include/asm/mach-common/bits/dde.h Please make sure to have the string PATCH included with all patch submissions, otherwise your patches are lost to patchwork, and most likely to the respective custodian as well. --- /dev/null +++ b/arch/blackfin/include/asm/mach-bf609/BF609_cdef.h ... +#define bfin_read_CGU_STAT() bfin_read32(CGU_STAT) +#define bfin_read_CGU_CLKOUTSEL() bfin_read32(CGU_CLKOUTSEL) +#define bfin_read_CGU_CTL() bfin_read32(CGU_CTL) +#define bfin_write_CGU_CTL(val) bfin_write32(CGU_CTL, val) +#define bfin_read_CGU_DIV() bfin_read32(CGU_DIV) +#define bfin_write_CGU_DIV(val) bfin_write32(CGU_DIV, val) We don't allow CamelCaps identifiers. Please fix globally. Sorry, i didn't get your idea here. +#define CNT_CFG 0xFFC00400 /* CNT0 Configuration Register */ +#define CNT_IMSK0xFFC00404 /* CNT0 Interrupt Mask Register */ +#define CNT_STAT0xFFC00408 /* CNT0 Status Register */ +#define CNT_CMD 0xFFC0040C /* CNT0 Command Register */ +#define CNT_DEBNCE 0xFFC00410 /* CNT0 Debounce Register */ +#define CNT_CNTR0xFFC00414 /* CNT0 Counter Register */ +#define CNT_MAX 0xFFC00418 /* CNT0 Maximum Count Register */ +#define CNT_MIN 0xFFC0041C /* CNT0 Minimum Count Register */ We don't allow register access based on raw addresses or base address plus offset. Please define proper C structs to describe your hardware. Please fix globally. C structs can be defined to access these registers in other place. But this file is come from our hardware team i can't change it. --- /dev/null +++ b/arch/blackfin/include/asm/mach-bf609/anomaly.h @@ -0,0 +1,128 @@ +/* + * DO NOT EDIT THIS FILE + * This file is under version control at + * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/ + * and can be replaced with that version at any time + * DO NOT EDIT THIS FILE This is bullshit. If you submit code to U-Boot, it gets maintained in the U-Boot git repository. Dump this. + * Copyright 2004-2010 Analog Devices Inc. + * Licensed under the ADI BSD license. + * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd Is this GPL compatible?? The link is dead and returns only This topic does not exist yet +#define ANOMALY_0574 (1) Please do not put parens around simple defines. Please fix globally. Will be fixed. Checkpatch throws a ton of errors that all need fixing. Which Checkpatch script are you using? In my test there are only WARNING: line over 80 characters. total: 0 errors, 3546 warnings, 5018 lines checked NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX MULTISTATEMENT_MACRO_USE_DO_WHILE /home/bob/u-boot2/0001-Blackfin-BF60x-new-processor-header-files.patch has style problems, please review. Also note that we don't allow fixed network parameters (like CONFIG_ETHADDR) in board config files. Will be fixed. Review stops here (except for the last part with the licensing stuff). Thank you ! -- Regards, --Bob ___ U-Boot mailing list
Re: [U-Boot] [PATCH v3 2/9] arm: work around assembler bug
Dear Allen Martin, Disable sibling call optimization based on binutils version. This is to work around a bug in the assember in binutils versions 2.22. Branches to weak symbols can be incorrectly optimized in thumb mode to a short branch (b.n instruction) that won't reach when the symbol gets preempted. CC Albert ... Albert, let's pull this in as a part of this series. I'm fine with it. http://sourceware.org/bugzilla/show_bug.cgi?id=12532 Signed-off-by: Allen Martin amar...@nvidia.com --- arch/arm/config.mk | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 3f4453a..24b9d7c 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -87,3 +87,21 @@ endif ifndef CONFIG_NAND_SPL LDFLAGS_u-boot += -pie endif + +# +# FIXME: binutils versions 2.22 have a bug in the assembler where +# branches to weak symbols can be incorrectly optimized in thumb mode +# to a short branch (b.n instruction) that won't reach when the symbol +# gets preempted +# +# http://sourceware.org/bugzilla/show_bug.cgi?id=12532 +# +ifeq ($(CONFIG_SYS_THUMB_BUILD),y) +ifeq ($(GAS_BUG_12532),) +export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \ + then echo y; else echo n; fi) +endif +ifeq ($(GAS_BUG_12532),y) +PLATFORM_RELFLAGS += -fno-optimize-sibling-calls +endif +endif Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] IPL: Remove remains of OneNAND IPL
After removing the Apollon board, remove the OneNAND IPL too. There are no users for it any more. Signed-off-by: Marek Vasut ma...@denx.de Cc: Albert Aribaud albert.u.b...@aribaud.net Cc: Minkyu Kang proms...@gmail.com Cc: Tom Rini tr...@ti.com --- .gitignore |5 - Makefile | 10 -- board/samsung/goni/lowlevel_init.S | 120 board/samsung/smdkc100/lowlevel_init.S | 42 - onenand_ipl/onenand_boot.c | 48 -- onenand_ipl/onenand_ipl.h | 36 onenand_ipl/onenand_read.c | 158 7 files changed, 419 deletions(-) delete mode 100644 onenand_ipl/onenand_boot.c delete mode 100644 onenand_ipl/onenand_ipl.h delete mode 100644 onenand_ipl/onenand_read.c diff --git a/.gitignore b/.gitignore index 2e6fde8..d91e91b 100644 --- a/.gitignore +++ b/.gitignore @@ -75,10 +75,5 @@ cscope.* /ctags /etags -# OneNAND IPL files -/onenand_ipl/onenand-ipl* -/onenand_ipl/board/*/onenand* -/onenand_ipl/board/*/*.S - # spl ais files /spl/*.ais diff --git a/Makefile b/Makefile index 058fb53..971513d 100644 --- a/Makefile +++ b/Makefile @@ -378,7 +378,6 @@ ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin -ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin @@ -550,12 +549,6 @@ nand_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin $(obj)u-boot-nand.bin -onenand_ipl: $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk - $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all - -$(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin - cat $(ONENAND_BIN) $(obj)u-boot.bin $(obj)u-boot-onenand.bin - $(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend $(MAKE) -C spl all @@ -790,9 +783,7 @@ clean: @rm -f $(obj)include/generated/asm-offsets.h @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map} - @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map} @rm -f $(ONENAND_BIN) - @rm -f $(obj)onenand_ipl/u-boot.lds @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map} @rm -f $(obj)MLO @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) @@ -825,7 +816,6 @@ clobber:tidy @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm @rm -fr $(obj)include/generated @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name * -type l -print | xargs rm -f - @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name * -type l -print | xargs rm -f @rm -f $(obj)dts/*.tmp @rm -f $(obj)spl/u-boot-spl{,-pad}.ais diff --git a/board/samsung/goni/lowlevel_init.S b/board/samsung/goni/lowlevel_init.S index 30a5835..1effc9c 100644 --- a/board/samsung/goni/lowlevel_init.S +++ b/board/samsung/goni/lowlevel_init.S @@ -79,11 +79,7 @@ skip_check_didle: str r1, [r0, #0x0] @ GPIO_CON_OFFSET ldr r1, [r0, #0x4] @ GPIO_DAT_OFFSET -#ifdef CONFIG_ONENAND_IPL - orr r1, r1, #(1 1) @ 1 * 1-bit -#else bic r1, r1, #(1 1) -#endif str r1, [r0, #0x4] @ GPIO_DAT_OFFSET /* Don't setup at s5pc100 */ @@ -182,7 +178,6 @@ skip_check_didle: /* Do not release retention here for S5PC110 */ streq r1, [r0] -#ifndef CONFIG_ONENAND_IPL /* Disable Watchdog */ ldreq r0, =S5PC100_WATCHDOG_BASE @ 0xEA20 ldrne r0, =S5PC110_WATCHDOG_BASE @ 0xE270 @@ -193,7 +188,6 @@ skip_check_didle: ldrne r0, =S5PC110_SROMC_BASE ldr r1, =0x9 str r1, [r0] -#endif /* S5PC100 has 3 groups of interrupt sources */ ldreq r0, =S5PC100_VIC0_BASE @ 0xE400 @@ -207,7 +201,6 @@ skip_check_didle: str r3, [r1, #0x14] @ INTENCLEAR str r3, [r2, #0x14] @ INTENCLEAR -#ifndef CONFIG_ONENAND_IPL /* Set all interrupts as IRQ */ str r5, [r0, #0xc] @ INTSELECT str r5, [r1, #0xc] @ INTSELECT @@ -217,120 +210,12 @@ skip_check_didle: str r5, [r0, #0xf00]@ INTADDRESS str r5, [r1, #0xf00]@ INTADDRESS str r5, [r2, #0xf00]@ INTADDRESS -#endif
Re: [U-Boot] [PATCH] [U-BOOT] Zoom2: Ethernet: Enabling LAN9221 chip and CMD_NET.
Dear Tom Rini, On Sat, Mar 31, 2012 at 12:45 PM, Marek Vasut marek.va...@gmail.com wrote: Dear Aldo Brett Cedillo Martinez, Configures GPMC, adds macros to enable net commands, and adds proper initialization to board_eth_init function. Tom, are you OK with applying this patch ? To be clear, lets ask Tom Rix, currently listed maintainer (this is http://patchwork.ozlabs.org/patch/71816/) I'll pick it and push via staging if it's ok with you. I want to have this out of my mane ;-) I have a similar patch to enable ethernet in zoom3 after initial support patch. Signed-off-by: Aldo Brett Cedillo Martinez aldo.cedi...@ti.com --- board/logicpd/zoom2/zoom2.c | 21 + include/configs/omap3_zoom2.h | 10 +- 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/board/logicpd/zoom2/zoom2.c b/board/logicpd/zoom2/zoom2.c index e9f6625..54d3e9f 100644 --- a/board/logicpd/zoom2/zoom2.c +++ b/board/logicpd/zoom2/zoom2.c @@ -60,6 +60,16 @@ static u32 gpmc_serial_TL16CP754C[GPMC_MAX_REG] = { 0x1D0904C4, 0 }; +/* Ethernet GPMC configuration */ +static u32 gpmc_eth[GPMC_MAX_REG] = { + NET_GPMC_CONFIG1, + NET_GPMC_CONFIG2, + NET_GPMC_CONFIG3, + NET_GPMC_CONFIG4, + NET_GPMC_CONFIG5, + NET_GPMC_CONFIG6, 0 +}; + /* Used to track the revision of the board */ static zoom2_revision revision = ZOOM2_REVISION_UNKNOWN; @@ -130,6 +140,12 @@ int board_init (void) enable_gpmc_cs_config(gpmc_config, gpmc_cfg-cs[3], SERIAL_TL16CP754C_BASE, GPMC_SIZE_16M); +#ifdef CONFIG_CMD_NET + gpmc_config = gpmc_eth; + enable_gpmc_cs_config(gpmc_config, gpmc_cfg-cs[7], + CONFIG_SMC911X_BASE, GPMC_SIZE_16M); +#endif /* (CONFIG_CMD_NET) */ + /* board id for Linux */ gd-bd-bi_arch_number = MACH_TYPE_OMAP_ZOOM2; /* boot param addr */ @@ -186,6 +202,11 @@ int board_eth_init(bd_t *bis) #ifdef CONFIG_LAN91C96 rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE); #endif + +#ifdef CONFIG_SMC911X + rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); +#endif + return rc; } #endif diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h index eef95fe..c66d571 100644 --- a/include/configs/omap3_zoom2.h +++ b/include/configs/omap3_zoom2.h @@ -154,7 +154,7 @@ #undef CONFIG_CMD_FPGA /* FPGA configuration Support */ #undef CONFIG_CMD_IMI/* iminfo */ #undef CONFIG_CMD_IMLS /* List all found images */ -#undef CONFIG_CMD_NET/* bootp, tftpboot, rarpboot */ +#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ #undef CONFIG_CMD_NFS/* NFS support */ #define CONFIG_SYS_NO_FLASH @@ -165,6 +165,14 @@ #define CONFIG_SYS_I2C_BUS_SELECT1 #define CONFIG_DRIVER_OMAP34XX_I2C 1 +/* Ethernet */ +#ifdef CONFIG_CMD_NET +#define CONFIG_NET_MULTI +#define CONFIG_SMC911X +#define CONFIG_SMC911X_32_BIT +#define CONFIG_SMC911X_BASE 0x2C00 +#endif /* (CONFIG_CMD_NET) */ + /* * TWL4030 */ Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot