[PATCH] usb: dwc3-generic: Ensure reset GPIO is configured as an output
GPIOD_ACTIVE_LOW is not enough to configure a GPIO as an output, we need GPIOD_IS_OUT as well. Fixes: b252d79b0936d60b ("usb: dwc3: Add support to reset usb ULPI phy") Signed-off-by: Peter Korsgaard --- drivers/usb/dwc3/dwc3-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index 66da5a8d6f..35e4b36a69 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -105,7 +105,7 @@ static int dwc3_generic_probe(struct udevice *dev, if (CONFIG_IS_ENABLED(DM_GPIO) && device_is_compatible(dev->parent, "xlnx,zynqmp-dwc3")) { priv->ulpi_reset = devm_gpiod_get_optional(dev->parent, "reset", - GPIOD_ACTIVE_LOW); + GPIOD_IS_OUT | GPIOD_ACTIVE_LOW); /* property is optional, don't return error! */ if (priv->ulpi_reset) { /* Toggle ulpi to reset the phy. */ -- 2.30.2
Re: [U-Boot] [linux-sunxi] Re: [PATCH 1/3] dm: Add migration plan for CONFIG_BLK
>>>>> "Tom" == Tom Rini <tr...@konsulko.com> writes: Hi, >> That seems like a good idea to me. > I've lamented before (and I think others have too) that it's really a > shame that gcc treats arm32 and arm64 as totally distinct builds (and > where clang is a win). But I don't think we can require people to have > both an arm and an aarch64 compiler available in order to build U-Boot > for some aarch64. No, please not. It would make it very hard to handle U-Boot builds in Buildroot for these boards. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [linux-sunxi] Re: [PATCH v3 1/5] sunxi: a64: Enable FIT Signature
>>>>> "Jagan" == Jagan Teki <jagannadh.t...@gmail.com> writes: > On Wed, Dec 13, 2017 at 9:38 PM, Peter Korsgaard <pe...@korsgaard.com> wrote: >>>>>>> "Maxime" == Maxime Ripard <maxime.rip...@free-electrons.com> writes: >> >> Hi, >> >> >> +++ b/arch/arm/mach-sunxi/Kconfig >> >> @@ -179,6 +179,7 @@ config MACH_SUN50I >> >> select SUNXI_DRAM_DW_32BIT >> >> select FIT >> >> select SPL_LOAD_FIT >> >> + imply FIT_SIGNATURE >> >> > I'm really not sure we should force it by default. How much code size >> > is it adding? >> >> Not only that, enabling FIT_SIGNATURE support disables support for the >> legacy images (uImage / boot.scr) for security reasons, so it may very >> well break existing setups. > Sorry, I didn't get why legacy images will disable with fit? It > depends how user can go with it, whether he want legacy or fit both > will work. Not when you enable CONFIG_FIT_SIGNATURE. That option disables support for the legacy images. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [linux-sunxi] Re: [PATCH v3 1/5] sunxi: a64: Enable FIT Signature
>>>>> "Maxime" == Maxime Ripard <maxime.rip...@free-electrons.com> writes: Hi, >> +++ b/arch/arm/mach-sunxi/Kconfig >> @@ -179,6 +179,7 @@ config MACH_SUN50I >> select SUNXI_DRAM_DW_32BIT >> select FIT >> select SPL_LOAD_FIT >> + imply FIT_SIGNATURE > I'm really not sure we should force it by default. How much code size > is it adding? Not only that, enabling FIT_SIGNATURE support disables support for the legacy images (uImage / boot.scr) for security reasons, so it may very well break existing setups. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] Permission denied make: *** [core-dependencies] Error 126 in Buildroot-2015.08.1
>>>>> "pc" == pc ramachandra <pc.ramachan...@gmail.com> writes: > Hai, > I am using buildroot-2015.08.1 tool, Mainly i am used Buildroot questions should go to the Buildroot list (buildr...@buildroot.org). > make distclean > make xilinx_zc706_defconfig > make menuconfig > make > then these error occurred below things > root@caravel:/home/ram/Desktop/buildroot-2015.08.1# make > make: execvp: > /home/ram/Desktop/buildroot-2015.08.1/support/scripts/setlocalversion: > Permission denied > /bin/bash: support/gnuconfig/config.guess: Permission denied > /bin/bash: support/dependencies/check-host-tar.sh: Permission denied > /bin/bash: support/dependencies/check-host-xzcat.sh: Permission denied > /bin/bash: > /home/ram/Desktop/buildroot-2015.08.1/support/dependencies/dependencies.sh: > Permission denied It sounds like your permissions are screwed up. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] sunxi: display: Use PWM to drive backlight where applicable
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: > When the backlight's pwm input is connected to a pwm output of the SoC, > actually use pwm to drive the backlight. > The mean reason for doing this is to fix the backlight turning off > for aprox. 1 second while the kernel is booting. This is caused by > the kernel actually using pwm to drive the backlight, so that it > can dim the backlight. First the pwm driver loads and switches the > pinmux for the pin driving the backlight's pwm input to the pwm > controller. Then about 1s later the actual backlight driver loads > and tells the pwm driver to actually update the pwm settings, which > have a power-on-reset value of "off". > An additional advantage is that this allows us to initatiate the > backlight at 80%, which is the kernel default, avoiding a brightness > change while the kernel loads. > +++ b/drivers/video/sunxi_display.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -34,7 +35,6 @@ > #define PWM_ON 1 > #define PWM_OFF 0 > #endif > - Unrelated white space change. Other than that: Reviewed by: Peter Korsgaard <pe...@korsgaard.com> -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: display: Use PWM to drive backlight where applicable
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: > When the backlight's pwm input is connected to a pwm output of the SoC, > actually use pwm to drive the backlight. > The mean reason for doing this is to fix the backlight turning off > for aprox. 1 second while the kernel is booting. This is caused by > the kernel actually using pwm to drive the backlight, so that it > can dim the backlight. First the pwm driver loads and switches the > pinmux for the pin driving the backlight's pwm input to the pwm > controller. Then about 1s later the actual backlight driver loads > and tells the pwm driver to actually update the pwm settings, which > have a power-on-reset value of "off". > An additional advantage is that this allows us to initatiate the > backlight at 80%, which is the kernel default, avoiding a brightness > change while the kernel loads. Nice! > Signed-off-by: Hans de Goede <hdego...@redhat.com> > --- > arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 1 + > arch/arm/include/asm/arch-sunxi/gpio.h | 1 + > arch/arm/include/asm/arch-sunxi/pwm.h | 27 +++ > drivers/video/sunxi_display.c | 12 +++- > 4 files changed, 40 insertions(+), 1 deletion(-) > create mode 100644 arch/arm/include/asm/arch-sunxi/pwm.h > diff --git a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h > b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h > index cd009d7..a5f396e 100644 > --- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h > +++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h > @@ -76,6 +76,7 @@ > #define SUNXI_INTC_BASE 0x01c20400 > #define SUNXI_PIO_BASE 0x01c20800 > #define SUNXI_TIMER_BASE0x01c20c00 > +#define SUNXI_PWM_BASE 0x01c20e00 > #define SUNXI_SPDIF_BASE0x01c21000 > #define SUNXI_AC97_BASE 0x01c21400 > #define SUNXI_IR0_BASE 0x01c21800 > diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h > b/arch/arm/include/asm/arch-sunxi/gpio.h > index bff7d14..ef426ae 100644 > --- a/arch/arm/include/asm/arch-sunxi/gpio.h > +++ b/arch/arm/include/asm/arch-sunxi/gpio.h > @@ -150,6 +150,7 @@ enum sunxi_gpio_number { > #define SUN6I_GPA_SDC3 4 > #define SUN8I_H3_GPA_UART0 2 > +#define SUN4I_GPB_PWM 2 Using this define for the ! SUN4I / SUN5I case is a bit icky (even if they today happen to be the same numerical value). Perhaps introduce a SUNXI_PWM_MODE indirection like you do for SUNXI_PWM_PIN0 would be nicer. > #define SUN4I_GPB_TWI0 2 > #define SUN4I_GPB_TWI1 2 > #define SUN5I_GPB_TWI1 2 > diff --git a/arch/arm/include/asm/arch-sunxi/pwm.h > b/arch/arm/include/asm/arch-sunxi/pwm.h > new file mode 100644 > index 000..ec997a6 > --- /dev/null > +++ b/arch/arm/include/asm/arch-sunxi/pwm.h > @@ -0,0 +1,27 @@ > +/* > + * (C) Copyright 2016 Hans de Goede <hdego...@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#ifndef _SUNXI_PWM_H > +#define _SUNXI_PWM_H > + > +#define SUNXI_PWM_CTRL_REG (SUNXI_PWM_BASE + 0) > +#define SUNXI_PWM_CH0_PERIOD(SUNXI_PWM_BASE + 4) > + > +#define SUNXI_PWM_CTRL_PRESCALE0(x) ((x) & 0xf) > +#define SUNXI_PWM_CTRL_ENABLE0 (0x5 << 4) > +#define SUNXI_PWM_CTRL_POLARITY0(x) ((x) << 5) > + > +#define SUNXI_PWM_PERIOD_80PCT 0x04af03c0 > + > +#if defined CONFIG_MACH_SUN4I || defined CONFIG_MACH_SUN5I > +#define SUNXI_PWM_PIN0 SUNXI_GPB(2) > +#endif > + This should afaik work for sun6i as well if you add: #if defined CONFIG_MACH_SUN6I #define SUNXI_PWM_PIN0 SUNXI_GPH(13) #endif E.G. the Yones Toptech BS1078v2 uses this. I'll try to find some time to test it. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] SPL: sunxi: don't force .BSS into DRAM
>>>>> "Andre" == Andre Przywara <andre.przyw...@arm.com> writes: Hi, > I really don't know. This simple bug has cost me at least two hours > yesterday, since it was the rather innocent access to a variable that > caused the issue. And if it wouldn't have been for Siarhei to point me > in the right direction I'd have spend even more time to find a fix. Agreed. The toolchain will complain loudly about an overflow of SRAM space, but not about BSS access before DRAM is available. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] musb: sunxi: Do not allocate musb struct multiple times
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: > The probe function of the musb host driver can be called multiple > times. The code assumes that it can safe the pointer to the allocated > musb struct in the driver model priv_auto_alloc data, but this data > gets free-ed on a probe failure or on removal, so we must safe the > pointer elsewhere. s/safe/save/ (twice). Otherwise it looks sensibe to me. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] sunxi: Add defconfig for yones toptech bs1078-v2 tablet
The yones toptech bs1078-v2 is a 10.1" tablet without any clear markings on the outside, but 'YONESTOPTECH-BS1078' written on the PCB silkscreen. It features a 16:9 1024:600 LCD, A31s SoC, 1GB RAM, 8G NAND, silead gsl3675 touchscreen and a RTL8723AS wifi chip: https://linux-sunxi.org/Yones_Toptech_BS1078_V2 Signed-off-by: Peter Korsgaard <pe...@korsgaard.com> --- board/sunxi/MAINTAINERS | 5 + configs/Yones_Toptech_BS1078_V2_defconfig | 24 2 files changed, 29 insertions(+) create mode 100644 configs/Yones_Toptech_BS1078_V2_defconfig diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 5ae5ce6..4370303 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -211,3 +211,8 @@ YONES TOPTECH BD1078 BOARD M: Paul Kocialkowski <cont...@paulk.fr> S: Maintained F: configs/Yones_Toptech_BD1078_defconfig + +YONES TOPTECH BS1078 V2 BOARD +M: Peter Korsgaard <pe...@korsgaard.com> +S: Maintained +F: configs/Yones_Toptech_BS1078_V2_defconfig diff --git a/configs/Yones_Toptech_BS1078_V2_defconfig b/configs/Yones_Toptech_BS1078_V2_defconfig new file mode 100644 index 000..26f5923 --- /dev/null +++ b/configs/Yones_Toptech_BS1078_V2_defconfig @@ -0,0 +1,24 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_MACH_SUN6I=y +CONFIG_DRAM_CLK=420 +CONFIG_DRAM_ZQ=251 +CONFIG_MMC0_CD_PIN="PA8" +CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" +CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" +CONFIG_USB0_ID_DET="PA15" +CONFIG_AXP_GPIO=y +CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:24,pclk_khz:7,le:120,ri:180,up:17,lo:15,hs:20,vs:3,sync:3,vmode:0" +CONFIG_VIDEO_LCD_DCLK_PHASE=0 +CONFIG_VIDEO_LCD_BL_EN="PA25" +CONFIG_VIDEO_LCD_BL_PWM="PH13" +CONFIG_VIDEO_LCD_PANEL_LVDS=y +CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-yones-toptech-bs1078-v2" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +CONFIG_CMD_GPIO=y +CONFIG_AXP_DLDO1_VOLT=3300 +CONFIG_USB_MUSB_HOST=y -- 2.7.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Add CONFIG_GMAC_TX_DELAY=4 for OlinuXino Lime2
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: >> So what happens if you connect two of these boards together without a >> switch in between? Will they be able to autonegotiate? > Likely not, but without this fix, they would and they would have an > unreliable connection. Arguably no connection is better then an > unreliable one. True. -- Venlig hilsen, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Add CONFIG_GMAC_TX_DELAY=4 for OlinuXino Lime2
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: Hi, > Oh good catch, so I believe that we should submit a patch to the u-boot > realtek phy driver which: > 1) Adds a seperate init function for the RTL8211C > 2) In that function set the force master mode bit and then >call the init function currently used for RTL8211C and others, >this assumes that the more generic init function will not reset >the force master mode bit. So what happens if you connect two of these boards together without a switch in between? Will they be able to autonegotiate? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] omap4_panda: Convert to config_distro_bootcmd.h
On Thu, Dec 10, 2015 at 10:46 PM, Tom Rini <tr...@konsulko.com> wrote: > Based on the am335x_evm conversion, switch to config_distro_bootcmd for > mmc and pxe. Tested with Fedora 23. > > Signed-off-by: Tom Rini <tr...@konsulko.com> > --- > include/configs/ti_omap4_common.h | 51 > - > 1 file changed, 27 insertions(+), 24 deletions(-) > > diff --git a/include/configs/ti_omap4_common.h > b/include/configs/ti_omap4_common.h [snip] > -#define CONFIG_BOOTCOMMAND \ > - "run findfdt; " \ > - "mmc dev ${mmcdev}; if mmc rescan; then " \ > - "echo SD/MMC found on device ${mmcdev};" \ > - "if run loadbootscript; then " \ > - "run bootscript; " \ > - "else " \ > - "if run loadbootenv; then " \ > - "run importbootenv; " \ > - "fi;" \ > - "if test -n ${uenvcmd}; then " \ > - "echo Running uenvcmd ...;" \ > - "run uenvcmd;" \ > - "fi;" \ > - "fi;" \ > - "if run loadimage; then " \ > - "run loadfdt;" \ > - "run mmcboot; " \ > - "fi; " \ This breaks legacy boot on pandaboard here. In Buildroot we have the kernel + dtb in partition 0:2 and no custom boot script, which used to be handled by the loadimage stuff, but that is no longer called. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] sunxi: Sync dts files with the upstream kernel
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: > Sync dts files with the upstream kernel including > changes queued for 4.6: > https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/dt-for-4.6 > Note this adds a number of new unused board dts files. I've asked the > authors of the kernel commits adding these to submit a matching defconfig > to u-boot. > dts => sun6i-a31s-yones-toptech-bs1078-v2.dts} | 180 --- FYI, I've done some work for this one. I'll send a defconfig this week. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] ARM: sheevaplug: misc fixes
>>>>> "Luka" == Luka Perkov <luka.per...@sartura.hr> writes: Hi, >> What happened to this? I don't see it 2016.03 or in >> http://git.denx.de/?p=u-boot/u-boot-marvell.git for that matter. > I think we lost these by accident when Stefan joined the team as well. > I'll send the pull request shortly. Thanks! -- Venlig hilsen, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/4] ARM: sheevaplug: misc fixes
>>>>> "Luka" == Luka Perkov <luka.per...@sartura.hr> writes: Hi, > On Sun, Jan 17, 2016 at 06:23:41PM +0100, Peter Korsgaard wrote: >> The following patch series fixes a number of issues I noticed while updating >> a sheevaplug from 2013.10 to 2016.01: >> >> Peter Korsgaard (4): >> ARM: sheevaplug: unbreak default environment >> ARM: sheevaplug: unbreak kernel bootargs / mtdparts command by dropping >> double mtdparts= >> ARM: sheevaplug: drop unneded 'usb start' from boot command >> ARM: sheevaplug: correct nand partition layout > Queued in marvell master. Thanks! What happened to this? I don't see it 2016.03 or in http://git.denx.de/?p=u-boot/u-boot-marvell.git for that matter. -- Venlig hilsen, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: power: add support for sy8106a driver
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: > From: Jelle van der Waa <je...@vdwaa.nl> > SY8106A is a PMIC which is used on the Allwinner > H3 Orange Pi Pc board. The VOUT1_SEL register is > implemented to set thea default V-CPU voltage to 1200 mV. > Signed-off-by: Jelle van der Waa <je...@vdwaa.nl> > [hdego...@redhat.com: Polish Kconfig parts a bit] > Signed-off-by: Hans de Goede <hdego...@redhat.com> > --- > board/sunxi/Kconfig| 6 +- > board/sunxi/board.c| 5 + > configs/orangepi_pc_defconfig | 1 - > drivers/power/Kconfig | 18 +- > drivers/power/Makefile | 1 + > drivers/power/sy8106a.c| 23 +++ > include/configs/sunxi-common.h | 6 -- > include/sy8106a.h | 5 + > 8 files changed, 60 insertions(+), 5 deletions(-) > create mode 100644 drivers/power/sy8106a.c > create mode 100644 include/sy8106a.h > diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig > index a334aa3..449d9dd 100644 > --- a/board/sunxi/Kconfig > +++ b/board/sunxi/Kconfig > @@ -372,11 +372,15 @@ config I2C3_ENABLE > See I2C0_ENABLE help text. > endif > +if SUNXI_GEN_SUN6I > config R_I2C_ENABLE > bool "Enable the PRCM I2C/TWI controller" > -default n > +# This is used for the pmic on H3 > +default y if MACH_SUN8I_H3 > +default n if !MACH_SUN8I_H3 Default is 'n', so the last line can be removed. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Banan Pro (ahci-sunxi) SATA port stopped working after switching to U-Boot v2016.01
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: Hi, > Thanks for debugging this, according to the Bananapro schematic > VDD25-SATA either comes from a dedicated WL2003E25-5 linear regulator, > or it is connected to LDO4 via a 0 Ohm resistor. > So it would seem that in practice it seems that LDO4 is used, can you > give the attached patch a try ? >> From b931b7bd6ec02ffa32f155d381c16210819a16ea Mon Sep 17 00:00:00 2001 > From: Hans de Goede <hdego...@redhat.com> > Date: Fri, 22 Jan 2016 14:55:47 +0100 > Subject: [PATCH] sunxi: Bananapro: Set LDO4 to 2.5V > According to the Bananapro VDD25-SATA either comes from a dedicated You forgot 'schematics'. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/4] ARM: sheevaplug: correct nand partition layout
>>>>> "Tom" == Tom Rini <tr...@konsulko.com> writes: Hi, >> #define CONFIG_EXTRA_ENV_SETTINGS"x_bootargs=console"\ >> "=ttyS0,115200 mtdparts="CONFIG_MTDPARTS\ >> - "x_bootcmd_kernel=nand read 0x640 0x10 0x30\0" \ >> + "x_bootcmd_kernel=nand read 0x640 0x10 0x40\0" \ >> "x_bootcmd_usb=usb start\0" \ >> "x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0" > Can I suggest future proofing this by using the names set in MTDPARTS > instead of direct offsets? Thanks! True. I wanted to do as minimal change as possible, but I'll take a look at using mtdparts and send a patch. Thanks. -- Venlig hilsen, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/4] ARM: sheevaplug: misc fixes
Hi, The following patch series fixes a number of issues I noticed while updating a sheevaplug from 2013.10 to 2016.01: Peter Korsgaard (4): ARM: sheevaplug: unbreak default environment ARM: sheevaplug: unbreak kernel bootargs / mtdparts command by dropping double mtdparts= ARM: sheevaplug: drop unneded 'usb start' from boot command ARM: sheevaplug: correct nand partition layout -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4] ARM: sheevaplug: correct nand partition layout
Commit 1e3d640316 (ARM: sheevaplug: redefine MTDPARTS) changed the partition layout (without any description why), but didn't change the offset/size to load the kernel from or the root=/dev/mtdblockX in the bootargs. The 3MB forseen for a kernel is furthermore too little. A 4.4 build of mvebu_v5_defconfig is 3.6MB: -rw-r--r-- 1 peko peko 3.6M Jan 16 20:24 uImage.kirkwood-sheevaplug When device tree support for sheevaplug was added to the kernel in commit ee514b381e (ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug) a default flash partition layout (used if mtdparts= isn't passed on the command line / CONFIG_MTD_CMDLINE_PARTS isn't enabled) with 1MB for u-boot / environment, 4MB for the kernel and the rest for the rootfs, so use that layout here and adjust the kernel loading to match. Signed-off-by: Peter Korsgaard <pe...@korsgaard.com> --- include/configs/sheevaplug.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h index c529636..f9fb9bc 100644 --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h @@ -64,12 +64,12 @@ #define CONFIG_MTDPARTS\ "orion_nand:512K(uboot)," \ - "512K(env),1M(script),6M(kernel)," \ - "12M(ramdisk),4M(spare),-(rootfs)\0" + "512K(env),4M(kernel)," \ + "-(rootfs)\0" #define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console"\ "=ttyS0,115200 mtdparts="CONFIG_MTDPARTS\ - "x_bootcmd_kernel=nand read 0x640 0x10 0x30\0" \ + "x_bootcmd_kernel=nand read 0x640 0x10 0x40\0" \ "x_bootcmd_usb=usb start\0" \ "x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0" -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/4] ARM: sheevaplug: unbreak default environment
Commit 1e3d640316 (ARM: sheevaplug: redefine MTDPARTS) changed the mtdparts part of the default environment, but dropped the trailing zero termination - So the definition of x_bootcmd_kernel becomes part of the x_bootargs variable. Fix it by reintroducing the zero termination. Signed-off-by: Peter Korsgaard <pe...@korsgaard.com> --- include/configs/sheevaplug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h index ebc3d64..7d773a8 100644 --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h @@ -65,7 +65,7 @@ #define CONFIG_MTDPARTS\ "mtdparts=orion_nand:512K(uboot)," \ "512K(env),1M(script),6M(kernel)," \ - "12M(ramdisk),4M(spare),-(rootfs)" + "12M(ramdisk),4M(spare),-(rootfs)\0" #define CONFIG_EXTRA_ENV_SETTINGS "x_bootargs=console"\ "=ttyS0,115200 mtdparts="CONFIG_MTDPARTS\ -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4] ARM: sheevaplug: unbreak kernel bootargs / mtdparts command by dropping double mtdparts=
Commit 1e3d640316 (ARM: sheevaplug: redefine MTDPARTS) prepended mtdparts= to the flash partition information in CONFIG_MTDPARTS, but it is used like "mtdparts=" CONFIG_MTDPARTS - So we end up passing mtdparts=mtdparts=.. to the kernel, confusing the cmdline partition parser. Fix it by dropping the double 'mtdparts='. Signed-off-by: Peter Korsgaard <pe...@korsgaard.com> --- include/configs/sheevaplug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h index 7d773a8..8110f83 100644 --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h @@ -63,7 +63,7 @@ "${x_bootcmd_usb}; bootm 0x640;" #define CONFIG_MTDPARTS\ - "mtdparts=orion_nand:512K(uboot)," \ + "orion_nand:512K(uboot)," \ "512K(env),1M(script),6M(kernel)," \ "12M(ramdisk),4M(spare),-(rootfs)\0" -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4] ARM: sheevaplug: drop unneded 'usb start' from boot command
The default bootcommand executes x_bootcmd_usb AFTER loading a kernel from nand and just before executing it, which only slows down boot without adding any functionality - So drop it. Signed-off-by: Peter Korsgaard <pe...@korsgaard.com> --- include/configs/sheevaplug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h index 8110f83..c529636 100644 --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h @@ -60,7 +60,7 @@ */ #define CONFIG_BOOTCOMMAND "${x_bootcmd_kernel}; " \ "setenv bootargs ${x_bootargs} ${x_bootargs_root}; "\ - "${x_bootcmd_usb}; bootm 0x640;" + "bootm 0x640;" #define CONFIG_MTDPARTS\ "orion_nand:512K(uboot)," \ -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: Remove Orangepi PC RAM speed to 624 MHz
>>>>> "Hans" == Hans de Goede <hdego...@redhat.com> writes: > There are some reports of stability issues at 672 MHz, see: > http://linux-sunxi.org/Orange_Pi_PC#DRAM_clock_speed_limit > So reduce the DRAM speed to 624MHz which seems to be reliable everywhere. With the subject s/Remove/Reduce/ Acked-by: Peter Korsgaard <pe...@korsgaard.com> > Signed-off-by: Hans de Goede <hdego...@redhat.com> > --- > configs/orangepi_pc_defconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > diff --git a/configs/orangepi_pc_defconfig b/configs/orangepi_pc_defconfig > index 75afca9..358caa5 100644 > --- a/configs/orangepi_pc_defconfig > +++ b/configs/orangepi_pc_defconfig > @@ -1,7 +1,7 @@ > CONFIG_ARM=y > CONFIG_ARCH_SUNXI=y > CONFIG_MACH_SUN8I_H3=y > -CONFIG_DRAM_CLK=672 > +CONFIG_DRAM_CLK=624 > CONFIG_DRAM_ZQ=3881979 > CONFIG_DRAM_ODT_EN=y > # CONFIG_VIDEO is not set > -- > 2.5.0 > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] dm: Add timeline and guide for porting serial drivers
>>>>> "Simon" == Simon Glass <s...@chromium.org> writes: > Add a README with a brief guide to porting serial drivers over to use > driver model. > Add a timeline also. All serial drivers should be converted by the end > of January 2015. 2015? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Location of Titanium board
Stefan == Stefan Roese s...@denx.de writes: Hi, Stefan Yes, would make sense. At the time I worked on this BSP, nearly all mx6 Stefan boards were placed in the freescale board directory. I'll create a patch Stefan to move this BSP into a barco board directory instead. Sounds good, thanks. -- Bye, Peter Korsgaard This message is subject to the following terms and conditions: MAIL DISCLAIMERhttp://www.barco.com/en/maildisclaimer ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx6: titanium: Move BSP code to barco board directory
Stefan == Stefan Roese s...@denx.de writes: Stefan Since the titanium board is not a Freescale board, move its Stefan BSP code from the freescale board directory to the newly created Stefan barco board directory. Stefan Signed-off-by: Stefan Roese s...@denx.de Stefan Cc: Peter Korsgaard peter.korsga...@barco.com Stefan Cc: Stefano Babic sba...@denx.de Acked-by: Peter Korsgaard peter.korsga...@barco.com Stefan --- Stefan board/{freescale = barco}/titanium/Makefile | 0 Stefan board/{freescale = barco}/titanium/imximage.cfg | 0 Stefan board/{freescale = barco}/titanium/titanium.c | 0 Stefan boards.cfg | 2 +- Stefan 4 files changed, 1 insertion(+), 1 deletion(-) Stefan rename board/{freescale = barco}/titanium/Makefile (100%) Stefan rename board/{freescale = barco}/titanium/imximage.cfg (100%) Stefan rename board/{freescale = barco}/titanium/titanium.c (100%) Stefan diff --git a/board/freescale/titanium/Makefile b/board/barco/titanium/Makefile Stefan similarity index 100% Stefan rename from board/freescale/titanium/Makefile Stefan rename to board/barco/titanium/Makefile Stefan diff --git a/board/freescale/titanium/imximage.cfg b/board/barco/titanium/imximage.cfg Stefan similarity index 100% Stefan rename from board/freescale/titanium/imximage.cfg Stefan rename to board/barco/titanium/imximage.cfg Stefan diff --git a/board/freescale/titanium/titanium.c b/board/barco/titanium/titanium.c Stefan similarity index 100% Stefan rename from board/freescale/titanium/titanium.c Stefan rename to board/barco/titanium/titanium.c Stefan diff --git a/boards.cfg b/boards.cfg Stefan index 5e10125..afe398d 100644 Stefan --- a/boards.cfg Stefan +++ b/boards.cfg Stefan @@ -304,7 +304,7 @@ Active arm armv7 mx6 freescale mx6qsabreauto Stefan Active arm armv7 mx6 freescale mx6sabresd mx6dlsabresd mx6sabresd:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL Fabio Estevam fabio.este...@freescale.com Stefan Active arm armv7 mx6 freescale mx6sabresd mx6qsabresd mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q Fabio Estevam fabio.este...@freescale.com Stefan Active arm armv7 mx6 freescale mx6slevkmx6slevk mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL Fabio Estevam fabio.este...@freescale.com Stefan -Active arm armv7 mx6 freescale titaniumtitanium titanium:IMX_CONFIG=board/freescale/titanium/imximage.cfg Stefan Roese s...@denx.de Stefan +Active arm armv7 mx6 barco titaniumtitanium titanium:IMX_CONFIG=board/barco/titanium/imximage.cfg Stefan Roese s...@denx.de Stefan Active arm armv7 omap3 - overo omap3_overo - Steve Sakoman sako...@gmail.com Stefan Active arm armv7 omap3 - pandora omap3_pandora- Grazvydas Ignotas nota...@gmail.com Stefan Active arm armv7 omap3 8dtech eco5pk eco5pk - Raphael Assenat r...@8d.com Stefan -- Stefan 1.8.4.2 -- Sorry about disclaimer - It's out of my control. Bye, Peter Korsgaard This message is subject to the following terms and conditions: MAIL DISCLAIMERhttp://www.barco.com/en/maildisclaimer ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 5/5] board/ti/am335x/README: update for NAND boot
Pekon == Pekon Gupta pe...@ti.com writes: Pekon NAND boot mode on AM335x EVM has been verified, and steps Pekon to use it has been documented and update in this README Pekon Signed-off-by: Pekon Gupta pe...@ti.com Pekon --- Pekon board/ti/am335x/README | 59 +++--- Pekon 1 file changed, 42 insertions(+), 17 deletions(-) Pekon diff --git a/board/ti/am335x/README b/board/ti/am335x/README Pekon index 67b5246..d34cbab 100644 Pekon --- a/board/ti/am335x/README Pekon +++ b/board/ti/am335x/README Pekon @@ -20,23 +20,48 @@ NAND Pekon The AM335x GP EVM ships with a 256MiB NAND available in most profiles. In Pekon this example to program the NAND we assume that an SD card has been Pekon inserted with the files to write in the first SD slot and that mtdparts Pekon -have been configured correctly for the board. As a time saving measure we Pekon -load MLO into memory in one location, copy it into the three locatations Pekon -that the ROM checks for additional valid copies, then load U-Boot into Pekon -memory. We then write that whole section of memory to NAND. Pekon - Pekon -U-Boot # mmc rescan Pekon -U-Boot # env default -f -a Pekon -U-Boot # nand erase.chip Pekon -U-Boot # saveenv Pekon -U-Boot # load mmc 0 8100 MLO Pekon -U-Boot # cp.b 8100 8102 2 Pekon -U-Boot # cp.b 8100 8104 2 Pekon -U-Boot # cp.b 8100 8106 2 Pekon -U-Boot # load mmc 0 8108 u-boot.img Pekon -U-Boot # nand write 8100 0 26 Pekon -U-Boot # load mmc 0 ${loadaddr} uImage Pekon -U-Boot # nand write ${loadaddr} kernel 50 Pekon +have been configured correctly for the board. All images are firstl loaded s/firstl/first/ Pekon +into memory, then written to NAND. Pekon + Pekon +Step-1: Building u-boot for NAND boot Pekon + Set following CONFIGxx options for NAND device. Pekon + CONFIG_SYS_NAND_PAGE_SIZE number of main bytes in NAND page Pekon + CONFIG_SYS_NAND_OOBSIZE number of OOB bytes in NAND page Pekon + CONFIG_SYS_NAND_BLOCK_SIZE number of bytes in NAND erase-block Pekon + CONFIG_SYS_NAND_ECCPOS ECC map for NAND page Pekon + CONFIG_SYS_NAND_ECCSCHEME ECC scheme used by NAND Pekon + 0 - HAM1_SW Pekon + 1 - HAM1_HW Pekon + 2 - BCH4_SW (unsupported) Pekon + 3 - BCH4_HW (unsupported) Pekon + 4 - BCH8_SW Pekon + 5 - BCH8_HW Pekon + Pekon +Step-2: Flashing NAND via MMC/SD Pekon + # select BOOTSEL to MMC/SD boot and boot from MMC/SD card Pekon + U-Boot # mmc rescan Pekon + # erase flash Pekon + U-Boot # nand erase.chip Pekon + U-Boot # env default -f -a Pekon + U-Boot # saveenv Pekon + # flash MLO. redundant copies of MLO are kept for backup s/redundant/Redundant/ s/backup/failsafe/ Otherwise it looks good. Acked-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/5] am335x_evm: Correct DFU ALT settings for falcon mode
Tom == Tom Rini tr...@ti.com writes: Tom Now that we have falcon mode enabled, the partiton numbers for NAND have Tom changed, and we need to list entries for updating these parts of the Tom system. While adding falcon mode entires for eMMC (raw), we round up Tom the limit on U-Boot for ease of math later. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/5] am335x_evm: Update eMMC falcon mode locations
Tom == Tom Rini tr...@ti.com writes: Tom The previous location used for the args portion of falcon mode was too Tom small to allow for a device tree to be saved there, so move the location Tom slightly and increase the size. In addition, our previous kernel Tom location was part of the area we set aside for U-Boot itself, so move it Tom up a bit higher. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 5/5] am335x_evm: Add basic README
Tom == Tom Rini tr...@ti.com writes: Tom Add a README for the family of boards the am335x_evm covers, and include Tom instructions on preparing and using falcon mode, for various media. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] README.falcon: Note how we determine if we can boot the OS or not
Tom == Tom Rini tr...@ti.com writes: Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk Tom --- Tom doc/README.falcon |2 ++ Tom 1 file changed, 2 insertions(+) Tom diff --git a/doc/README.falcon b/doc/README.falcon Tom index 93e855d..6357b1e 100644 Tom --- a/doc/README.falcon Tom +++ b/doc/README.falcon Tom @@ -41,6 +41,8 @@ file (CONFIG_CMD_SPL_NAND_OFS for NAND). Tom 3. Boot the board into Falcon Mode. SPL will load the kernel and copy Tom the parameters which are saved in the persistent area to the required address. Tom +If a valid uImage is not found at the defined location, U-Boot will be Tom +booted instead. Tom It is required to implement a custom mechanism to select if SPL loads U-Boot Tom or another image. Tom -- Tom 1.7.9.5 Tom ___ Tom U-Boot mailing list Tom U-Boot@lists.denx.de Tom http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] am335x_evm: Update, document Falcon Mode support
Tom == Tom Rini tr...@ti.com writes: Tom - Update Falcon Mode support so that the offsets used in eMMC (or a raw Tom SD card) would allow for enough room for a device tree to be used Tom rather than an ATAGS blob as well as environment to be saved in eMMC. Tom - Add board/ti/am335x/README which covers a few basic items, and Tom provides an example of Falcon Mode for eMMC, FAT SD card and NAND. Tom - Round up the size of u-boot.img.raw to match these use-cases, and add Tom the entries for Falcon Mode to DFU for eMMC, FAT SD cards and NAND Tom - Correct CONFIG_CMD_SPL_WRITE_SIZE size (eraseblocks are 128KiB) It looks to me like this should be 4 (or 3) seperate commits then? Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom board/ti/am335x/README | 123 ++ Tom include/configs/am335x_evm.h | 19 --- Tom 2 files changed, 135 insertions(+), 7 deletions(-) Tom create mode 100644 board/ti/am335x/README Tom diff --git a/board/ti/am335x/README b/board/ti/am335x/README Tom new file mode 100644 Tom index 000..565f18c Tom --- /dev/null Tom +++ b/board/ti/am335x/README Tom @@ -0,0 +1,123 @@ Tom +Summary Tom +=== Tom + Tom +This document covers various features of the 'am335x_evm' build, and some of Tom +the related build targets (am335x_evm_uartN, etc). Tom + Tom +Hardware Tom + Tom + Tom +The binary produced by this board supports, based on parsing of the EEPROM Tom +doumentd in TI's reference designs: documented Tom +Note that when we run 'spl export' it will prepare to boot the kernel. Tom +This includes relocation of the uImage from where we loaded it to the entry Tom +point defined in the head. As these locations overlap by default, it would header Tom +A further word of warning about using eMMC and partition tables. When Tom +working with SD cards we can get away with erasing small areas at a time, Tom +however on eMMC we must keep erases aligned to eraseblocks and thus the Tom +first erase we issue will erase the partition table. Really? I thought eMMC behaved just like SD cards? Tom +# Ensure are able to talk with this mmc device, erase most previous contents Ensure we are -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] spl_mmc.c: Detect missing kernel image in RAW MMC
Tom == Tom Rini tr...@ti.com writes: Tom Currently, we assume that if we can read from MMC correctly, we have Tom found a valid image. This is not the case as an empty area will read Tom just fine. Add a check for a valid IH_MAGIC. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk Tom --- Tom common/spl/spl_mmc.c |4 Tom 1 file changed, 4 insertions(+) Tom diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c Tom index 170fa38..d20f45d 100644 Tom --- a/common/spl/spl_mmc.c Tom +++ b/common/spl/spl_mmc.c Tom @@ -29,6 +29,7 @@ Tom #include mmc.h Tom #include fat.h Tom #include version.h Tom +#include image.h Tom DECLARE_GLOBAL_DATA_PTR; Tom @@ -46,6 +47,9 @@ static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector) Tom if (err == 0) Tom goto end; Tom + if (image_get_magic(header) != IH_MAGIC) Tom + return -1; Tom + Tom spl_parse_image_header(header); Tom /* convert size to sectors - round up */ Tom -- Tom 1.7.9.5 Tom ___ Tom U-Boot mailing list Tom U-Boot@lists.denx.de Tom http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] am33xx: fix the ddr_cmdtctrl structure
Ilya == Ilya Ledvich i...@compulab.co.il writes: Ilya Fix the wrong mapping between the DDR I/O control registers on Ilya AM33XX SoCs and the software representation in the SPL code. The Ilya most recent public TRM defines the following DDR I/O control Ilya registers offsets: Ilya * ddr_cmd0_ioctrl : offset 0x44E11404 Ilya * ddr_cmd1_ioctrl : offset 0x44E11408 Ilya * ddr_cmd2_ioctrl : offset 0x44E1140C Ilya * ddr_data0_ioctrl: offset 0x44E11440 Ilya * ddr_data1_ioctrl: offset 0x44E11444 Ilya While the struct ddr_cmdtctrl has also some reserved bits in the Ilya beginning. The struct is mapped to the address 0x44E11404. As a Ilya result cm0ioctl points to the ddr_cmd1_ioctrl register, Ilya cm1ioctl to the ddr_cmd2_ioctrl and etc. Registers Ilya ddr_cmd0_ioctrl and ddr_data0_ioctrl are never configured because Ilya of this mapping mismatch. Ilya Signed-off-by: Ilya Ledvich i...@compulab.co.il Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm, am33xx: move s_init to a common place
Tom == Tom Rini tr...@ti.com writes: Hi, BTW: I just realized that I have on one of the three boards a problem, that in spl code calling the rtc32k_enable() crashes ... which votes against moving this to a common place ... I haveno real idea why ... did you heard from such a behaviour? Is there some am335x soc, which differs from the others? Tom You aren't using a different clock crystal rate than the reference Tom platforms, are you? I know that's a problem that needs solving Tom still. Really? We have a am335x based board using a 25MHz input clock, and I haven't noticed any problems. What are those problems exactly? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] am33xx: Correct NON_SECURE_SRAM_START/END
Tom == Tom Rini tr...@ti.com writes: Tom Prior to Sricharan's cleanup of the boot parameter saving code, we Tom did not make use of NON_SECURE_SRAM_START on am33xx, so it wasn't a Tom problem that the address was pointing to the middle of our running SPL. Tom Correct to point to the base location of the download image area. Tom Increase CONFIG_SPL_TEXT_BASE to account for this scratch area being Tom used. As part of correcting these tests, make use of the fact that Tom we've always been placing our stack outside of the download image area Tom (which is fine, once the downloaded image is run, ROM is gone) so Tom correct the max size test to be the ROM defined top of the download area Tom to where we link/load at. Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom arch/arm/include/asm/arch-am33xx/omap.h |4 ++-- Tom include/configs/am335x_evm.h| 10 -- Tom include/configs/igep0033.h | 10 -- Tom include/configs/pcm051.h| 10 -- Tom 4 files changed, 26 insertions(+), 8 deletions(-) Tom diff --git a/arch/arm/include/asm/arch-am33xx/omap.h b/arch/arm/include/asm/arch-am33xx/omap.h Tom index 7e3bb9c..db15159 100644 Tom --- a/arch/arm/include/asm/arch-am33xx/omap.h Tom +++ b/arch/arm/include/asm/arch-am33xx/omap.h Tom @@ -29,8 +29,8 @@ Tom * at 0x40304000(EMU base) so that our code works for both EMU and GP Tom */ Tom #ifdef CONFIG_AM33XX Tom -#define NON_SECURE_SRAM_START0x40304000 Tom -#define NON_SECURE_SRAM_END 0x4030E000 Tom +#define NON_SECURE_SRAM_START0x402F0400 Tom +#define NON_SECURE_SRAM_END 0x4031 Tom #elif defined(CONFIG_TI814X) Tom #define NON_SECURE_SRAM_START0x4030 Tom #define NON_SECURE_SRAM_END 0x4032 Tom diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h Tom index f019134..a4777c7 100644 Tom --- a/include/configs/am335x_evm.h Tom +++ b/include/configs/am335x_evm.h Tom @@ -305,8 +305,14 @@ Tom /* Defines for SPL */ Tom #define CONFIG_SPL Tom #define CONFIG_SPL_FRAMEWORK Tom -#define CONFIG_SPL_TEXT_BASE 0x402F0400 Tom -#define CONFIG_SPL_MAX_SIZE (101 * 1024) Tom +/* Tom + * Place the image at the start of the ROM defined image space and leave Tom + * space for SRAM scratch entries (see arch/arm/include/omap_common.h). Tom + * We limit our size to the ROM-defined dowloaded image area, and use the s/dowloaded/downloaded/ Tom + * rest of the space for stack. Tom + */ Tom +#define CONFIG_SPL_TEXT_BASE 0x402F0500 Tom +#define CONFIG_SPL_MAX_SIZE (0x4030C000 - CONFIG_SPL_TEXT_BASE) Tom #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR Tom #define CONFIG_SPL_BSS_START_ADDR0x8000 Tom diff --git a/include/configs/igep0033.h b/include/configs/igep0033.h Tom index 1912d7d..dd26d9c 100644 Tom --- a/include/configs/igep0033.h Tom +++ b/include/configs/igep0033.h Tom @@ -214,8 +214,14 @@ Tom /* Defines for SPL */ Tom #define CONFIG_SPL Tom #define CONFIG_SPL_FRAMEWORK Tom -#define CONFIG_SPL_TEXT_BASE 0x402F0400 Tom -#define CONFIG_SPL_MAX_SIZE (101 * 1024) Tom +/* Tom + * Place the image at the start of the ROM defined image space and leave Tom + * space for SRAM scratch entries (see arch/arm/include/omap_common.h). Tom + * We limit our size to the ROM-defined dowloaded image area, and use the s/dowloaded/downloaded/ Tom + * rest of the space for stack. Tom + */ Tom +#define CONFIG_SPL_TEXT_BASE 0x402F0500 Tom +#define CONFIG_SPL_MAX_SIZE (0x4030C000 - CONFIG_SPL_TEXT_BASE) Tom #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR Tom #define CONFIG_SPL_BSS_START_ADDR0x8000 Tom diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h Tom index 478f805..a7d01f1 100644 Tom --- a/include/configs/pcm051.h Tom +++ b/include/configs/pcm051.h Tom @@ -204,8 +204,14 @@ Tom /* Defines for SPL */ Tom #define CONFIG_SPL Tom #define CONFIG_SPL_FRAMEWORK Tom -#define CONFIG_SPL_TEXT_BASE 0x402F0400 Tom -#define CONFIG_SPL_MAX_SIZE (101 * 1024) Tom +/* Tom + * Place the image at the start of the ROM defined image space and leave Tom + * space for SRAM scratch entries (see arch/arm/include/omap_common.h). Tom + * We limit our size to the ROM-defined dowloaded image area, and use the s/dowloaded/downloaded/ Otherwise it looks good. Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 1/4] README: document CONFIG_ENV_IS_IN_MMC
S == Stephen Warren swar...@wwwdotorg.org writes: S From: Stephen Warren swar...@nvidia.com S Describe the meaning of CONFIG_ENV_IS_IN_MMC, and all related defines that S must or can be set when using that option. S Signed-off-by: Stephen Warren swar...@nvidia.com S --- S v2: New patch. S --- S README | 38 ++ S 1 file changed, 38 insertions(+) S diff --git a/README b/README S index 3012dcd..b9936ca 100644 S --- a/README S +++ b/README S @@ -3606,6 +3606,44 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface. S You will probably want to define these to avoid a really noisy system S when storing the env in UBI. S +- CONFIG_ENV_IS_IN_MMC: S + S + Define this if you have an MMC device which you want to use for the S + environment. S + S + - CONFIG_SYS_MMC_ENV_DEV: S + S + Specifies which MMC device the environment is stored in. S + S + - CONFIG_SYS_MMC_ENV_PART (optional): S + S + Specifies which MMC partition the environment is stored in. If not S + set, defaults to partition 0, the user area. Common values might be S + 1 (first MMC boot partition), 2 (second MMC boot partition). S + S + - CONFIG_ENV_OFFSET: S + - CONFIG_ENV_SIZE: S + S + These two #defines specify the offset and size of the environment S + area within the specified MMC device. S + S + These two values must be aligned to an MMC sector boundary. It would be good to explicitly mention that these values are in bytes, and not sectors. S + S + - CONFIG_ENV_OFFSET_REDUND (optional): S + S + Specifies a second storage area, of CONFIG_ENV_SIZE size, used to S + hold a redundant copy of the environment data. This provides a S + valid backup copy in case the other copy is corrupted, e.g. due S + to a power failure during a saveenv operation. S + S + This value must also be aligned to an MMC sector boundary. S + S + - CONFIG_ENV_SIZE_REDUND (optional): S + S + This value need not be set, even when CONFIG_ENV_OFFSET_REDUND is S + set. If this value is set, it must be set to the same value as S + CONFIG_ENV_OFFSET. s/CONFIG_ENV_OFFSET/CONFIG_ENV_SIZE/ -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 3/4] env_mmc: allow negative CONFIG_ENV_OFFSET
S == Stephen Warren swar...@wwwdotorg.org writes: S From: Stephen Warren swar...@nvidia.com S A negative value of CONFIG_ENV_OFFSET is treated as a backwards offset S from the end of the eMMC device/partition, rather than a forwards offset S from the start. S This is useful when a single board may be stuffed with different eMMC S devices, each of which has a different capacity, and you always want the S environment to be stored at the very end of the device (or eMMC boot S partition for example). S One example of this case is NVIDIA's Ventana reference board. S Signed-off-by: Stephen Warren swar...@nvidia.com S --- S v2: Also update README to describe the change. S --- S README | 11 +++ S common/env_mmc.c | 12 ++-- S 2 files changed, 21 insertions(+), 2 deletions(-) S diff --git a/README b/README S index b9936ca..4335730 100644 S --- a/README S +++ b/README S @@ -3627,6 +3627,14 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface. S These two #defines specify the offset and size of the environment S area within the specified MMC device. S + If offset is positive (the usual case), it is treated as relative to S + the start of the MMC partition. If offset is negative, it is treated S + as relative to the end of the MMC partition. This can be useful if S + your board may be fitted with different MMC devices, which have S + different sizes for the MMC partitions, and you always want the S + environment placed at the very end of the partition, to leave the S + maximum possible space before it, to store other data. S + S These two values must be aligned to an MMC sector boundary. S - CONFIG_ENV_OFFSET_REDUND (optional): S @@ -3636,6 +3644,9 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface. S valid backup copy in case the other copy is corrupted, e.g. due S to a power failure during a saveenv operation. S + This value may also be positive or negative; this is handled in the S + same way as CONFIG_ENV_OFFSET. S + S This value must also be aligned to an MMC sector boundary. S - CONFIG_ENV_SIZE_REDUND (optional): S diff --git a/common/env_mmc.c b/common/env_mmc.c S index 9ca098f..5d3a769 100644 S --- a/common/env_mmc.c S +++ b/common/env_mmc.c S @@ -53,11 +53,19 @@ DECLARE_GLOBAL_DATA_PTR; S __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr) S { S - *env_addr = CONFIG_ENV_OFFSET; S + s64 offset; S + S + offset = CONFIG_ENV_OFFSET; S #ifdef CONFIG_ENV_OFFSET_REDUND S if (copy) S - *env_addr = CONFIG_ENV_OFFSET_REDUND; S + offset = CONFIG_ENV_OFFSET_REDUND; S #endif S + S + if (offset 0) S + offset += mmc-capacity; S + S + *env_addr = offset; S + This is quite a mix of data types (u32/s64/u64). Not directly related to this patch, but it would imho be nicer to let env_mmc work directly with block numbers instead of bytes, that way stuff would also work with 4GB MMCs. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 1/4] README: document CONFIG_ENV_IS_IN_MMC
S == Stephen Warren swar...@wwwdotorg.org writes: S From: Stephen Warren swar...@nvidia.com S Describe the meaning of CONFIG_ENV_IS_IN_MMC, and all related defines that S must or can be set when using that option. S Signed-off-by: Stephen Warren swar...@nvidia.com S --- S v3: S * Mention that env size/offset are in bytes. S * Fix typo; s/CONFIG_ENV_OFFSET/CONFIG_ENV_SIZE/ in one place. S v2: New patch. S --- S README | 40 S 1 file changed, 40 insertions(+) S diff --git a/README b/README S index 3012dcd..e7fedb8 100644 S --- a/README S +++ b/README S @@ -3606,6 +3606,46 @@ but it can not erase, write this NOR flash by SRIO or PCIE interface. S You will probably want to define these to avoid a really noisy system S when storing the env in UBI. S +- CONFIG_ENV_IS_IN_MMC: S + S + Define this if you have an MMC device which you want to use for the S + environment. S + S + - CONFIG_SYS_MMC_ENV_DEV: S + S + Specifies which MMC device the environment is stored in. S + S + - CONFIG_SYS_MMC_ENV_PART (optional): S + S + Specifies which MMC partition the environment is stored in. If not S + set, defaults to partition 0, the user area. Common values might be S + 1 (first MMC boot partition), 2 (second MMC boot partition). S + S + - CONFIG_ENV_OFFSET: S + - CONFIG_ENV_SIZE: S + S + These two #defines specify the offset and size of the environment S + area within the specified MMC device. S + S + These two values are in units of bytes, but must be aligned to an S + MMC sector boundary. s/to an/t a/ Other than that: Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V3 1/4] README: document CONFIG_ENV_IS_IN_MMC
Stephen == Stephen Warren swar...@wwwdotorg.org writes: Stephen On 05/23/2013 03:59 PM, Peter Korsgaard wrote: S == Stephen Warren swar...@wwwdotorg.org writes: Stephen ... S + These two values are in units of bytes, but must be aligned to an S + MMC sector boundary. s/to an/to a/ Stephen http://owl.english.purdue.edu/owl/resource/540/1/ disagrees Stephen since the M starts with a vowel sound. See the An MSDS ... Stephen example. Ok, I'm not a native speaker. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 6/7] am335x_evm: Add support for the NOR module on the memory cape
Tom == Tom Rini tr...@ti.com writes: Tom From: Steve Kipisz s-kipi...@ti.com Tom This patch adds support for the NOR module that attaches Tom to the memory cape for a Beaglebone board. This does not Tom add booting support; only support so that you can boot from Tom SD/MMC and see the NOR module so that it can be programmed. Tom Signed-off-by: Steve Kipisz s-kipi...@ti.com Tom [trini: Clean up config changes slightly] Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom Changes in v2: Tom - Move GPMC config portion into board.c Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom arch/arm/cpu/armv7/am33xx/mem.c|6 Tom arch/arm/include/asm/arch-am33xx/mem.h |9 ++ Tom board/ti/am335x/board.c| 13 Tom board/ti/am335x/mux.c | 53 Tom boards.cfg |1 + Tom include/configs/am335x_evm.h | 28 + Tom 6 files changed, 110 insertions(+) Tom diff --git a/arch/arm/cpu/armv7/am33xx/mem.c b/arch/arm/cpu/armv7/am33xx/mem.c Tom index 45f5426..923ea83 100644 Tom --- a/arch/arm/cpu/armv7/am33xx/mem.c Tom +++ b/arch/arm/cpu/armv7/am33xx/mem.c Tom @@ -77,9 +77,15 @@ void gpmc_init(void) Tom /* global settings */ Tom writel(0x0008, gpmc_cfg-sysconfig); Tom +#ifdef CONFIG_NOR Tom + writel(0x, gpmc_cfg-irqstatus); Tom + writel(0x, gpmc_cfg-irqenable); Tom + writel(0x0A00, gpmc_cfg-config); Tom +#else Tom writel(0x0100, gpmc_cfg-irqstatus); Tom writel(0x0100, gpmc_cfg-irqenable); Tom writel(0x0012, gpmc_cfg-config); Tom +#endif This looks to me as an indication that irqstatus/irqenable/config should really be arguments of gpmc_init(). Tom /* Tom* Disable the GPMC0 config set by ROM code Tom*/ Tom diff --git a/arch/arm/include/asm/arch-am33xx/mem.h b/arch/arm/include/asm/arch-am33xx/mem.h Tom index c3bf74e..ddcad62 100644 Tom --- a/arch/arm/include/asm/arch-am33xx/mem.h Tom +++ b/arch/arm/include/asm/arch-am33xx/mem.h Tom @@ -61,6 +61,15 @@ Tom #define M_NAND_GPMC_CONFIG6 0x16000f80 Tom #define M_NAND_GPMC_CONFIG7 0x0008 Tom +/* NOR chip on NOR module for Beaglebone */ Tom +#define STNOR_GPMC_CONFIG1 0x1200 Tom +#define STNOR_GPMC_CONFIG2 0x00101000 Tom +#define STNOR_GPMC_CONFIG3 0x00030301 Tom +#define STNOR_GPMC_CONFIG4 0x10041004 Tom +#define STNOR_GPMC_CONFIG5 0x000C1010 Tom +#define STNOR_GPMC_CONFIG6 0x08070280 Tom +#define STNOR_GPMC_CONFIG7 0x0F48 Why are these not in board/ti/am335x/board.{c,h} if they are beaglebone specific? Tom + Tom /* max number of GPMC Chip Selects */ Tom #define GPMC_MAX_CS 8 Tom /* max number of GPMC regs */ Tom diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c Tom index 0ee2f7e..3660655 100644 Tom --- a/board/ti/am335x/board.c Tom +++ b/board/ti/am335x/board.c Tom @@ -27,6 +27,7 @@ Tom #include asm/arch/gpio.h Tom #include asm/arch/mmc_host_def.h Tom #include asm/arch/sys_proto.h Tom +#include asm/arch/mem.h Tom #include asm/io.h Tom #include asm/emif.h Tom #include asm/gpio.h Tom @@ -366,10 +367,22 @@ void s_init(void) Tom */ Tom int board_init(void) Tom { Tom +#ifdef CONFIG_NOR Tom + const u32 gpmc_nor[GPMC_MAX_REG] = { STNOR_GPMC_CONFIG1, Tom + STNOR_GPMC_CONFIG2, STNOR_GPMC_CONFIG3, STNOR_GPMC_CONFIG4, Tom + STNOR_GPMC_CONFIG5, STNOR_GPMC_CONFIG6, STNOR_GPMC_CONFIG7 }; Tom +#endif Tom +gd- bd-bi_boot_params = PHYS_DRAM_1 + 0x100; Tom gpmc_init(); Tom +#ifdef CONFIG_NOR Tom + /* Reconfigure CS0 for NOR instead of NAND. */ Tom + enable_gpmc_cs_config(gpmc_nor, gpmc_cfg-cs[0], Tom + CONFIG_SYS_FLASH_BASE, GPMC_SIZE_16M); Tom +#endif Tom + Perhaps the nand handling should just get moved out of gpmc_init() (or the _cs_config args should be passed to gpmc_init() ). Tom return 0; Tom } -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 7/7] am335x_evm: Add support to boot from NOR.
Tom == Tom Rini tr...@ti.com writes: Tom From: Steve Kipisz s-kipi...@ti.com Tom NOR requires that s_init be within the first 4KiB of the image so that Tom we can perform the rest of the required pinmuxing to talk with the rest Tom of NOR that we are found on. When NOR_BOOT is set we save our Tom environment in NOR at 512KiB and a redundant copy at 768KiB. We avoid Tom using SPL for this case and u-boot.bin is written directly to the start Tom of NOR. Tom Signed-off-by: Steve Kipisz s-kipi...@ti.com Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom Changes in v2: Tom - Reword commit message slightly Tom --- Tom arch/arm/cpu/armv7/am33xx/emif4.c |6 +- Tom board/ti/am335x/Makefile |2 +- Tom board/ti/am335x/board.c | 31 ++- Tom board/ti/am335x/mux.c |6 +- Tom board/ti/am335x/u-boot.lds| 110 + Tom boards.cfg|1 + Tom include/configs/am335x_evm.h | 26 - Tom 7 files changed, 173 insertions(+), 9 deletions(-) Tom create mode 100644 board/ti/am335x/u-boot.lds Tom diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c b/arch/arm/cpu/armv7/am33xx/emif4.c Tom index aa84e96..370230b 100644 Tom --- a/arch/arm/cpu/armv7/am33xx/emif4.c Tom +++ b/arch/arm/cpu/armv7/am33xx/emif4.c Tom @@ -43,9 +43,11 @@ void dram_init_banksize(void) Tom } Tom -#ifdef CONFIG_SPL_BUILD Tom +#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT) Tom +#ifdef CONFIG_TI81XX Tom static struct dmm_lisa_map_regs *hw_lisa_map_regs = Tom (struct dmm_lisa_map_regs *)DMM_BASE; Tom +#endif Tom static struct vtp_reg *vtpreg[2] = { Tom (struct vtp_reg *)VTP0_CTRL_ADDR, Tom (struct vtp_reg *)VTP1_CTRL_ADDR}; Tom @@ -53,6 +55,7 @@ static struct vtp_reg *vtpreg[2] = { Tom static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR; Tom #endif Tom +#ifdef CONFIG_TI81XX Why are you adding the TI81XX dependency here? That doesn't have anything to do with nor boot, does it? Tom void config_dmm(const struct dmm_lisa_map_regs *regs) Tom { Tom enable_dmm_clocks(); Tom @@ -67,6 +70,7 @@ void config_dmm(const struct dmm_lisa_map_regs *regs) Tom writel(regs-dmm_lisa_map_1, hw_lisa_map_regs-dmm_lisa_map_1); Tom writel(regs-dmm_lisa_map_0, hw_lisa_map_regs-dmm_lisa_map_0); Tom } Tom +#endif -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 6/7] am335x_evm: Add support for the NOR module on the memory cape
Tom == Tom Rini tr...@ti.com writes: Hi, Perhaps the nand handling should just get moved out of gpmc_init() (or the _cs_config args should be passed to gpmc_init() ). Tom I looked at this, on the scale of redoing omap3 too (where we have a lot Tom of existing examples). The split we've got now works and it's harmless Tom to re-configure CS0 in the case where the defaults don't work. I think Tom this would lead us to an abstraction that leads to a lot of board files Tom duplicating the same code. Maybe the solution is simply to have: init_gpmc_nand() and init_gpmc_nor() ? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 7/7] am335x_evm: Add support to boot from NOR.
Tom == Tom Rini tr...@ti.com writes: Hi, Tom +#ifdef CONFIG_TI81XX Why are you adding the TI81XX dependency here? That doesn't have anything to do with nor boot, does it? Tom dmm is TI81XX-only (for this file, it's also omap4+) and since main Tom U-Boot doesn't use --ffunction-sections/--fdata-sections/--gc-sections Tom we end up with a link error about not having enable_dmm_clocks(). This Tom is OK on SPL since we do use --gc-sections and the link error is avoided Tom as we discard config_dmm on am33xx builds. Ok, that's interesting info which imho belongs in the commit message. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 6/7] am335x_evm: Add support for the NOR module on the memory cape
Tom == Tom Rini tr...@ti.com writes: Hi, Tom But I ended up with one non-default on all of omap3,which just Tom says lets re-program cs0 for our split. Ok, thanks. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 7/7] am335x_evm: Add support to boot from NOR.
Tom == Tom Rini tr...@ti.com writes: Ok, that's interesting info which imho belongs in the commit message. Tom Reworded, thanks! Great, thanks. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/7] am33xx/omap3: Clean up gpmc_init slightly
Tom == Tom Rini tr...@ti.com writes: Tom We don't really need the gpmc_config, base and size variables and can Tom just call enable_gpmc_cs_config more directly, like the boards which Tom need to re-configure CS0 or CS1 do. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 3/7] am335x_evm: Update SPI_BOOT support, add MTDPARTS info
Tom == Tom Rini tr...@ti.com writes: Tom - Style cleanup (# define - #define) Tom - Due to ROM issues, redudant loading isn't feasible, so drop. Tom - Given extra space, increase max size of U-Boot to 512KiB Tom - Correct env size to match usage (we had not re-defined ENV_SIZE). Tom - Given extra space, keep env size as 128KiB, add redundant environment. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk Tom --- Tom Changes in v2: Tom - Correct physmap - m25p80 in mtdparts (Peter K). Tom - Style fixups, drop redundant SPL space, add redundant environment. Tom Signed-off-by: Tom Rini tr...@ti.com 1 s-o-b is probably enough ;) -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/7] am335x_evm: Only set CONFIG_NAND when !CONFIG_SPI_BOOT
Tom == Tom Rini tr...@ti.com writes: Tom Due to hardware design the board supported by the am335x_evm config Tom cannot have both NAND and SPI (or NOR) enabled at the same time due to Tom conflicts. Disable the NAND SW stack when we know we can't have it Tom present. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk Tom --- Tom Changes in v2: Tom - Reword commit message Thanks! -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 5/7] am335x_evm: Rework board_is_foo() checks
Tom == Tom Rini tr...@ti.com writes: Tom We rework the various board_is_foo() checks to take a pointer to Tom struct am335x_baseboard_id rather than using a local copy in board.c. Tom This allows us to make use of the same checks in mux.c as well as fixing Tom problems when this code could be running from read-only memory. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 5/6] spl_mmc: add Falcon mode support for raw variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from sector CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS of kernel argument parameters starting from sector CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- README| 10 ++ drivers/mmc/spl_mmc.c | 18 ++ 2 files changed, 28 insertions(+) diff --git a/README b/README index 595c05d..3bac95b 100644 --- a/README +++ b/README @@ -2915,6 +2915,16 @@ FIT uImage format: Address, size and partition on the MMC to load U-Boot from when the MMC is being used in raw mode. + CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR + Sector to load kernel uImage from when MMC is being + used in raw mode (for Falcon mode) + + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS + Sector and number of sectors to load kernel argument + parameters from when MMC is being used in raw mode + (for falcon mode) + CONFIG_SPL_FAT_SUPPORT Support for fs/fat/libfat.o in SPL binary diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d710c0d..170fa38 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -63,6 +63,21 @@ end: return (err == 0); } +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_raw_os(struct mmc *mmc) +{ + if (!mmc-block_dev.block_read(0, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS, + (void *)CONFIG_SYS_SPL_ARGS_ADDR)) { + printf(mmc args blk read error\n); + return -1; + } + + return mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR); +} +#endif + #ifdef CONFIG_SPL_FAT_SUPPORT static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { @@ -130,6 +145,9 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_raw_os(mmc)) +#endif err = mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 1/6] spl_mmc: return error from mmc_load_image_{raw, fat} rather than hanging
So we can instead fallback to doing something else on errors. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 7efdcb8..0c50657 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static void mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc) { unsigned long err; u32 image_size_sectors; @@ -61,14 +61,14 @@ static void mmc_load_image_raw(struct mmc *mmc) image_size_sectors, (void *)spl_image.load_addr); end: - if (err == 0) { + if (err == 0) printf(spl: mmc blk read err - %lu\n, err); - hang(); - } + + return (err == 0); } #ifdef CONFIG_SPL_FAT_SUPPORT -static void mmc_load_image_fat(struct mmc *mmc) +static int mmc_load_image_fat(struct mmc *mmc) { int err; struct image_header *header; @@ -94,11 +94,11 @@ static void mmc_load_image_fat(struct mmc *mmc) (u8 *)spl_image.load_addr, 0); end: - if (err = 0) { + if (err = 0) printf(spl: error reading image %s, err - %d\n, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err); - hang(); - } + + return (err = 0); } #endif @@ -121,17 +121,21 @@ void spl_mmc_load_image(void) printf(spl: mmc init failed: err - %d\n, err); hang(); } + boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); - mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); - mmc_load_image_fat(mmc); + err = mmc_load_image_fat(mmc); #endif } else { puts(spl: wrong MMC boot mode\n); hang(); } + + if (err) + hang(); } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 4/6] spl_mmc: mmc_load_image_raw(): Add sector argument
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d250b40..d710c0d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static int mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector) { unsigned long err; u32 image_size_sectors; @@ -42,10 +42,7 @@ static int mmc_load_image_raw(struct mmc *mmc) sizeof(struct image_header)); /* read image header to find the image size load address */ - err = mmc-block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1, - header); - + err = mmc-block_dev.block_read(0, sector, 1, header); if (err == 0) goto end; @@ -56,9 +53,8 @@ static int mmc_load_image_raw(struct mmc *mmc) mmc-read_bl_len; /* Read the header too to avoid extra memcpy */ - err = mmc-block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, - image_size_sectors, (void *)spl_image.load_addr); + err = mmc-block_dev.block_read(0, sector, image_size_sectors, + (void *)spl_image.load_addr); end: if (err == 0) @@ -134,7 +130,8 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); - err = mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc, + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 3/6] spl_mmc: add Falcon mode support for FAT variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from CONFIG_SPL_FAT_LOAD_KERNEL_NAME file and kernel argument parameters from CONFIG_SPL_FAT_LOAD_ARGS_NAME, both from the same partition as u-boot. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- README|8 drivers/mmc/spl_mmc.c | 21 + 2 files changed, 29 insertions(+) diff --git a/README b/README index 0d37d56..595c05d 100644 --- a/README +++ b/README @@ -2921,6 +2921,14 @@ FIT uImage format: CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME Filename to read to load U-Boot when reading from FAT + CONFIG_SPL_FAT_LOAD_KERNEL_NAME + Filename to read to load kernel uImage when reading + from FAT (for Falcon mode) + + CONFIG_SPL_FAT_LOAD_ARGS_NAME + Filename to read to load kernel argument parameters + when reading from FAT (for Falcon mode) + CONFIG_SPL_MPC83XX_WAIT_FOR_NAND Set this for NAND SPL on PPC mpc83xx targets, so that start.S waits for the rest of the SPL to load before diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index fac6f2d..d250b40 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -91,6 +91,24 @@ end: return (err = 0); } + +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_fat_os(struct mmc *mmc) +{ + int err; + + err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME, + (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0); + if (err = 0) { + printf(spl: error reading image %s, err - %d\n, + CONFIG_SPL_FAT_LOAD_ARGS_NAME, err); + return -1; + } + + return mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_KERNEL_NAME); +} +#endif + #endif void spl_mmc_load_image(void) @@ -128,6 +146,9 @@ void spl_mmc_load_image(void) hang(); } +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_fat_os(mmc)) +#endif err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 0/6] Falcon boot mode for spl_mmc
This patch series adds falcon boot mode for MMC (raw and FAT), similar to the existing nand support. As an example, it adds falcon boot support for the am335x evm board, which is the platform that has been used to test the series (FAT and raw). Changes since V2: - Drop RFC and adjust am335x nand MTDPARTS_DEFAULT settings according to Tom Rini's feedback. Changes since V1: - Adjusted am335x parameters according to Tom Rini's feedback. Added spl command for easy kernel parameter area snapshot creation. Peter Korsgaard (6): spl_mmc: return error from mmc_load_image_{raw,fat} rather than hanging spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init out spl_mmc: add Falcon mode support for FAT variant spl_mmc: mmc_load_image_raw(): Add sector argument spl_mmc: add Falcon mode support for raw variant am335x: enable falcon boot mode for mmc (raw and fat) and nand README | 18 + board/ti/am335x/board.c |9 + drivers/mmc/spl_mmc.c| 91 ++ include/configs/am335x_evm.h | 30 -- 4 files changed, 119 insertions(+), 29 deletions(-) -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 2/6] spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init out
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 0c50657..fac6f2d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -68,7 +68,7 @@ end: } #ifdef CONFIG_SPL_FAT_SUPPORT -static int mmc_load_image_fat(struct mmc *mmc) +static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { int err; struct image_header *header; @@ -76,27 +76,18 @@ static int mmc_load_image_fat(struct mmc *mmc) header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - sizeof(struct image_header)); - err = fat_register_device(mmc-block_dev, - CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); - if (err) { - printf(spl: fat register err - %d\n, err); - hang(); - } - - err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - header, sizeof(struct image_header)); + err = file_fat_read(filename, header, sizeof(struct image_header)); if (err = 0) goto end; spl_parse_image_header(header); - err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - (u8 *)spl_image.load_addr, 0); + err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0); end: if (err = 0) printf(spl: error reading image %s, err - %d\n, - CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err); + filename, err); return (err = 0); } @@ -129,7 +120,15 @@ void spl_mmc_load_image(void) #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); - err = mmc_load_image_fat(mmc); + + err = fat_register_device(mmc-block_dev, + CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); + if (err) { + printf(spl: fat register err - %d\n, err); + hang(); + } + + err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { puts(spl: wrong MMC boot mode\n); -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv3 6/6] am335x: enable falcon boot mode for mmc (raw and fat) and nand
Jump into full u-boot mode if a 'c' character is received on the uart. We need to adjust the spl bss/malloc area to not overlap with the loadaddr of the kernel (sdram + 32k), so move it past u-boot instead. For raw mmc, we store the kernel parameter area in the free space after the MBR (if used). For nand, we use the last sector of the partition reserved for u-boot. This also enables the spl command in the full u-boot so the kernel parameter area snapshot can be created. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- board/ti/am335x/board.c |9 + include/configs/am335x_evm.h | 30 +++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index b371376..23fe188 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -297,6 +297,15 @@ static struct emif_regs ddr3_evm_emif_reg_data = { .emif_ddr_phy_ctlr_1 = MT41J512M8RH125_EMIF_READ_LATENCY | PHY_EN_DYN_PWRDN, }; + +#ifdef CONFIG_SPL_OS_BOOT +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + return (serial_tstc() serial_getc() == 'c'); +} +#endif + #endif /* diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index ef00306..034e5e6 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -307,13 +307,36 @@ #define CONFIG_SPL_MAX_SIZE(101 * 1024) #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR -#define CONFIG_SPL_BSS_START_ADDR 0x8000 +#define CONFIG_SPL_OS_BOOT + +#define CONFIG_SPL_BSS_START_ADDR 0x80a0 #define CONFIG_SPL_BSS_MAX_SIZE0x8 /* 512 KB */ #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR0x300 /* address 0x6 */ #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */ #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME u-boot.img + +#ifdef CONFIG_SPL_OS_BOOT +/* fat */ +#define CONFIG_SPL_FAT_LOAD_KERNEL_NAMEuImage +#define CONFIG_SPL_FAT_LOAD_ARGS_NAME args +#define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_DRAM_1 + 0x100) + +/* raw mmc */ +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x500 /* address 0xa */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8 /* address 0x1000 */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 8 /* 4KB */ + +/* nand */ +#define CONFIG_CMD_SPL_NAND_OFS0x24 /* end of u-boot */ +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS0x28 +#define CONFIG_CMD_SPL_WRITE_SIZE 0x1000 + +/* spl export command */ +#define CONFIG_CMD_SPL +#endif + #define CONFIG_SPL_MMC_SUPPORT #define CONFIG_SPL_FAT_SUPPORT #define CONFIG_SPL_I2C_SUPPORT @@ -375,7 +398,7 @@ * other needs. */ #define CONFIG_SYS_TEXT_BASE 0x8080 -#define CONFIG_SYS_SPL_MALLOC_START0x80208000 +#define CONFIG_SYS_SPL_MALLOC_START0x80a08000 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10 /* Since SPL did pll and ddr initialization for us, @@ -471,7 +494,8 @@ #define MTDPARTS_DEFAULT mtdparts=omap2-nand.0:128k(SPL), \ 128k(SPL.backup1), \ 128k(SPL.backup2), \ - 128k(SPL.backup3),1920k(u-boot), \ + 128k(SPL.backup3),1792k(u-boot), \ + 128k(u-boot-spl-os), \ 128k(u-boot-env),5m(kernel),-(rootfs) #define CONFIG_NAND_OMAP_GPMC #define GPMC_NAND_ECC_LP_x16_LAYOUT1 -- 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 1/6] am335x_evm: Drop useless CONFIG_ENV_IS_NOWHERE
Tom == Tom Rini tr...@ti.com writes: Tom We always set a CONFIG_ENV_IS_...somewhere... so drop the initial define Tom of NOWHERE. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/6] am335x_evm: Only set CONFIG_NAND when !CONFIG_SPI_BOOT
Tom == Tom Rini tr...@ti.com writes: Tom Due to hardware design, we can't have NAND present (as we know of NAND Tom today) when booting from SPI, so disable NAND then as that simplifies Tom logic. Sorry, this description is not clear to me. I didn't check in detail, but as far as I remember the default pins for spi0 don't conflict with gmpc. It's also not quite clear to me if you refer to SW support for NAND flash or the hardware component when you say 'NAND' above. Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom include/configs/am335x_evm.h |9 +++-- Tom 1 file changed, 7 insertions(+), 2 deletions(-) Tom diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h Tom index 004a06a..90cc1f5 100644 Tom --- a/include/configs/am335x_evm.h Tom +++ b/include/configs/am335x_evm.h Tom @@ -230,7 +230,9 @@ Tom /* USB Device Firmware Update support */ Tom #define CONFIG_DFU_FUNCTION Tom #define CONFIG_DFU_MMC Tom +#ifdef CONFIG_NAND Tom #define CONFIG_DFU_NAND Tom +#endif Tom #define CONFIG_CMD_DFU Tom #define DFU_ALT_INFO_MMC \ Tom boot part 0 1; \ Tom @@ -335,6 +337,7 @@ Tom #define CONFIG_SPL_LDSCRIPT $(CPUDIR)/am33xx/u-boot-spl.lds Tom #define CONFIG_SPL_BOARD_INIT Tom +#ifdef CONFIG_NAND Tom #define CONFIG_SPL_NAND_AM33XX_BCH Tom #define CONFIG_SPL_NAND_SUPPORT Tom #define CONFIG_SPL_NAND_BASE Tom @@ -365,6 +368,7 @@ Tom #define CONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE Tom #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x8 Tom +#endif Tom /* Tom * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM Tom @@ -466,7 +470,10 @@ Tom #define CONFIG_PHY_ADDR 0 Tom #define CONFIG_PHY_SMSC Tom +#if !defined(CONFIG_SPI_BOOT) Tom #define CONFIG_NAND Tom +#endif Tom + Tom /* NAND support */ Tom #ifdef CONFIG_NAND Tom #define CONFIG_CMD_NAND Tom @@ -484,11 +491,9 @@ Tom /* CS0 */ Tom #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND Tom devices */ Tom -#if !defined(CONFIG_SPI_BOOT) Tom #define CONFIG_ENV_IS_IN_NAND Tom #define CONFIG_ENV_OFFSET0x26 /* environment starts here */ Tom #define CONFIG_SYS_ENV_SECT_SIZE (128 10) /* 128 KiB */ Tom #endif Tom -#endif Tom #endif /* ! __CONFIG_AM335X_EVM_H */ Tom -- Tom 1.7.9.5 Tom ___ Tom U-Boot mailing list Tom U-Boot@lists.denx.de Tom http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/6] am335x_evm: Add MTDPARTS info for SPI flash
Tom == Tom Rini tr...@ti.com writes: Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom include/configs/am335x_evm.h |7 +++ Tom 1 file changed, 7 insertions(+) Tom diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h Tom index 945ec09..004a06a 100644 Tom --- a/include/configs/am335x_evm.h Tom +++ b/include/configs/am335x_evm.h Tom @@ -436,6 +436,13 @@ Tom # define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED Tom # define CONFIG_ENV_OFFSET (892 10) /* 892 KiB in */ Tom # define CONFIG_ENV_SECT_SIZE(4 10) /* 4 KB sectors */ Tom +#define CONFIG_CMD_MTDPARTS Tom +#define MTDIDS_DEFAULT nor0=physmap-flash.0 Tom +#define MTDPARTS_DEFAULT mtdparts=physmap-flash.0:128k(SPL), \ physmap for a spi flash? I would have expected to see m25p80? Tom + 128k(SPL.backup1), \ Tom + 128k(SPL.backup2), \ Tom + 128k(SPL.backup3),384k(u-boot), \ Tom + 4k(u-boot-env),3464k(kernel),-(rootfs) Tom #endif /* SPI support */ Tom /* Unsupported features */ Tom -- Tom 1.7.9.5 Tom ___ Tom U-Boot mailing list Tom U-Boot@lists.denx.de Tom http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] am335x_evm:Add support for the NOR module on the memory cape
Tom == Tom Rini tr...@ti.com writes: Space missing after ':' in subject. Tom From: Steve Kipisz s-kipi...@ti.com Tom This patch adds support for the NOR module that attaches Tom to the memory cape for a Beaglebone board. This does not Tom add booting support; only support so that you can boot from Tom SD/MMC and see the NOR module so that it can be programmed. Tom Signed-off-by: Steve Kipisz s-kipi...@ti.com Tom [trini: Clean up config changes slightly] Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom arch/arm/cpu/armv7/am33xx/mem.c| 30 +- Tom arch/arm/include/asm/arch-am33xx/mem.h |9 ++ Tom board/ti/am335x/mux.c | 53 Tom boards.cfg |1 + Tom include/configs/am335x_evm.h | 28 + Tom 5 files changed, 120 insertions(+), 1 deletion(-) Tom diff --git a/arch/arm/cpu/armv7/am33xx/mem.c b/arch/arm/cpu/armv7/am33xx/mem.c Tom index b86b0de..e46201a 100644 Tom --- a/arch/arm/cpu/armv7/am33xx/mem.c Tom +++ b/arch/arm/cpu/armv7/am33xx/mem.c Tom @@ -46,6 +46,19 @@ static const u32 gpmc_m_nand[GPMC_MAX_REG] = { Tom }; Tom #endif Tom +#if defined(CONFIG_CMD_FLASH) Tom +static const u32 gpmc_nor[GPMC_MAX_REG] = { Tom + STNOR_GPMC_CONFIG1, Tom + STNOR_GPMC_CONFIG2, Tom + STNOR_GPMC_CONFIG3, Tom + STNOR_GPMC_CONFIG4, Tom + STNOR_GPMC_CONFIG5, Tom + STNOR_GPMC_CONFIG6, Tom + STNOR_GPMC_CONFIG7 Tom +}; These values (and the gmpc_m_nand ones) are platform specific, right? It would be nicer to have them in the board file than here, similar to how I did for the ddr settings some time ago. Tom + Tom +#define GPMC_CS 0 Tom +#endif Tom void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, u32 base, Tom u32 size) Tom @@ -75,16 +88,22 @@ void gpmc_init(void) Tom /* putting a blanket check on GPMC based on ZeBu for now */ Tom gpmc_cfg = (struct gpmc *)GPMC_BASE; Tom -#ifdef CONFIG_CMD_NAND Tom +#if defined(CONFIG_CMD_NAND) || defined(CONFIG_NOR) Tom const u32 *gpmc_config = NULL; Tom u32 base = 0; Tom u32 size = 0; Tom #endif Tom /* global settings */ Tom writel(0x0008, gpmc_cfg-sysconfig); Tom +#ifdef CONFIG_NOR Tom + writel(0x, gpmc_cfg-irqstatus); Tom + writel(0x, gpmc_cfg-irqenable); Tom + writel(0x0A00, gpmc_cfg-config); Tom +#else Tom writel(0x0100, gpmc_cfg-irqstatus); Tom writel(0x0100, gpmc_cfg-irqenable); Tom writel(0x0012, gpmc_cfg-config); Tom +#endif So now you cannot E.G. have a single binary working on both the nand flash of the evm and beaglebone? That's not really nice. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] am335x_evm: Add support to boot from NOR.
Tom am335x_evm_nor arm armv7 am335x ti am33xx am335x_evm:SERIAL1,CONS_INDEX=1,NOR Tom +am335x_evm_norboot arm armv7 am335x ti am33xx am335x_evm:SERIAL1,CONS_INDEX=1,NOR,NOR_BOOT Tom am335x_evm_spiboot arm armv7 am335x ti am33xx am335x_evm:SERIAL1,CONS_INDEX=1,SPI_BOOT Tom am335x_evm_uart1 arm armv7 am335x ti am33xx am335x_evm:SERIAL2,CONS_INDEX=2 Tom am335x_evm_uart2 arm armv7 am335x ti am33xx am335x_evm:SERIAL3,CONS_INDEX=3 Tom diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h Tom index 343a4aa..abc477b 100644 Tom --- a/include/configs/am335x_evm.h Tom +++ b/include/configs/am335x_evm.h Tom @@ -39,6 +39,9 @@ Tom #define CONFIG_SETUP_MEMORY_TAGS Tom #define CONFIG_INITRD_TAG Tom +/* Custom script for NOR */ Tom +#define CONFIG_SYS_LDSCRIPT board/ti/am335x/u-boot.lds Tom + Tom #define CONFIG_SYS_CACHELINE_SIZE 64 Tom /* commands to include */ Tom @@ -300,6 +303,7 @@ Tom #define CONFIG_ENV_OVERWRITE 1 Tom #define CONFIG_SYS_CONSOLE_INFO_QUIET Tom +#ifndef CONFIG_NOR_BOOT Tom /* Defines for SPL */ Tom #define CONFIG_SPL Tom #define CONFIG_SPL_FRAMEWORK Tom @@ -343,6 +347,8 @@ Tom #define CONFIG_SPL_NAND_BASE Tom #define CONFIG_SPL_NAND_DRIVERS Tom #define CONFIG_SPL_NAND_ECC Tom +#endif Tom + Tom #define CONFIG_SYS_NAND_5_ADDR_CYCLE Tom #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ TomCONFIG_SYS_NAND_PAGE_SIZE) Tom @@ -376,14 +382,18 @@ Tom * header. That is 0x800FFFC0--0x8010 should not be used for any Tom * other needs. Tom */ Tom +#ifdef CONFIG_NOR_BOOT Tom +#define CONFIG_SYS_TEXT_BASE 0x0800 Tom +#else Tom #define CONFIG_SYS_TEXT_BASE 0x8080 Tom +#endif Tom #define CONFIG_SYS_SPL_MALLOC_START 0x80208000 Tom #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10 Tom /* Since SPL did pll and ddr initialization for us, Tom * we don't need to do it twice. Tom */ Tom -#ifndef CONFIG_SPL_BUILD Tom +#if !defined(CONFIG_SPL_BUILD) !defined(CONFIG_NOR_BOOT) Tom #define CONFIG_SKIP_LOWLEVEL_INIT Tom #endif Tom @@ -470,7 +480,7 @@ Tom #define CONFIG_PHY_ADDR 0 Tom #define CONFIG_PHY_SMSC Tom -#if !defined(CONFIG_SPI_BOOT) Tom +#if !defined(CONFIG_SPI_BOOT) !defined(CONFIG_NOR_BOOT) Tom #define CONFIG_NAND Tom #endif Tom @@ -520,6 +530,19 @@ Tom #define CONFIG_SYS_FLASH_BASE(0x0800) Tom #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT Tom #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE Tom +#ifdef CONFIG_NOR_BOOT Tom +#define CONFIG_ENV_IS_IN_FLASH Tom +#define CONFIG_ENV_SECT_SIZE (128 10) /* 128 KiB */ Tom +#define CONFIG_ENV_OFFSET(512 10) /* 512 KiB */ Tom +#define CONFIG_ENV_OFFSET_REDUND (768 10) /* 768 KiB */ Tom +#define CONFIG_CMD_MTDPARTS Tom +#define MTDIDS_DEFAULT nor0=physmap-flash.0 Tom +#define MTDPARTS_DEFAULT mtdparts=physmap-flash.0: \ Tom + 512k(u-boot), \ Tom + 128k(u-boot-env1), \ Tom + 128k(u-boot-env2), \ Tom + 4m(kernel),-(rootfs) Tom +#endif Tom #define CONFIG_MTD_DEVICE Tom #define CONFIG_CMD_FLASH Tom #endif /* NOR support */ Tom -- Tom 1.7.9.5 Tom ___ Tom U-Boot mailing list Tom U-Boot@lists.denx.de Tom http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] am335x_evm: Add support to boot from NOR.
Tom == Tom Rini tr...@ti.com writes: Why not use SPL when booting from NOR as well? You still want to relocate into DDR. Tom Frankly, I'm allergic to SPL for NOR. It's the historical and well Tom understood case, we're r/o until we move from flash to DDR. And it is Tom fast enough here at least that it doesn't seem like we'd gain on Tom falcon mode like we do on other medium. Ok. It would be good to mention this in the commit message. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 1/6] spl_mmc: return error from mmc_load_image_{raw, fat} rather than hanging
So we can instead fallback to doing something else on errors. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 7efdcb8..0c50657 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static void mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc) { unsigned long err; u32 image_size_sectors; @@ -61,14 +61,14 @@ static void mmc_load_image_raw(struct mmc *mmc) image_size_sectors, (void *)spl_image.load_addr); end: - if (err == 0) { + if (err == 0) printf(spl: mmc blk read err - %lu\n, err); - hang(); - } + + return (err == 0); } #ifdef CONFIG_SPL_FAT_SUPPORT -static void mmc_load_image_fat(struct mmc *mmc) +static int mmc_load_image_fat(struct mmc *mmc) { int err; struct image_header *header; @@ -94,11 +94,11 @@ static void mmc_load_image_fat(struct mmc *mmc) (u8 *)spl_image.load_addr, 0); end: - if (err = 0) { + if (err = 0) printf(spl: error reading image %s, err - %d\n, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err); - hang(); - } + + return (err = 0); } #endif @@ -121,17 +121,21 @@ void spl_mmc_load_image(void) printf(spl: mmc init failed: err - %d\n, err); hang(); } + boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); - mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); - mmc_load_image_fat(mmc); + err = mmc_load_image_fat(mmc); #endif } else { puts(spl: wrong MMC boot mode\n); hang(); } + + if (err) + hang(); } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 2/6] spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init out
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 0c50657..fac6f2d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -68,7 +68,7 @@ end: } #ifdef CONFIG_SPL_FAT_SUPPORT -static int mmc_load_image_fat(struct mmc *mmc) +static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { int err; struct image_header *header; @@ -76,27 +76,18 @@ static int mmc_load_image_fat(struct mmc *mmc) header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - sizeof(struct image_header)); - err = fat_register_device(mmc-block_dev, - CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); - if (err) { - printf(spl: fat register err - %d\n, err); - hang(); - } - - err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - header, sizeof(struct image_header)); + err = file_fat_read(filename, header, sizeof(struct image_header)); if (err = 0) goto end; spl_parse_image_header(header); - err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - (u8 *)spl_image.load_addr, 0); + err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0); end: if (err = 0) printf(spl: error reading image %s, err - %d\n, - CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err); + filename, err); return (err = 0); } @@ -129,7 +120,15 @@ void spl_mmc_load_image(void) #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); - err = mmc_load_image_fat(mmc); + + err = fat_register_device(mmc-block_dev, + CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); + if (err) { + printf(spl: fat register err - %d\n, err); + hang(); + } + + err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { puts(spl: wrong MMC boot mode\n); -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 5/6] spl_mmc: add Falcon mode support for raw variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from sector CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS of kernel argument parameters starting from sector CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- README| 10 ++ drivers/mmc/spl_mmc.c | 18 ++ 2 files changed, 28 insertions(+) diff --git a/README b/README index 595c05d..3bac95b 100644 --- a/README +++ b/README @@ -2915,6 +2915,16 @@ FIT uImage format: Address, size and partition on the MMC to load U-Boot from when the MMC is being used in raw mode. + CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR + Sector to load kernel uImage from when MMC is being + used in raw mode (for Falcon mode) + + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS + Sector and number of sectors to load kernel argument + parameters from when MMC is being used in raw mode + (for falcon mode) + CONFIG_SPL_FAT_SUPPORT Support for fs/fat/libfat.o in SPL binary diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d710c0d..170fa38 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -63,6 +63,21 @@ end: return (err == 0); } +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_raw_os(struct mmc *mmc) +{ + if (!mmc-block_dev.block_read(0, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS, + (void *)CONFIG_SYS_SPL_ARGS_ADDR)) { + printf(mmc args blk read error\n); + return -1; + } + + return mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR); +} +#endif + #ifdef CONFIG_SPL_FAT_SUPPORT static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { @@ -130,6 +145,9 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_raw_os(mmc)) +#endif err = mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 3/6] spl_mmc: add Falcon mode support for FAT variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from CONFIG_SPL_FAT_LOAD_KERNEL_NAME file and kernel argument parameters from CONFIG_SPL_FAT_LOAD_ARGS_NAME, both from the same partition as u-boot. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- README|8 drivers/mmc/spl_mmc.c | 21 + 2 files changed, 29 insertions(+) diff --git a/README b/README index 0d37d56..595c05d 100644 --- a/README +++ b/README @@ -2921,6 +2921,14 @@ FIT uImage format: CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME Filename to read to load U-Boot when reading from FAT + CONFIG_SPL_FAT_LOAD_KERNEL_NAME + Filename to read to load kernel uImage when reading + from FAT (for Falcon mode) + + CONFIG_SPL_FAT_LOAD_ARGS_NAME + Filename to read to load kernel argument parameters + when reading from FAT (for Falcon mode) + CONFIG_SPL_MPC83XX_WAIT_FOR_NAND Set this for NAND SPL on PPC mpc83xx targets, so that start.S waits for the rest of the SPL to load before diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index fac6f2d..d250b40 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -91,6 +91,24 @@ end: return (err = 0); } + +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_fat_os(struct mmc *mmc) +{ + int err; + + err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME, + (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0); + if (err = 0) { + printf(spl: error reading image %s, err - %d\n, + CONFIG_SPL_FAT_LOAD_ARGS_NAME, err); + return -1; + } + + return mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_KERNEL_NAME); +} +#endif + #endif void spl_mmc_load_image(void) @@ -128,6 +146,9 @@ void spl_mmc_load_image(void) hang(); } +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_fat_os(mmc)) +#endif err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat) and nand
Jump into full u-boot mode if a 'c' character is received on the uart. We need to adjust the spl bss/malloc area to not overlap with the loadaddr of the kernel (sdram + 32k), so move it past u-boot instead. For raw mmc, we store the kernel parameter area in the free space after the MBR (if used). For nand, we use the last sector of the partition reserved for u-boot. This also enables the spl command in the full u-boot so the kernel parameter area snapshot can be created. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- board/ti/am335x/board.c |9 + include/configs/am335x_evm.h | 27 +-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index b371376..23fe188 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -297,6 +297,15 @@ static struct emif_regs ddr3_evm_emif_reg_data = { .emif_ddr_phy_ctlr_1 = MT41J512M8RH125_EMIF_READ_LATENCY | PHY_EN_DYN_PWRDN, }; + +#ifdef CONFIG_SPL_OS_BOOT +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + return (serial_tstc() serial_getc() == 'c'); +} +#endif + #endif /* diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index ef00306..3b90211 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -307,13 +307,36 @@ #define CONFIG_SPL_MAX_SIZE(101 * 1024) #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR -#define CONFIG_SPL_BSS_START_ADDR 0x8000 +#define CONFIG_SPL_OS_BOOT + +#define CONFIG_SPL_BSS_START_ADDR 0x80a0 #define CONFIG_SPL_BSS_MAX_SIZE0x8 /* 512 KB */ #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR0x300 /* address 0x6 */ #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */ #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME u-boot.img + +#ifdef CONFIG_SPL_OS_BOOT +/* fat */ +#define CONFIG_SPL_FAT_LOAD_KERNEL_NAMEuImage +#define CONFIG_SPL_FAT_LOAD_ARGS_NAME args +#define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_DRAM_1 + 0x100) + +/* raw mmc */ +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x500 /* address 0xa */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8 /* address 0x1000 */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 8 /* 4KB */ + +/* nand */ +#define CONFIG_CMD_SPL_NAND_OFS0x24 /* end of u-boot */ +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS0x28 +#define CONFIG_CMD_SPL_WRITE_SIZE 0x1000 + +/* spl export command */ +#define CONFIG_CMD_SPL +#endif + #define CONFIG_SPL_MMC_SUPPORT #define CONFIG_SPL_FAT_SUPPORT #define CONFIG_SPL_I2C_SUPPORT @@ -375,7 +398,7 @@ * other needs. */ #define CONFIG_SYS_TEXT_BASE 0x8080 -#define CONFIG_SYS_SPL_MALLOC_START0x80208000 +#define CONFIG_SYS_SPL_MALLOC_START0x80a08000 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10 /* Since SPL did pll and ddr initialization for us, -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 0/6] Falcon boot mode for spl_mmc
This patch series adds falcon boot mode for MMC (raw and FAT), similar to the existing nand support. As an example, it adds falcon boot support for the am335x evm board, which is the platform that has been used to test the series. Changes since V1: - Adjusted am335x parameters according to Tom Rini's feedback. Added spl command for easy kernel parameter area snapshot creation. Peter Korsgaard (6): spl_mmc: return error from mmc_load_image_{raw,fat} rather than hanging spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init out spl_mmc: add Falcon mode support for FAT variant spl_mmc: mmc_load_image_raw(): Add sector argument spl_mmc: add Falcon mode support for raw variant RFC: am335x: enable falcon boot mode for mmc (raw and fat) and nand README | 18 + board/ti/am335x/board.c |9 + drivers/mmc/spl_mmc.c| 91 ++ include/configs/am335x_evm.h | 27 - 4 files changed, 117 insertions(+), 28 deletions(-) -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv2 4/6] spl_mmc: mmc_load_image_raw(): Add sector argument
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d250b40..d710c0d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static int mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector) { unsigned long err; u32 image_size_sectors; @@ -42,10 +42,7 @@ static int mmc_load_image_raw(struct mmc *mmc) sizeof(struct image_header)); /* read image header to find the image size load address */ - err = mmc-block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1, - header); - + err = mmc-block_dev.block_read(0, sector, 1, header); if (err == 0) goto end; @@ -56,9 +53,8 @@ static int mmc_load_image_raw(struct mmc *mmc) mmc-read_bl_len; /* Read the header too to avoid extra memcpy */ - err = mmc-block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, - image_size_sectors, (void *)spl_image.load_addr); + err = mmc-block_dev.block_read(0, sector, image_size_sectors, + (void *)spl_image.load_addr); end: if (err == 0) @@ -134,7 +130,8 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); - err = mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc, + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCHv2 6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat) and nand
Tom == Tom Rini tr...@ti.com writes: Hi, This also enables the spl command in the full u-boot so the kernel parameter area snapshot can be created. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com Tom You forgot to drop the RFC part :) Argh, indeed. +/* nand */ +#define CONFIG_CMD_SPL_NAND_OFS0x24 /* end of u-boot */ Tom This is fine but please update MTDPARTS_DEFAULT with this change Tom as well (call it u-boot-spl-os). Thanks! Ok, I will give it a day or two to see if there's more feedback and then send a v3 with this fixed. Thanks for the review. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] tools: default image: use ih_size for checking data size
Jonas == Jonas Gorski j...@openwrt.org writes: Jonas Common image usage is uImage + appended rootfs, so the the uImage data Jonas is only part of the total image. So read out and use the header's Jonas ih_size field instead of the total file size. Jonas To prevent reading over the end of the buffer, check that the image file Jonas is big enough to contain the data before calculating its checksum. Jonas Before: Jonas ~# mkimage -l dir665_fw_100NA.bin Jonas mkimage: ERROR: dir665_fw_100NA/dir665_fw_100NA.bin has corrupted data! A related usecase is checking the version info of whatever is written to flash - E.G. mkimage -l /dev/mtdN But that already fails as stat returns st_size=0 for devices. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] am33xx: Fix warning with CONFIG_DISPLAY_CPUINFO
Tom == Tom Rini tr...@ti.com writes: Tom The arm_freq and ddr_freq variables are unused, so remove. Fixup Tom whitespace slightly while in here. Tom Signed-off-by: Tom Rini tr...@ti.com Reviewed-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat)
Peter == Peter Korsgaard jac...@sunsite.dk writes: Hi, Tom We should do some real defines here while at it, since the GP EVM Tom has NAND :) Peter Yes. It's a bit unfortunate that CONFIG_SPL_OS_BOOT is a global Peter setting, so you need all the various falcon boot related defines Peter even if you don't plan on using them. Peter I can try to come up with sensible NAND values, but I don't have Peter a EVM to test. Any comments on patch 1-5? Tom, do you want me to send an update to patch 6 with some more sensible nand parameters? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC
Tom == Tom Rini tr...@ti.com writes: Tom In the case of booting from certain peripherals, such as UART, we must Tom not see what the device descriptor says for RAW or FAT mode because in Tom addition to being nonsensical, it leads to a hang. This is why we have Tom a test currently for the boot mode being within range. The problem Tom however is that on some platforms we get MMC2_2 as the boot mode and not Tom the defined value for MMC2, and in others we get the value for MMC2_2. Tom This is required to fix eMMC booting on omap5_uevm. Tom Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD on Tom classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC). Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom arch/arm/cpu/armv7/omap-common/lowlevel_init.S | 10 +++--- Tom arch/arm/include/asm/arch-am33xx/spl.h |3 +++ Tom arch/arm/include/asm/arch-omap3/spl.h |3 +++ Tom arch/arm/include/asm/arch-omap4/spl.h |2 ++ Tom arch/arm/include/asm/arch-omap5/spl.h |2 ++ Tom 5 files changed, 17 insertions(+), 3 deletions(-) Tom diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom index b933fe8..90b3c8a 100644 Tom --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom @@ -60,10 +60,14 @@ ENTRY(save_boot_params) Tom ldr r3, =boot_params Tom strbr2, [r3, #BOOT_DEVICE_OFFSET] @ spl_boot_device - r1 Tom - /* boot mode is passed only for devices that can raw/fat mode */ Tom - cmp r2, #BOOT_DEVICE_XIP Tom + /* Tom + * boot mode is only valid for device that can be raw or FAT booted. Tom + * in other cases it may be fatal to look. While platforms differ Tom + * in the values used for each MMC slot, they are contiguous. Tom + */ Tom + cmp r2, #MMC_BOOT_DEVICES_START Tom blt 2f Tom - cmp r2, #BOOT_DEVICE_MMC2 Tom + cmp r2, #MMC_BOOT_DEVICES_END Tom bgt 2f Tom /* Store the boot mode (raw/FAT) in omap_bootmode */ Tom ldr r2, [r0, #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr Tom diff --git a/arch/arm/include/asm/arch-am33xx/spl.h b/arch/arm/include/asm/arch-am33xx/spl.h Tom index f60b086..14a2c7c 100644 Tom --- a/arch/arm/include/asm/arch-am33xx/spl.h Tom +++ b/arch/arm/include/asm/arch-am33xx/spl.h Tom @@ -37,4 +37,7 @@ Tom #define BOOT_DEVICE_USBETH 68 Tom #define BOOT_DEVICE_CPGMAC 70 Tom #define BOOT_DEVICE_MMC2_2 0xFF Tom + Tom +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 Tom +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2 Doesn't this break ti814x with the funky inverted mmc1/mmc2? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] am335x: Enable MMC1 clock
Tom == Tom Rini tr...@ti.com writes: Tom We must not assume ROM has enabled the clock for MMC1. Tom Reported-by: Koen Kooi k...@dominion.thruhere.net Tom Signed-off-by: Tom Rini tr...@ti.com Acked-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/8] Prepare for TI816X : reuse existing code from TI814X
TENART == TENART Antoine aten...@adeneo-embedded.com writes: TENART Rename some CONFIG_TI814X to a more generic CONFIG_81XX Acked-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] Add TI816X mux definitions.
TENART == TENART Antoine aten...@adeneo-embedded.com writes: Acked-by: Peter Korsgaard jac...@sunsite.dk I just now noticed that you forgot to sign off on your patches (-s option). -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] Add TI816X mmc clock reference
TENART == TENART Antoine aten...@adeneo-embedded.com writes: Acked-by: Peter Korsgaard jac...@sunsite.dk -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/8] Add TI816X cpu definitions
TENART == TENART Antoine aten...@adeneo-embedded.com writes: TENART --- TENART arch/arm/include/asm/arch-am33xx/cpu.h|4 + TENART arch/arm/include/asm/arch-am33xx/cpu_ti816x.h | 269 + TENART arch/arm/include/asm/emif.h |4 + TENART 3 files changed, 277 insertions(+) TENART create mode 100644 arch/arm/include/asm/arch-am33xx/cpu_ti816x.h TENART diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h b/arch/arm/include/asm/arch-am33xx/cpu.h TENART index 13c0667..34b3aa9 100644 TENART --- a/arch/arm/include/asm/arch-am33xx/cpu.h TENART +++ b/arch/arm/include/asm/arch-am33xx/cpu.h TENART @@ -25,6 +25,10 @@ TENART #include asm/arch/hardware.h TENART +#if defined(CONFIG_TI816X) TENART +#include asm/arch/cpu_ti816x.h TENART +#endif TENART + TENART #define BIT(x)(1 x) TENART #define CL_BIT(x) (0 x) TENART diff --git a/arch/arm/include/asm/arch-am33xx/cpu_ti816x.h b/arch/arm/include/asm/arch-am33xx/cpu_ti816x.h TENART new file mode 100644 TENART index 000..b4a13a8 TENART --- /dev/null TENART +++ b/arch/arm/include/asm/arch-am33xx/cpu_ti816x.h TENART @@ -0,0 +1,269 @@ TENART +/* TENART + * cpu_ti816x.h TENART + * TENART + * Copyright (C) 2013, Adeneo Embedded www.adeneo-embedded.com TENART + * Antoine Tenart, aten...@adeneo-embedded.com TENART + * TENART + * Based on TI-PSP-04.00.02.14 : TENART + * TENART + * (C) Copyright 2006 TENART + * Texas Instruments, www.ti.com TENART + * TENART + * See file CREDITS for list of people who contributed to this TENART + * project. TENART + * TENART + * This program is free software; you can redistribute it and/or TENART + * modify it under the terms of the GNU General Public License as TENART + * published by the Free Software Foundation; either version 2 of TENART + * the License, or (at your option) any later version. TENART + * TENART + * This program is distributed in the hope that it will be useful, TENART + * but WITHOUT ANY WARRANTY; without even the implied warranty of TENART + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the TENART + * GNU General Public License for more details. TENART + * TENART + * You should have received a copy of the GNU General Public License TENART + * along with this program; if not, write to the Free Software TENART + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, TENART + * MA 02111-1307 USA TENART + * TENART + */ TENART + TENART +#ifndef _TI816X_CPU_H TENART +#define _TI816X_CPU_H TENART + TENART +#include asm/arch/hardware.h TENART + TENART +/* Timer registers */ TENART +#define TIMER_TCLR0x38/* Timer control register */ TENART +#define TIMER_TCRR0x3C/* Timer counter register */ TENART +#define TIMER_TLDR0x40/* Timer load value register*/ TENART + Are these defines all needed? As far as I can see from skimming the series, they aren't referenced anywhere. TENART diff --git a/arch/arm/include/asm/emif.h b/arch/arm/include/asm/emif.h TENART index ed251ec..a7b938c 100644 TENART --- a/arch/arm/include/asm/emif.h TENART +++ b/arch/arm/include/asm/emif.h TENART @@ -521,7 +521,11 @@ TENART #define SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES 0x01A7 TENART /* DMM */ TENART +#if defined(CONFIG_TI816X) TENART +#define DMM_BASE 0x4E00 TENART +#else TENART #define DMM_BASE 0x4E40 TENART +#endif I don't think that's right. Matt's series uses DMM_BASE to refer to the lisa registers, which are offset 0x40 from the DMM region, so I think you can drop this. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/8] Add TI816X specific register definitions
TENART == TENART Antoine aten...@adeneo-embedded.com writes: TENART Also move some non common defintions from hardware.h TENART --- TENART arch/arm/include/asm/arch-am33xx/hardware.h|7 +-- TENART arch/arm/include/asm/arch-am33xx/hardware_am33xx.h |5 ++ TENART arch/arm/include/asm/arch-am33xx/hardware_ti814x.h |5 ++ TENART arch/arm/include/asm/arch-am33xx/hardware_ti816x.h | 58 TENART 4 files changed, 70 insertions(+), 5 deletions(-) TENART create mode 100644 arch/arm/include/asm/arch-am33xx/hardware_ti816x.h .. TENART +#define DDRPHY_0_CONFIG_BASE 0x48198000 TENART +#define DDRPHY_1_CONFIG_BASE 0x4819a000 TENART +#define DDRPHY_CONFIG_BASE((emif == 0) ? DDRPHY_0_CONFIG_BASE:DDRPHY_1_CONFIG_BASE) TENART + TENART +/* CPSW Config space */ TENART +#define CPSW_MDIO_BASE0x4A100800 ti816x doesn't have CPSW, so the name is a bit odd (the base address matches the emac mdio module). The emac driver expects an asm/arch/emac_defs.h header with a EMAC_MDIO_BASE_ADDR define (among others). Perhaps just drop it from here as you're not adding emac support in this series anyway. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/8] Prepare for TI816X : reuse existing code from TI814X
Tom == Tom Rini tr...@ti.com writes: Tom On Thu, Mar 28, 2013 at 06:14:34PM +0100, TENART Antoine wrote: Rename some CONFIG_TI814X to a more generic CONFIG_81XX Tom This is fine except it breaks bisectability, you need to also add Tom CONFIG_TI81XX to ti814x_evm.h at this point. It afaik already has it. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat)
Tom == Tom Rini tr...@ti.com writes: Tom On Sun, Mar 24, 2013 at 10:51:33PM +0100, Peter Korsgaard wrote: Jump into full u-boot mode if a 'c' character is received on the uart. We need to adjust the spl bss/malloc area to not overlap with the loadaddr of the kernel (sdram + 32k), so move it past u-boot instead. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com Tom [snip] +/* raw mmc */ +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0xa00 /* address 0xa */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8 /* address 0x1000 */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 8 /* 4KB */ Tom Did you also test raw mode? Yes, I did. I'm personally most interested in raw mode because of the 4x redundant MLO handling. Tom Also, why 0xa00? U-Boot is 0x300 - 0x500, Tom and one might say throw a redundant copy at 0x500 - 0x700. But we Tom don't do 4 copy redundancy in U-Boot, just 2 usually. No particular reason, 0x700 should work as well. As mentioned, this was just a proof of concept to be able to test it. +/* dummy defines to keep spl_nand.c happy */ +#define CONFIG_CMD_SPL_NAND_OFS0 +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS0 +#define CONFIG_CMD_SPL_WRITE_SIZE 0 Tom We should do some real defines here while at it, since the GP EVM has Tom NAND :) Yes. It's a bit unfortunate that CONFIG_SPL_OS_BOOT is a global setting, so you need all the various falcon boot related defines even if you don't plan on using them. I can try to come up with sensible NAND values, but I don't have a EVM to test. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat)
Tom == Tom Rini tr...@ti.com writes: Hi, Yes, I did. I'm personally most interested in raw mode because of the 4x redundant MLO handling. Tom Note that you only get 3 on RAW mode because we place U-Boot (by Tom default) in the fourth slot. I noticed this recently but was hesitant Tom to break possible deployed setups (in beagle land). RAW mode isnt' well Tom documented, but it is in a few places. For your device I imagine you Tom could fix things however. And you possibly lose the first if you need a DOS style MBR, but that's OK, I just want to be able to field upgrade the MLO without risks, so 2 is enough. No particular reason, 0x700 should work as well. As mentioned, this was just a proof of concept to be able to test it. Tom Right. And I'd love to see bootcount or similar updated so that Tom we can try redundant copies of U-Boot. Me too. I'll do some work on it in the relatively near future. I haven't looked enough into it yet to know if bootcount is enough, or if I would need custom SPL logic (basically a platform specific spl board_init_r). The behaviour I would like to have is: - eMMC split in two parts, and everything (u-boot/linux/rootfs) doubled - SPL reads a flag somewhere (probably a raw eMMC sector) to decide if it should boot low or high uImage / u-boot - On error (reset because of watchdog, bootcount, ..?) it falls back to the other part - On upgrades the currently unused part is written and the boot flag changed. That's AFAIK currently not possible to do with SPL, as the boot addresses are build time defines. I can try to come up with sensible NAND values, but I don't have a EVM to test. Tom Well, CONFIG_SYS_NAND_SPL_KERNEL_OFFS would be where we say nandimgsrc Tom is in env. Stefano, looking at twister, the spl export looks like it Tom goes right at the start of the rootfs, isn't that bad? Or at least, Tom luck? You mean nandsrcaddr, right? CONFIG_CMD_SPL_NAND_OFS just need to be somewhere unused on the nand. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/6] spl_mmc: return error from mmc_load_image_{raw, fat} rather than hanging
So we can instead fallback to doing something else on errors. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 7efdcb8..0c50657 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static void mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc) { unsigned long err; u32 image_size_sectors; @@ -61,14 +61,14 @@ static void mmc_load_image_raw(struct mmc *mmc) image_size_sectors, (void *)spl_image.load_addr); end: - if (err == 0) { + if (err == 0) printf(spl: mmc blk read err - %lu\n, err); - hang(); - } + + return (err == 0); } #ifdef CONFIG_SPL_FAT_SUPPORT -static void mmc_load_image_fat(struct mmc *mmc) +static int mmc_load_image_fat(struct mmc *mmc) { int err; struct image_header *header; @@ -94,11 +94,11 @@ static void mmc_load_image_fat(struct mmc *mmc) (u8 *)spl_image.load_addr, 0); end: - if (err = 0) { + if (err = 0) printf(spl: error reading image %s, err - %d\n, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err); - hang(); - } + + return (err = 0); } #endif @@ -121,17 +121,21 @@ void spl_mmc_load_image(void) printf(spl: mmc init failed: err - %d\n, err); hang(); } + boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); - mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); - mmc_load_image_fat(mmc); + err = mmc_load_image_fat(mmc); #endif } else { puts(spl: wrong MMC boot mode\n); hang(); } + + if (err) + hang(); } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/6] RFC: am335x: enable falcon boot mode for mmc (raw and fat)
Jump into full u-boot mode if a 'c' character is received on the uart. We need to adjust the spl bss/malloc area to not overlap with the loadaddr of the kernel (sdram + 32k), so move it past u-boot instead. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- board/ti/am335x/board.c |9 + include/configs/am335x_evm.h | 25 +++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index f4b972b..5efbf3f 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -263,6 +263,15 @@ static struct emif_regs ddr3_evm_emif_reg_data = { .zq_config = MT41J512M8RH125_ZQ_CFG, .emif_ddr_phy_ctlr_1 = MT41J512M8RH125_EMIF_READ_LATENCY, }; + +#ifdef CONFIG_SPL_OS_BOOT +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + return (serial_tstc() serial_getc() == 'c'); +} +#endif + #endif /* diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 9eada95..26c500a 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -259,13 +259,34 @@ #define CONFIG_SPL_MAX_SIZE(101 * 1024) #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR -#define CONFIG_SPL_BSS_START_ADDR 0x8000 +#define CONFIG_SPL_OS_BOOT + +#define CONFIG_SPL_BSS_START_ADDR 0x80a0 #define CONFIG_SPL_BSS_MAX_SIZE0x8 /* 512 KB */ #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR0x300 /* address 0x6 */ #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */ #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME u-boot.img + +#ifdef CONFIG_SPL_OS_BOOT +/* fat */ +#define CONFIG_SPL_FAT_LOAD_KERNEL_NAMEuImage +#define CONFIG_SPL_FAT_LOAD_ARGS_NAME args +#define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_DRAM_1 + 0x100) + +/* raw mmc */ +#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0xa00 /* address 0xa */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8 /* address 0x1000 */ +#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 8 /* 4KB */ + +/* dummy defines to keep spl_nand.c happy */ +#define CONFIG_CMD_SPL_NAND_OFS0 +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS0 +#define CONFIG_CMD_SPL_WRITE_SIZE 0 + +#endif + #define CONFIG_SPL_MMC_SUPPORT #define CONFIG_SPL_FAT_SUPPORT #define CONFIG_SPL_I2C_SUPPORT @@ -327,7 +348,7 @@ * other needs. */ #define CONFIG_SYS_TEXT_BASE 0x8080 -#define CONFIG_SYS_SPL_MALLOC_START0x80208000 +#define CONFIG_SYS_SPL_MALLOC_START0x80a08000 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x10 /* Since SPL did pll and ddr initialization for us, -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/6] spl_mmc: add Falcon mode support for raw variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from sector CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS of kernel argument parameters starting from sector CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- README| 10 ++ drivers/mmc/spl_mmc.c | 18 ++ 2 files changed, 28 insertions(+) diff --git a/README b/README index ef1aca1..a30b7a2 100644 --- a/README +++ b/README @@ -2845,6 +2845,16 @@ FIT uImage format: Address, size and partition on the MMC to load U-Boot from when the MMC is being used in raw mode. + CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR + Sector to load kernel uImage from when MMC is being + used in raw mode (for Falcon mode) + + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS + Sector and number of sectors to load kernel argument + parameters from when MMC is being used in raw mode + (for falcon mode) + CONFIG_SPL_FAT_SUPPORT Support for fs/fat/libfat.o in SPL binary diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d710c0d..170fa38 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -63,6 +63,21 @@ end: return (err == 0); } +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_raw_os(struct mmc *mmc) +{ + if (!mmc-block_dev.block_read(0, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, + CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS, + (void *)CONFIG_SYS_SPL_ARGS_ADDR)) { + printf(mmc args blk read error\n); + return -1; + } + + return mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR); +} +#endif + #ifdef CONFIG_SPL_FAT_SUPPORT static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { @@ -130,6 +145,9 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_raw_os(mmc)) +#endif err = mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/6] spl_mmc: mmc_load_image_raw(): Add sector argument
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index d250b40..d710c0d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR; -static int mmc_load_image_raw(struct mmc *mmc) +static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector) { unsigned long err; u32 image_size_sectors; @@ -42,10 +42,7 @@ static int mmc_load_image_raw(struct mmc *mmc) sizeof(struct image_header)); /* read image header to find the image size load address */ - err = mmc-block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1, - header); - + err = mmc-block_dev.block_read(0, sector, 1, header); if (err == 0) goto end; @@ -56,9 +53,8 @@ static int mmc_load_image_raw(struct mmc *mmc) mmc-read_bl_len; /* Read the header too to avoid extra memcpy */ - err = mmc-block_dev.block_read(0, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, - image_size_sectors, (void *)spl_image.load_addr); + err = mmc-block_dev.block_read(0, sector, image_size_sectors, + (void *)spl_image.load_addr); end: if (err == 0) @@ -134,7 +130,8 @@ void spl_mmc_load_image(void) boot_mode = spl_boot_mode(); if (boot_mode == MMCSD_MODE_RAW) { debug(boot mode - RAW\n); - err = mmc_load_image_raw(mmc); + err = mmc_load_image_raw(mmc, + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/6] spl_mmc: add Falcon mode support for FAT variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from CONFIG_SPL_FAT_LOAD_KERNEL_NAME file and kernel argument parameters from CONFIG_SPL_FAT_LOAD_ARGS_NAME, both from the same partition as u-boot. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- README|8 drivers/mmc/spl_mmc.c | 21 + 2 files changed, 29 insertions(+) diff --git a/README b/README index 7f2506a..ef1aca1 100644 --- a/README +++ b/README @@ -2851,6 +2851,14 @@ FIT uImage format: CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME Filename to read to load U-Boot when reading from FAT + CONFIG_SPL_FAT_LOAD_KERNEL_NAME + Filename to read to load kernel uImage when reading + from FAT (for Falcon mode) + + CONFIG_SPL_FAT_LOAD_ARGS_NAME + Filename to read to load kernel argument parameters + when reading from FAT (for Falcon mode) + CONFIG_SPL_MPC83XX_WAIT_FOR_NAND Set this for NAND SPL on PPC mpc83xx targets, so that start.S waits for the rest of the SPL to load before diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index fac6f2d..d250b40 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -91,6 +91,24 @@ end: return (err = 0); } + +#ifdef CONFIG_SPL_OS_BOOT +static int mmc_load_image_fat_os(struct mmc *mmc) +{ + int err; + + err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME, + (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0); + if (err = 0) { + printf(spl: error reading image %s, err - %d\n, + CONFIG_SPL_FAT_LOAD_ARGS_NAME, err); + return -1; + } + + return mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_KERNEL_NAME); +} +#endif + #endif void spl_mmc_load_image(void) @@ -128,6 +146,9 @@ void spl_mmc_load_image(void) hang(); } +#ifdef CONFIG_SPL_OS_BOOT + if (spl_start_uboot() || mmc_load_image_fat_os(mmc)) +#endif err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/6] spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init out
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 0c50657..fac6f2d 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -68,7 +68,7 @@ end: } #ifdef CONFIG_SPL_FAT_SUPPORT -static int mmc_load_image_fat(struct mmc *mmc) +static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { int err; struct image_header *header; @@ -76,27 +76,18 @@ static int mmc_load_image_fat(struct mmc *mmc) header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - sizeof(struct image_header)); - err = fat_register_device(mmc-block_dev, - CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); - if (err) { - printf(spl: fat register err - %d\n, err); - hang(); - } - - err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - header, sizeof(struct image_header)); + err = file_fat_read(filename, header, sizeof(struct image_header)); if (err = 0) goto end; spl_parse_image_header(header); - err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - (u8 *)spl_image.load_addr, 0); + err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0); end: if (err = 0) printf(spl: error reading image %s, err - %d\n, - CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err); + filename, err); return (err = 0); } @@ -129,7 +120,15 @@ void spl_mmc_load_image(void) #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug(boot mode - FAT\n); - err = mmc_load_image_fat(mmc); + + err = fat_register_device(mmc-block_dev, + CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); + if (err) { + printf(spl: fat register err - %d\n, err); + hang(); + } + + err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { puts(spl: wrong MMC boot mode\n); -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] sba...@denx.de
Hi, This patch series adds falcon boot mode for MMC (raw and FAT), similar to the existing nand support. This series applies on top of the recent spl_mmc variable cleanup: http://lists.denx.de/pipermail/u-boot/2013-March/149674.html As an example, it includes a RFC patch adding falcon boot support for the am335x evm board, which has been used to test the series. That patch should not be committed as is. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/6] Falcon boot mode for spl_mmc
Ehh, seems I fat fingered the subject :/ On Sun, Mar 24, 2013 at 10:51 PM, Peter Korsgaard peter.korsga...@barco.com wrote: Hi, This patch series adds falcon boot mode for MMC (raw and FAT), similar to the existing nand support. This series applies on top of the recent spl_mmc variable cleanup: http://lists.denx.de/pipermail/u-boot/2013-March/149674.html As an example, it includes a RFC patch adding falcon boot support for the am335x evm board, which has been used to test the series. That patch should not be committed as is. -- Bye, Peter Korsgaard -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] mmc: mmc_getcd/getwp: use sensible defaults
Let mmc_getcd() return true and mmc_getwp() false if mmc driver doesn't provide handlers for them. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/mmc.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 7b5fdd9..54d23eb 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -51,8 +51,11 @@ int mmc_getwp(struct mmc *mmc) wp = board_mmc_getwp(mmc); - if ((wp 0) mmc-getwp) - wp = mmc-getwp(mmc); + if (wp 0) + if (mmc-getwp) + wp = mmc-getwp(mmc); + else + wp = 0; return wp; } @@ -692,8 +695,11 @@ int mmc_getcd(struct mmc *mmc) cd = board_mmc_getcd(mmc); - if ((cd 0) mmc-getcd) - cd = mmc-getcd(mmc); + if (cd 0) + if (mmc-getcd) + cd = mmc-getcd(mmc); + else + cd = 1; return cd; } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] mmc: omap_hsmmc.c: only register getcd/getwp callbacks if gpio could be used
Gets rid of warnings from omap_gpio: ERROR : check_gpio: invalid GPIO -1 (and undefined behaviour as the -1 error code is interpreted as gpio value) Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/omap_hsmmc.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 67cfcc2..166744c 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -593,8 +593,6 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio, mmc-send_cmd = mmc_send_cmd; mmc-set_ios = mmc_set_ios; mmc-init = mmc_init_setup; - mmc-getcd = omap_mmc_getcd; - mmc-getwp = omap_mmc_getwp; mmc-priv = priv_data; switch (dev_index) { @@ -616,7 +614,13 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio, return 1; } priv_data-cd_gpio = omap_mmc_setup_gpio_in(cd_gpio, mmc_cd); + if (priv_data-cd_gpio != -1) + mmc-getcd = omap_mmc_getcd; + priv_data-wp_gpio = omap_mmc_setup_gpio_in(wp_gpio, mmc_wp); + if (priv_data-wp_gpio != -1) + mmc-getwp = omap_mmc_getwp; + mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; mmc-host_caps = (MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_HC) ~host_caps_mask; -- 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 2/2] mmc: omap_hsmmc.c: only register getcd/getwp callbacks if gpio could be used
Tom == Tom Rini tr...@ti.com writes: priv_data- cd_gpio = omap_mmc_setup_gpio_in(cd_gpio, mmc_cd); + if (priv_data-cd_gpio != -1) + mmc-getcd = omap_mmc_getcd; + priv_data- wp_gpio = omap_mmc_setup_gpio_in(wp_gpio, mmc_wp); + if (priv_data-wp_gpio != -1) + mmc-getwp = omap_mmc_getwp; + Tom OK, but this should be gpio_is_valid rather than != -1, and then this is Tom probably a better way than my series. Well, omap_mmc_setup_gpio_in() explicitly return -1 on errors (could be a valid gpio, just already reserved or unable to make input). -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] mmc: mmc_getcd/getwp: use sensible defaults
Tom == Tom Rini tr...@ti.com writes: Tom On Thu, Mar 21, 2013 at 03:00:03PM +0100, Peter Korsgaard wrote: Let mmc_getcd() return true and mmc_getwp() false if mmc driver doesn't provide handlers for them. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com Tom Do we really need to do this? It seems like we should be working Tom correctly here already, or we also need to fixup the weak function Tom and/or the callers too. Well, for omap_hsmmc we currently return -1, which is kind of okay for getcd(), but if getwp() ever gets used it means we cannot write to cards. -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] spl_mmc: cleanup variable types
block_read returns unsigned long, so it doesn't make sense to check for 0. and neither does marking the header structure as const and then casting away the constness to load data into it. Also cleanup some unneeded pointer casting while we're at it. Signed-off-by: Peter Korsgaard peter.korsga...@barco.com --- drivers/mmc/spl_mmc.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c index 753c6a0..7efdcb8 100644 --- a/drivers/mmc/spl_mmc.c +++ b/drivers/mmc/spl_mmc.c @@ -34,8 +34,9 @@ DECLARE_GLOBAL_DATA_PTR; static void mmc_load_image_raw(struct mmc *mmc) { - u32 image_size_sectors, err; - const struct image_header *header; + unsigned long err; + u32 image_size_sectors; + struct image_header *header; header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - sizeof(struct image_header)); @@ -43,9 +44,9 @@ static void mmc_load_image_raw(struct mmc *mmc) /* read image header to find the image size load address */ err = mmc-block_dev.block_read(0, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1, - (void *)header); + header); - if (err = 0) + if (err == 0) goto end; spl_parse_image_header(header); @@ -60,8 +61,8 @@ static void mmc_load_image_raw(struct mmc *mmc) image_size_sectors, (void *)spl_image.load_addr); end: - if (err = 0) { - printf(spl: mmc blk read err - %d\n, err); + if (err == 0) { + printf(spl: mmc blk read err - %lu\n, err); hang(); } } @@ -69,7 +70,7 @@ end: #ifdef CONFIG_SPL_FAT_SUPPORT static void mmc_load_image_fat(struct mmc *mmc) { - s32 err; + int err; struct image_header *header; header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - @@ -83,7 +84,7 @@ static void mmc_load_image_fat(struct mmc *mmc) } err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, - (u8 *)header, sizeof(struct image_header)); + header, sizeof(struct image_header)); if (err = 0) goto end; -- 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] arm: Correct CONFIG_STANDALONE_LOAD_ADDR for AM33XX/OMAP* platforms
Tom == Tom Rini tr...@ti.com writes: Tom All of these platforms have memory starting at 0x8000, so this is Tom the correct CONFIG_STANDALONE_LOAD_ADDR for all of them. For am33xx atleast: Acked-by: Peter Korsgaard jac...@sunsite.dk Tom Signed-off-by: Tom Rini tr...@ti.com Tom --- Tom arch/arm/config.mk |2 +- Tom 1 file changed, 1 insertion(+), 1 deletion(-) Tom diff --git a/arch/arm/config.mk b/arch/arm/config.mk Tom index 24b9d7c..71035e2 100644 Tom --- a/arch/arm/config.mk Tom +++ b/arch/arm/config.mk Tom @@ -24,7 +24,7 @@ Tom CROSS_COMPILE ?= arm-linux- Tom ifndef CONFIG_STANDALONE_LOAD_ADDR Tom -ifeq ($(SOC),omap3) Tom +ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),) Tom CONFIG_STANDALONE_LOAD_ADDR = 0x8030 Tom else Tom CONFIG_STANDALONE_LOAD_ADDR = 0xc10 Tom -- Tom 1.7.9.5 Tom ___ Tom U-Boot mailing list Tom U-Boot@lists.denx.de Tom http://lists.denx.de/mailman/listinfo/u-boot -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot