Re: [U-Boot] [PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb driver
ping. On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > Add callbacks to set up DP-HPD, backlight and LCD power > on SMDK5420. > > Signed-off-by: Ajay Kumar > --- > board/samsung/smdk5420/smdk5420.c | 118 > +++--- > 1 file changed, 34 insertions(+), 84 deletions(-) > > diff --git a/board/samsung/smdk5420/smdk5420.c > b/board/samsung/smdk5420/smdk5420.c > index cf76455..3f29ce0 100644 > --- a/board/samsung/smdk5420/smdk5420.c > +++ b/board/samsung/smdk5420/smdk5420.c > @@ -137,98 +137,48 @@ int board_mmc_init(bd_t *bis) > #endif > > #ifdef CONFIG_LCD > -void cfg_lcd_gpio(void) > +void exynos_cfg_lcd_gpio(void) > { > - struct exynos5_gpio_part1 *gpio1 = > - (struct exynos5_gpio_part1 *)samsung_get_base_gpio_part1(); > + struct exynos5420_gpio_part2 *gpio2 = > + (struct exynos5420_gpio_part2 > *)samsung_get_base_gpio_part2(); > > - /* For Backlight */ > + /* Set Hotplug detect for DP */ > + s5p_gpio_cfg_pin(&gpio2->x0, 7, GPIO_FUNC(0x3)); > +} > + > +void exynos_backlight_on(unsigned int onoff) > +{ > + struct exynos5420_gpio_part1 *gpio1 = > + (struct exynos5420_gpio_part1 > *)samsung_get_base_gpio_part1(); > + > + struct exynos5420_gpio_part2 *gpio2 = > + (struct exynos5420_gpio_part2 > *)samsung_get_base_gpio_part2(); > + > + /* For PWM */ > s5p_gpio_cfg_pin(&gpio1->b2, 0, GPIO_OUTPUT); > s5p_gpio_set_value(&gpio1->b2, 0, 1); > > - /* LCD power on */ > - s5p_gpio_cfg_pin(&gpio1->x1, 5, GPIO_OUTPUT); > - s5p_gpio_set_value(&gpio1->x1, 5, 1); > - > - /* Set Hotplug detect for DP */ > - s5p_gpio_cfg_pin(&gpio1->x0, 7, GPIO_FUNC(0x3)); > + /* BL_EN */ > + s5p_gpio_cfg_pin(&gpio2->x1, 5, GPIO_OUTPUT); > + s5p_gpio_set_value(&gpio2->x1, 5, 1); > } > > -vidinfo_t panel_info = { > - .vl_freq= 60, > - .vl_col = 2560, > - .vl_row = 1600, > - .vl_width = 2560, > - .vl_height = 1600, > - .vl_clkp= CONFIG_SYS_LOW, > - .vl_hsp = CONFIG_SYS_LOW, > - .vl_vsp = CONFIG_SYS_LOW, > - .vl_dp = CONFIG_SYS_LOW, > - .vl_bpix= 4,/* LCD_BPP = 2^4, for output conosle on > LCD */ > - > - /* wDP panel timing infomation */ > - .vl_hspw= 32, > - .vl_hbpd= 80, > - .vl_hfpd= 48, > - > - .vl_vspw= 6, > - .vl_vbpd= 37, > - .vl_vfpd= 3, > - .vl_cmd_allow_len = 0xf, > - > - .win_id = 3, > - .cfg_gpio = cfg_lcd_gpio, > - .backlight_on = NULL, > - .lcd_power_on = NULL, > - .reset_lcd = NULL, > - .dual_lcd_enabled = 0, > - > - .init_delay = 0, > - .power_on_delay = 0, > - .reset_delay= 0, > - .interface_mode = FIMD_RGB_INTERFACE, > - .dp_enabled = 1, > -}; > - > -static struct edp_device_info edp_info = { > - .disp_info = { > - .h_res = 2560, > - .h_sync_width = 32, > - .h_back_porch = 80, > - .h_front_porch = 48, > - .v_res = 1600, > - .v_sync_width = 6, > - .v_back_porch = 37, > - .v_front_porch = 3, > - .v_sync_rate = 60, > - }, > - .lt_info = { > - .lt_status = DP_LT_NONE, > - }, > - .video_info = { > - .master_mode = 0, > - .bist_mode = DP_DISABLE, > - .bist_pattern = NO_PATTERN, > - .h_sync_polarity = 0, > - .v_sync_polarity = 0, > - .interlaced = 0, > - .color_space = COLOR_RGB, > - .dynamic_range = VESA, > - .ycbcr_coeff = COLOR_YCBCR601, > - .color_depth = COLOR_8, > - }, > -}; > - > -static struct exynos_dp_platform_data dp_platform_data = { > - .phy_enable = set_dp_phy_ctrl, > - .edp_dev_info = &edp_info, > -}; > - > -void init_panel_info(vidinfo_t *vid) > +void exynos_lcd_power_on(void) > { > - vid->rgb_mode = MODE_RGB_P, > - > - exynos_set_dp_platform_data(&dp_platform_data); > + int pmic_bus, pmic_i2caddr, ldo38_reg, old_bus; > + u8 value; > + > + /* enable VDD_28IO_DP: LDO38 should be at 2.8V */ > + pmic_bus = 4; > + pmic_i2caddr = 0x66; > + ldo38_reg = 0x62; > + value = 0x78; > + > + old_bus = i2c_get_bus_num(); > + i2c_set_bus_num(pmic_bus); > + if (i2c_write(pmic_i2caddr, ldo38_reg, 1, &value, 1)) > + printf("i2c write fail. Failed to enable VDD_28IO_DP\n"); > + i2c_set_bus_num(old_bus); > } > #endif > > -- > 1.7.12.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ___
Re: [U-Boot] [PATCH 1/6] exynos_fb: Remove usage of static defines
ping. On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > Previously, we used to statically assign values for vl_col, vl_row and > vl_bpix using #defines like LCD_XRES, LCD_YRES and LCD_COLOR16. > > Introducing the function exynos_lcd_early_init() would take care of this > assignment on the fly by parsing FIMD DT properties, thereby allowing us > to remove LCD_XRES and LCD_YRES from the main config file. > > Signed-off-by: Ajay Kumar > --- > arch/arm/include/asm/arch-exynos/system.h | 1 + > board/samsung/common/board.c | 15 +++ > drivers/video/exynos_fb.c | 20 ++-- > include/configs/exynos5250-dt.h | 2 -- > 4 files changed, 22 insertions(+), 16 deletions(-) > > diff --git a/arch/arm/include/asm/arch-exynos/system.h > b/arch/arm/include/asm/arch-exynos/system.h > index 7e2057c..4968d3d 100644 > --- a/arch/arm/include/asm/arch-exynos/system.h > +++ b/arch/arm/include/asm/arch-exynos/system.h > @@ -39,5 +39,6 @@ struct exynos5_sysreg { > > void set_usbhost_mode(unsigned int mode); > void set_system_display_ctrl(void); > +int exynos_lcd_early_init(const void *blob); > > #endif /* _EXYNOS4_SYSTEM_H */ > diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c > index ce85ddb..ae89c94 100644 > --- a/board/samsung/common/board.c > +++ b/board/samsung/common/board.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -130,6 +131,20 @@ int board_early_init_f(void) > #ifdef CONFIG_SYS_I2C_INIT_BOARD > board_i2c_init(gd->fdt_blob); > #endif > + > +#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_EXYNOS_FB) > +/* > + * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs > + * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix, to reserve > + * FB memory at a very early stage. So, we need to fill panel_info.vl_col, > + * panel_info.vl_row and panel_info.vl_bpix before lcd_setmem() is called. > + */ > + err = exynos_lcd_early_init(gd->fdt_blob); > + if (err) { > + debug("LCD early init failed\n"); > + return err; > + } > +#endif > return err; > } > #endif > diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c > index 5c7ec91..686870f 100644 > --- a/drivers/video/exynos_fb.c > +++ b/drivers/video/exynos_fb.c > @@ -27,17 +27,12 @@ DECLARE_GLOBAL_DATA_PTR; > > static unsigned int panel_width, panel_height; > > -/* > - * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs > - * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix to reserve > - * FB memory at a very early stage, i.e even before exynos_fimd_parse_dt() > - * is called. So, we are forced to statically assign it. > - */ > #ifdef CONFIG_OF_CONTROL > vidinfo_t panel_info = { > - .vl_col = LCD_XRES, > - .vl_row = LCD_YRES, > - .vl_bpix = LCD_COLOR16, > + /* Insert a value here so that we don't end up in the BSS > +* Reference: drivers/video/tegra.c > +*/ > + .vl_col = -1, > }; > #endif > > @@ -159,7 +154,7 @@ static void lcd_panel_on(vidinfo_t *vid) > } > > #ifdef CONFIG_OF_CONTROL > -int exynos_fimd_parse_dt(const void *blob) > +int exynos_lcd_early_init(const void *blob) > { > unsigned int node; > node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_FIMD); > @@ -303,10 +298,7 @@ void lcd_ctrl_init(void *lcdbase) > set_system_display_ctrl(); > set_lcd_clk(); > > -#ifdef CONFIG_OF_CONTROL > - if (exynos_fimd_parse_dt(gd->fdt_blob)) > - debug("Can't get proper panel info\n"); > -#else > +#ifndef CONFIG_OF_CONTROL > /* initialize parameters which is specific to panel. */ > init_panel_info(&panel_info); > #endif > diff --git a/include/configs/exynos5250-dt.h > b/include/configs/exynos5250-dt.h > index 689919d..508962c 100644 > --- a/include/configs/exynos5250-dt.h > +++ b/include/configs/exynos5250-dt.h > @@ -50,8 +50,6 @@ > #ifdef CONFIG_LCD > #define CONFIG_EXYNOS_FB > #define CONFIG_EXYNOS_DP > -#define LCD_XRES 2560 > -#define LCD_YRES 1600 > #define LCD_BPPLCD_COLOR16 > #endif > #endif /* __CONFIG_5250_H */ > -- > 1.7.12.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3 v6] i2c: s3c24xx: add hsi2c controller support
Hello Naveen, Am 15.10.2013 08:07, schrieb Naveen Krishna Chatradhi: Add support for hsi2c controller available on exynos5420. Note: driver currently supports only fast speed mode 100kbps Change-Id: I02555b1dc8f4ac21c50aa5158179768563c92f43 Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: R. Chandrasekar --- Changes since v5: Fix compilation errors (undeclared CONFIG_MAX_I2C_NUM) for VCMA9 boards :-( I get based on current u-boot-i2c.git and your 3 patches applied: [hs@pollux u-boot]$ ./MAKEALL -s s3c24x0 Configuring for mini2440 board... textdata bss dec hex filename 1316922918 23272 157882 268ba ./u-boot Configuring for VCMA9 board... textdata bss dec hex filename 505577 14742 319892 840211 cd213 ./u-boot s3c24x0_i2c.c:301:12: warning: 'hsi2c_get_clk_details' defined but not used [-Wunused-function] Configuring for smdk2410 board... textdata bss dec hex filename 478329 13402 319888 811619 c6263 ./u-boot bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420
ping. On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > Add get_lcd_clk and set_lcd_clk callbacks for Exynos5420 needed by > exynos video driver. > Also, configure ACLK_400_DISP1 as the parent for > MUX_ACLK_400_DISP1_SUB_SEL. > > Signed-off-by: Ajay Kumar > --- > arch/arm/cpu/armv7/exynos/clock.c | 74 > +-- > arch/arm/cpu/armv7/exynos/exynos5_setup.h | 2 +- > arch/arm/include/asm/arch-exynos/clk.h| 1 + > 3 files changed, 73 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/cpu/armv7/exynos/clock.c > b/arch/arm/cpu/armv7/exynos/clock.c > index bc06995..e953ddc 100644 > --- a/arch/arm/cpu/armv7/exynos/clock.c > +++ b/arch/arm/cpu/armv7/exynos/clock.c > @@ -82,7 +82,8 @@ static int exynos_get_pll_clk(int pllreg, unsigned int > r, unsigned int k) > * VPLL_CON: MIDV [24:16] > * BPLL_CON: MIDV [25:16]: Exynos5 > */ > - if (pllreg == APLL || pllreg == MPLL || pllreg == BPLL) > + if (pllreg == APLL || pllreg == MPLL || > + pllreg == BPLL || pllreg == SPLL) > mask = 0x3ff; > else > mask = 0x1ff; > @@ -388,6 +389,9 @@ static unsigned long exynos5420_get_pll_clk(int pllreg) > r = readl(&clk->rpll_con0); > k = readl(&clk->rpll_con1); > break; > + case SPLL: > + r = readl(&clk->spll_con0); > + break; > default: > printf("Unsupported PLL (%d)\n", pllreg); > return 0; > @@ -1035,6 +1039,40 @@ static unsigned long exynos5_get_lcd_clk(void) > return pclk; > } > > +static unsigned long exynos5420_get_lcd_clk(void) > +{ > + struct exynos5420_clock *clk = > + (struct exynos5420_clock *)samsung_get_base_clock(); > + unsigned long pclk, sclk; > + unsigned int sel; > + unsigned int ratio; > + > + /* > +* CLK_SRC_DISP10 > +* FIMD1_SEL [4] > +* 0: SCLK_RPLL > +* 1: SCLK_SPLL > +*/ > + sel = readl(&clk->src_disp10); > + sel &= (1 << 4); > + > + if (sel) > + sclk = get_pll_clk(SPLL); > + else > + sclk = get_pll_clk(RPLL); > + > + /* > +* CLK_DIV_DISP10 > +* FIMD1_RATIO [3:0] > +*/ > + ratio = readl(&clk->div_disp10); > + ratio = ratio & 0xf; > + > + pclk = sclk / (ratio + 1); > + > + return pclk; > +} > + > void exynos4_set_lcd_clk(void) > { > struct exynos4_clock *clk = > @@ -1159,6 +1197,33 @@ void exynos5_set_lcd_clk(void) > writel(cfg, &clk->div_disp1_0); > } > > +void exynos5420_set_lcd_clk(void) > +{ > + struct exynos5420_clock *clk = > + (struct exynos5420_clock *)samsung_get_base_clock(); > + unsigned int cfg; > + > + /* > +* CLK_SRC_DISP10 > +* FIMD1_SEL [4] > +* 0: SCLK_RPLL > +* 1: SCLK_SPLL > +*/ > + cfg = readl(&clk->src_disp10); > + cfg &= ~(0x1 << 4); > + cfg |= (0 << 4); > + writel(cfg, &clk->src_disp10); > + > + /* > +* CLK_DIV_DISP10 > +* FIMD1_RATIO [3:0] > +*/ > + cfg = readl(&clk->div_disp10); > + cfg &= ~(0xf << 0); > + cfg |= (0 << 0); > + writel(cfg, &clk->div_disp10); > +} > + > void exynos4_set_mipi_clk(void) > { > struct exynos4_clock *clk = > @@ -1628,14 +1693,17 @@ unsigned long get_lcd_clk(void) > { > if (cpu_is_exynos4()) > return exynos4_get_lcd_clk(); > - else > - return exynos5_get_lcd_clk(); > + else if (proid_is_exynos5420()) > + return exynos5420_get_lcd_clk(); > + return exynos5_get_lcd_clk(); > } > > void set_lcd_clk(void) > { > if (cpu_is_exynos4()) > exynos4_set_lcd_clk(); > + else if (proid_is_exynos5420()) > + exynos5420_set_lcd_clk(); > else > exynos5_set_lcd_clk(); > } > diff --git a/arch/arm/cpu/armv7/exynos/exynos5_setup.h > b/arch/arm/cpu/armv7/exynos/exynos5_setup.h > index 8e05a00..70b1c04 100644 > --- a/arch/arm/cpu/armv7/exynos/exynos5_setup.h > +++ b/arch/arm/cpu/armv7/exynos/exynos5_setup.h > @@ -780,7 +780,7 @@ > #define CLK_SRC_TOP2_VAL 0x11101000 > #define CLK_SRC_TOP3_VAL 0x > #define CLK_SRC_TOP4_VAL 0x0111 > -#define CLK_SRC_TOP5_VAL 0x1100 > +#define CLK_SRC_TOP5_VAL 0x1101 > #define CLK_SRC_TOP6_VAL 0x0111 > #define CLK_SRC_TOP7_VAL 0x00022200 > > diff --git a/arch/arm/include/asm/arch-exynos/clk.h > b/arch/arm/include/asm/arch-exynos/clk.h > index abce246..f0b4d70 100644 > --- a/arch/arm/include/asm/arch-exynos/clk.h > +++ b/arch/arm/include/asm/arch-exynos/clk.h > @@ -15,6 +15,7 @@ > #define VPLL 4 > #define BPLL 5 > #define RPLL 6 > +#define SPLL 7 > > enum pll_src_bit { >
Re: [U-Boot] [PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD sysmmu
ping. On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > On Exynos5420, the FIMD sysmmus are in "on state" by default. > We have to disable them in order to make FIMD DMA work. > This patch adds the required framework to exynos_fimd driver > to disable FIMD sysmmu on Exynos5420. > > Signed-off-by: Ajay Kumar > --- > arch/arm/dts/exynos5420.dtsi | 5 + > doc/device-tree-bindings/video/exynos-fb.txt | 2 ++ > drivers/video/exynos_fimd.c | 12 > 3 files changed, 19 insertions(+) > > diff --git a/arch/arm/dts/exynos5420.dtsi b/arch/arm/dts/exynos5420.dtsi > index ca6c605..2d64df8 100644 > --- a/arch/arm/dts/exynos5420.dtsi > +++ b/arch/arm/dts/exynos5420.dtsi > @@ -71,4 +71,9 @@ > reg = <0x12E2 0x100>; > interrupts = <0 203 0>; > }; > + > + fimd@1440 { > + /* sysmmu is not used in U-Boot */ > + samsung,disable-sysmmu; > + }; > }; > diff --git a/doc/device-tree-bindings/video/exynos-fb.txt > b/doc/device-tree-bindings/video/exynos-fb.txt > index bb7441c..cddb505 100644 > --- a/doc/device-tree-bindings/video/exynos-fb.txt > +++ b/doc/device-tree-bindings/video/exynos-fb.txt > @@ -55,6 +55,8 @@ Board(panel specific): > samsung,pclk-name: parent clock identifier: 1(MPLL), 2(EPLL), > 3(VPLL) > samsung,sclk-div: parent_clock/source_clock ratio > samsung,dual-lcd-enabled: 1 if you support two LCD, else 0 > + samsung,disable-sysmmu: present if you want to disable the sysmmu > + (needed for Exynos5420) > > Example: > SOC specific part: > diff --git a/drivers/video/exynos_fimd.c b/drivers/video/exynos_fimd.c > index 8c2de4e..410fff1 100644 > --- a/drivers/video/exynos_fimd.c > +++ b/drivers/video/exynos_fimd.c > @@ -267,6 +267,18 @@ void exynos_fimd_lcd_init(vidinfo_t *vid) > node, > "reg"); > if (fimd_ctrl == NULL) > debug("Can't get the FIMD base address\n"); > + > + if (fdtdec_get_bool(gd->fdt_blob, node, "samsung,disable-sysmmu")) > { > + /* > + * The reset value for FIMD SYSMMU registers > + * MMU_CTRL:0x1464 and MMU_CTRL:0x1468 is 3. > + * This means FIMD SYSMMU is on by default on Exynos5420. > + * Since in u-boot we don't use SYSMMU, we are disabling > + * FIMD SYSMMU. > + */ > + writel(0x0, 0x1464); > + writel(0x0, 0x1468); > + } > #else > fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd(); > #endif > -- > 1.7.12.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP
ping. On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > Enable FIMD and DP drivers on SMDK5420 so that we get to > see the LCD console on eDP panel. > > Signed-off-by: Ajay Kumar > --- > include/configs/smdk5420.h | 8 > 1 file changed, 8 insertions(+) > > diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h > index 447f8e5..cc9c424 100644 > --- a/include/configs/smdk5420.h > +++ b/include/configs/smdk5420.h > @@ -53,4 +53,12 @@ > > #define CONFIG_MAX_I2C_NUM 11 > > +/* Display */ > +#define CONFIG_LCD > +#ifdef CONFIG_LCD > +#define CONFIG_EXYNOS_FB > +#define CONFIG_EXYNOS_DP > +#define LCD_BPPLCD_COLOR16 > +#endif > + > #endif /* __CONFIG_5420_H */ > -- > 1.7.12.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3 v2] exynos: i2c: Fix i2c driver to handle NACKs properly
Hi Heiko, > Hello Naveen, > > Am 15.10.2013 06:48, schrieb Naveen Krishna Ch: > > On 14 October 2013 11:59, Heiko Schocher wrote: > >> Hello Naveen, > >> > >> Am 03.10.2013 13:22, schrieb Naveen Krishna Chatradhi: > >> > >>> The Exynos5 i2c driver does not handle NACKs properly. This > >>> change: > >>> > >>> - fixes the NACK processing problem (do not continue transaction > >>> if address cycle was NACKed) > >>> > >>> - eliminates a fair amount of duplicate code > >>> > >>> Signed-off-by: Vadim Bendebury > >>> Reviewed-by: Simon Glass > >>> Signed-off-by: Naveen Krishna Chatradhi > >>> --- > >>> Changes since v1: > >>> 1. Removed the compilation error mentioned by Heiko for VCMA9 > >>> board... > >> > >> > >> Hmm.. just tried your patchset and I get for the VCMA9 board: > >> > >> http://patchwork.ozlabs.org/patch/280286/ > >> http://patchwork.ozlabs.org/patch/280287/ > >> http://patchwork.ozlabs.org/patch/280288/ > >> > >> > >> Configuring for VCMA9 board... > >> s3c24x0_i2c.c:125:39: error: 'CONFIG_MAX_I2C_NUM' undeclared here > >> (not in a function) > >> arm-linux-gnueabi-size: './u-boot': No such file > >> s3c24x0_i2c.c:125:39: error: 'CONFIG_MAX_I2C_NUM' undeclared here > >> (not in a function) > >> s3c24x0_i2c.c:125:31: warning: 'i2c_bus' defined but not used > >> [-Wunused-variable] > >> s3c24x0_i2c.c:295:12: warning: 'hsi2c_get_clk_details' defined but > >> not used [-Wunused-function] > >> make[1]: *** [s3c24x0_i2c.o] Fehler 1 > >> make: *** [drivers/i2c/libi2c.o] Fehler 2 > >> make: *** Warte auf noch nicht beendete Prozesse... > >> > >> Could you check this complete patchset, thanks! > > Just check with "make VCMA9 -j4> err" I see the errors. > > Heiko, Whats the best way to check the compilation errors for all > > boards related to Samsung. > > in U-Boot tree: > > all s3c24x0 boards: > ./MAKEALL -s s3c24x0 Also you can try: ./MAKEALL -v samsung > > (prefered check) all arm boards: > ./MAKEALL arm > > > Will resubmit the patchset. > > Thanks! > > bye, > Heiko -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/6] arm: exynos: Add RPLL for Exynos5420
ping. On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > RPLL is needed to drive the LCD panel on Exynos5420 based boards. > > Signed-off-by: Ajay Kumar > --- > arch/arm/cpu/armv7/exynos/clock_init.h | 3 +++ > arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 + > 2 files changed, 16 insertions(+) > > diff --git a/arch/arm/cpu/armv7/exynos/clock_init.h > b/arch/arm/cpu/armv7/exynos/clock_init.h > index a875d0b..fce502f 100644 > --- a/arch/arm/cpu/armv7/exynos/clock_init.h > +++ b/arch/arm/cpu/armv7/exynos/clock_init.h > @@ -75,6 +75,9 @@ struct mem_timings { > unsigned spll_mdiv; > unsigned spll_pdiv; > unsigned spll_sdiv; > + unsigned rpll_mdiv; > + unsigned rpll_pdiv; > + unsigned rpll_sdiv; > unsigned pclk_cdrex_ratio; > unsigned direct_cmd_msr[MEM_TIMINGS_MSR_COUNT]; > > diff --git a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c > b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c > index e7f1496..c91c4a1 100644 > --- a/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c > +++ b/arch/arm/cpu/armv7/exynos/clock_init_exynos5.c > @@ -179,6 +179,10 @@ struct mem_timings mem_timings[] = { > .spll_mdiv = 0xc8, > .spll_pdiv = 0x3, > .spll_sdiv = 0x2, > + /* RPLL @266MHz */ > + .rpll_mdiv = 0x10A, > + .rpll_pdiv = 0x3, > + .rpll_sdiv = 0x3, > > .direct_cmd_msr = { > 0x00020018, 0x0003, 0x00010046, 0x0d70, > @@ -800,6 +804,7 @@ static void exynos5420_system_clock_init(void) > writel(mem->ipll_pdiv * PLL_LOCK_FACTOR, &clk->ipll_lock); > writel(mem->spll_pdiv * PLL_LOCK_FACTOR, &clk->spll_lock); > writel(mem->kpll_pdiv * PLL_LOCK_FACTOR, &clk->kpll_lock); > + writel(mem->rpll_pdiv * PLL_X_LOCK_FACTOR, &clk->rpll_lock); > > setbits_le32(&clk->src_cpu, MUX_HPM_SEL_MASK); > > @@ -898,6 +903,14 @@ static void exynos5420_system_clock_init(void) > while ((readl(&clk->spll_con0) & PLL_LOCKED) == 0) > ; > > + /* Set RPLL */ > + writel(RPLL_CON2_VAL, &clk->rpll_con2); > + writel(RPLL_CON1_VAL, &clk->rpll_con1); > + val = set_pll(mem->rpll_mdiv, mem->rpll_pdiv, mem->rpll_sdiv); > + writel(val, &clk->rpll_con0); > + while ((readl(&clk->rpll_con0) & PLL_LOCKED) == 0) > + ; > + > writel(CLK_DIV_CDREX0_VAL, &clk->div_cdrex0); > writel(CLK_DIV_CDREX1_VAL, &clk->div_cdrex1); > > -- > 1.7.12.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/6] [U-boot] SMDK5420: Add support for FIMD and DP
ping. On Fri, Oct 11, 2013 at 9:57 AM, Ajay kumar wrote: > +Simon > > > On Mon, Sep 30, 2013 at 4:50 PM, Ajay Kumar wrote: > >> This patchset adds support for FIMD and DP on SMDK5420. >> >> This patchset has dependency on Rajeshwari's base patchset: >> [V4] EXYNOS5420: Add SMDK5420 board support >> http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/170582 >> >> Also, for testing we need Naveen's i2c patchset aswell: >> i2c: improve s3c24x0 with High-speed and new SYS_I2C framework support >> http://www.mail-archive.com/u-boot@lists.denx.de/msg122679.html >> >> Ajay Kumar (6): >> [PATCH 1/6] exynos_fb: Remove usage of static defines >> [PATCH 2/6] arm: exynos: Add RPLL for Exynos5420 >> [PATCH 3/6] arm: exynos: Add get_lcd_clk and set_lcd_clk >> callbacks for Exynos5420 >> [PATCH 4/6] video: exynos_fimd: Add framework to disable FIMD >> sysmmu >> [PATCH 5/6] smdk5420: Implement callbacks needed by exynos_fb >> driver >> [PATCH 6/6] CONFIG: SMDK5420: Enable FIMD and DP >> >> arch/arm/cpu/armv7/exynos/clock.c | 74 +++- >> arch/arm/cpu/armv7/exynos/clock_init.h | 3 + >> arch/arm/cpu/armv7/exynos/clock_init_exynos5.c | 13 +++ >> arch/arm/cpu/armv7/exynos/exynos5_setup.h | 2 +- >> arch/arm/dts/exynos5420.dtsi | 5 ++ >> arch/arm/include/asm/arch-exynos/clk.h | 1 + >> arch/arm/include/asm/arch-exynos/system.h | 1 + >> board/samsung/common/board.c | 15 >> board/samsung/smdk5420/smdk5420.c | 118 >> +++-- >> doc/device-tree-bindings/video/exynos-fb.txt | 2 + >> drivers/video/exynos_fb.c | 20 ++--- >> drivers/video/exynos_fimd.c| 12 +++ >> include/configs/exynos5250-dt.h| 2 - >> include/configs/smdk5420.h | 8 ++ >> 14 files changed, 172 insertions(+), 104 deletions(-) >> >> -- >> 1.7.12.4 >> >> ___ >> U-Boot mailing list >> U-Boot@lists.denx.de >> http://lists.denx.de/mailman/listinfo/u-boot >> > > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3 v6] i2c: s3c24xx: add hsi2c controller support
Add support for hsi2c controller available on exynos5420. Note: driver currently supports only fast speed mode 100kbps Change-Id: I02555b1dc8f4ac21c50aa5158179768563c92f43 Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: R. Chandrasekar --- Changes since v5: Fix compilation errors (undeclared CONFIG_MAX_I2C_NUM) for VCMA9 boards drivers/i2c/s3c24x0_i2c.c | 623 + drivers/i2c/s3c24x0_i2c.h | 37 +++ 2 files changed, 610 insertions(+), 50 deletions(-) diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index 0e6f241..71f3637 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -34,6 +34,76 @@ #define I2C_NOK_LA 3 /* Lost arbitration */ #define I2C_NOK_TOUT 4 /* time out */ +/* HSI2C specific register description */ + +/* I2C_CTL Register bits */ +#define HSI2C_FUNC_MODE_I2C(1u << 0) +#define HSI2C_MASTER (1u << 3) +#define HSI2C_RXCHON (1u << 6) /* Write/Send */ +#define HSI2C_TXCHON (1u << 7) /* Read/Receive */ +#define HSI2C_SW_RST (1u << 31) + +/* I2C_FIFO_CTL Register bits */ +#define HSI2C_RXFIFO_EN(1u << 0) +#define HSI2C_TXFIFO_EN(1u << 1) +#define HSI2C_TXFIFO_TRIGGER_LEVEL (0x20 << 16) +#define HSI2C_RXFIFO_TRIGGER_LEVEL (0x20 << 4) + +/* I2C_TRAILING_CTL Register bits */ +#define HSI2C_TRAILING_COUNT (0xff) + +/* I2C_INT_EN Register bits */ +#define HSI2C_TX_UNDERRUN_EN (1u << 2) +#define HSI2C_TX_OVERRUN_EN(1u << 3) +#define HSI2C_RX_UNDERRUN_EN (1u << 4) +#define HSI2C_RX_OVERRUN_EN(1u << 5) +#define HSI2C_INT_TRAILING_EN (1u << 6) +#define HSI2C_INT_I2C_EN (1u << 9) + +#define HSI2C_INT_ERROR_MASK (HSI2C_TX_UNDERRUN_EN |\ +HSI2C_TX_OVERRUN_EN |\ +HSI2C_RX_UNDERRUN_EN |\ +HSI2C_RX_OVERRUN_EN |\ +HSI2C_INT_TRAILING_EN) + +/* I2C_CONF Register bits */ +#define HSI2C_AUTO_MODE(1u << 31) +#define HSI2C_10BIT_ADDR_MODE (1u << 30) +#define HSI2C_HS_MODE (1u << 29) + +/* I2C_AUTO_CONF Register bits */ +#define HSI2C_READ_WRITE (1u << 16) +#define HSI2C_STOP_AFTER_TRANS (1u << 17) +#define HSI2C_MASTER_RUN (1u << 31) + +/* I2C_TIMEOUT Register bits */ +#define HSI2C_TIMEOUT_EN (1u << 31) + +/* I2C_TRANS_STATUS register bits */ +#define HSI2C_MASTER_BUSY (1u << 17) +#define HSI2C_SLAVE_BUSY (1u << 16) +#define HSI2C_TIMEOUT_AUTO (1u << 4) +#define HSI2C_NO_DEV (1u << 3) +#define HSI2C_NO_DEV_ACK (1u << 2) +#define HSI2C_TRANS_ABORT (1u << 1) +#define HSI2C_TRANS_SUCCESS(1u << 0) +#define HSI2C_TRANS_ERROR_MASK (HSI2C_TIMEOUT_AUTO |\ +HSI2C_NO_DEV | HSI2C_NO_DEV_ACK |\ +HSI2C_TRANS_ABORT) +#define HSI2C_TRANS_FINISHED_MASK (HSI2C_TRANS_ERROR_MASK | HSI2C_TRANS_SUCCESS) + + +/* I2C_FIFO_STAT Register bits */ +#define HSI2C_RX_FIFO_EMPTY(1u << 24) +#define HSI2C_RX_FIFO_FULL (1u << 23) +#define HSI2C_TX_FIFO_EMPTY(1u << 8) +#define HSI2C_TX_FIFO_FULL (1u << 7) +#define HSI2C_RX_FIFO_LEVEL(x) (((x) >> 16) & 0x7f) +#define HSI2C_TX_FIFO_LEVEL(x) ((x) & 0x7f) + +#define HSI2C_SLV_ADDR_MAS(x) ((x & 0x3ff) << 10) + +/* S3C I2C Controller bits */ #define I2CSTAT_BSY0x20/* Busy bit */ #define I2CSTAT_NACK 0x01/* Nack bit */ #define I2CCON_ACKGEN 0x80/* Acknowledge generation */ @@ -45,16 +115,41 @@ #define I2C_TIMEOUT_MS 1000/* 1 second */ +#defineHSI2C_TIMEOUT_US 10 /* 100 ms, finer granularity */ + + +/* To support VCMA9 boards and other who dont define max_i2c_num */ +#ifndef CONFIG_MAX_I2C_NUM +#define CONFIG_MAX_I2C_NUM 1 +#endif /* * For SPL boot some boards need i2c before SDRAM is initialised so force * variables to live in SRAM */ static unsigned int g_current_bus __attribute__((section(".data"))); -#ifdef CONFIG_OF_CONTROL static struct s3c24x0_i2c_bus i2c_bus[CONFIG_MAX_I2C_NUM] __attribute__((section(".data"))); -#endif + +/** + * Get a pointer to the given bus index + * + * @bus_idx: Bus index to look up + * @return pointer to bus, or NULL if invalid or not available + */ +static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) +{ + if (bus_idx < ARRAY_SIZE(i2c_bus)) { + struct s3c24x0_i2c_bus *bus; + + bus = &i2c_bus[bus_idx]; + if (bus->active) + return bus; + } + + debug("Undefined bus: %d\n", bus_idx); + return NULL; +} #i
[U-Boot] [PATCH 2/3 v3] exynos: i2c: Change FDT bus setup code to enumerate ports correctly
From: Simon Glass At present the i2c ports are enumerated in a strange way - the fdtdec_find_aliases_for_id() function is used, but then the ID returned is ignored and the ports are renumbered. The effect is the same provided that the device tree has the ports in the same order, or uses aliases, and has no gaps, but it is not correct. Adjust the code to use the function as intended. This will allows device tree aliases to change the device order if required. As a result, the i2c_busses variable is dropped. We can't be sure that there are no 'holes' in the list of buses, so must check the whole array. Note: it seems that non-FDT operation is now broken in this drive and will need to be reinstated for upstream. Signed-off-by: Simon Glass Reviewed-on: https://gerrit.chromium.org/gerrit/59369 Signed-off-by: Naveen Krishna Chatradhi --- Changes since v1: Nonei Changes since v2: None drivers/i2c/s3c24x0_i2c.c | 25 ++--- drivers/i2c/s3c24x0_i2c.h |1 + 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index c65360d..0e6f241 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -52,7 +52,6 @@ */ static unsigned int g_current_bus __attribute__((section(".data"))); #ifdef CONFIG_OF_CONTROL -static int i2c_busses __attribute__((section(".data"))); static struct s3c24x0_i2c_bus i2c_bus[CONFIG_MAX_I2C_NUM] __attribute__((section(".data"))); #endif @@ -164,8 +163,8 @@ int i2c_set_bus_num(unsigned int bus) { struct s3c24x0_i2c *i2c; - if ((bus < 0) || (bus >= CONFIG_MAX_I2C_NUM)) { - debug("Bad bus: %d\n", bus); + i2c_bus = get_bus(bus); + if (!i2c_bus) return -1; } @@ -483,19 +482,31 @@ void board_i2c_init(const void *blob) if (node <= 0) continue; bus = &i2c_bus[i]; + bus->active = true; bus->regs = (struct s3c24x0_i2c *) fdtdec_get_addr(blob, node, "reg"); bus->id = pinmux_decode_periph_id(blob, node); bus->node = node; - bus->bus_num = i2c_busses++; + bus->bus_num = i; exynos_pinmux_config(bus->id, 0); } } +/** + * Get a pointer to the given bus index + * + * @bus_idx: Bus index to look up + * @return pointer to bus, or NULL if invalid or not available + */ static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) { - if (bus_idx < i2c_busses) - return &i2c_bus[bus_idx]; + if (bus_idx < ARRAY_SIZE(i2c_bus)) { + struct s3c24x0_i2c_bus *bus; + + bus = &i2c_bus[bus_idx]; + if (bus->active) + return bus; + } debug("Undefined bus: %d\n", bus_idx); return NULL; @@ -505,7 +516,7 @@ int i2c_get_bus_num_fdt(int node) { int i; - for (i = 0; i < i2c_busses; i++) { + for (i = 0; i < ARRAY_SIZE(i2c_bus); i++) { if (node == i2c_bus[i].node) return i; } diff --git a/drivers/i2c/s3c24x0_i2c.h b/drivers/i2c/s3c24x0_i2c.h index b4a337a..882af62 100644 --- a/drivers/i2c/s3c24x0_i2c.h +++ b/drivers/i2c/s3c24x0_i2c.h @@ -16,6 +16,7 @@ struct s3c24x0_i2c { }; struct s3c24x0_i2c_bus { + bool active;/* port is active and available */ int node; /* device tree node */ int bus_num;/* i2c bus number */ struct s3c24x0_i2c *regs; -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/3 v3] exynos: i2c: Fix i2c driver to handle NACKs properly
The Exynos5 i2c driver does not handle NACKs properly. This change: - fixes the NACK processing problem (do not continue transaction if address cycle was NACKed) - eliminates a fair amount of duplicate code Signed-off-by: Vadim Bendebury Reviewed-by: Simon Glass Signed-off-by: Naveen Krishna Chatradhi --- Changes since v1: Fixed complilation warning in function i2c_init() Changes since v2: None drivers/i2c/s3c24x0_i2c.c | 214 +++-- 1 file changed, 90 insertions(+), 124 deletions(-) diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index cd09c78..c65360d 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -43,7 +43,7 @@ #define I2C_START_STOP 0x20/* START / STOP */ #define I2C_TXRX_ENA 0x10/* I2C Tx/Rx enable */ -#define I2C_TIMEOUT 1 /* 1 second */ +#define I2C_TIMEOUT_MS 1000/* 1 second */ /* @@ -84,22 +84,26 @@ static void SetI2CSCL(int x) } #endif +/* + * Wait til the byte transfer is completed. + * + * @param i2c- pointer to the appropriate i2c register bank. + * @return I2C_OK, if transmission was ACKED + * I2C_NACK, if transmission was NACKED + * I2C_NOK_TIMEOUT, if transaction did not complete in I2C_TIMEOUT_MS + */ + static int WaitForXfer(struct s3c24x0_i2c *i2c) { - int i; + ulong start_time = get_timer(0); - i = I2C_TIMEOUT * 1; - while (!(readl(&i2c->iiccon) & I2CCON_IRPND) && (i > 0)) { - udelay(100); - i--; - } + do { + if (readl(&i2c->iiccon) & I2CCON_IRPND) + return (readl(&i2c->iicstat) & I2CSTAT_NACK) ? + I2C_NACK : I2C_OK; + } while (get_timer(start_time) < I2C_TIMEOUT_MS); - return (readl(&i2c->iiccon) & I2CCON_IRPND) ? I2C_OK : I2C_NOK_TOUT; -} - -static int IsACK(struct s3c24x0_i2c *i2c) -{ - return !(readl(&i2c->iicstat) & I2CSTAT_NACK); + return I2C_NOK_TOUT; } static void ReadWriteByte(struct s3c24x0_i2c *i2c) @@ -180,21 +184,27 @@ unsigned int i2c_get_bus_num(void) void i2c_init(int speed, int slaveadd) { + int i; struct s3c24x0_i2c *i2c; #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5) struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio(); #endif - int i; + ulong start_time = get_timer(0); /* By default i2c channel 0 is the current bus */ g_current_bus = 0; i2c = get_base_i2c(); - /* wait for some time to give previous transfer a chance to finish */ - i = I2C_TIMEOUT * 1000; - while ((readl(&i2c->iicstat) & I2CSTAT_BSY) && (i > 0)) { - udelay(1000); - i--; + /* +* In case the previous transfer is still going, wait to give it a +* chance to finish. +*/ + while (readl(&i2c->iicstat) & I2CSTAT_BSY) { + if (get_timer(start_time) > I2C_TIMEOUT_MS) { + printf("%s: I2C bus busy for %p\n", __func__, + &i2c->iicstat); + return; + } } #if !(defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5) @@ -260,7 +270,8 @@ static int i2c_transfer(struct s3c24x0_i2c *i2c, unsigned char data[], unsigned short data_len) { - int i, result; + int i = 0, result; + ulong start_time = get_timer(0); if (data == 0 || data_len == 0) { /*Don't support data transfer of no length or to address 0 */ @@ -268,128 +279,78 @@ static int i2c_transfer(struct s3c24x0_i2c *i2c, return I2C_NOK; } - /* Check I2C bus idle */ - i = I2C_TIMEOUT * 1000; - while ((readl(&i2c->iicstat) & I2CSTAT_BSY) && (i > 0)) { - udelay(1000); - i--; + while (readl(&i2c->iicstat) & I2CSTAT_BSY) { + if (get_timer(start_time) > I2C_TIMEOUT_MS) + return I2C_NOK_TOUT; } - if (readl(&i2c->iicstat) & I2CSTAT_BSY) - return I2C_NOK_TOUT; - writel(readl(&i2c->iiccon) | I2CCON_ACKGEN, &i2c->iiccon); - result = I2C_OK; - switch (cmd_type) { - case I2C_WRITE: - if (addr && addr_len) { - writel(chip, &i2c->iicds); - /* send START */ - writel(I2C_MODE_MT | I2C_TXRX_ENA | I2C_START_STOP, - &i2c->iicstat); - i = 0; - while ((i < addr_len) && (result == I2C_OK)) { - result = WaitForXfer(i2c); - writel(addr[i], &i2c->iicds); - ReadWriteByte(i2c); - i++; - } - i = 0; - while ((i < data_len) && (re
Re: [U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model
Hello Michal, Am 14.10.2013 18:25, schrieb Michael Burr: CONFIGs and README for driver 'zynq_i2c.c'. Signed-off-by: Michael Burr Cc: Heiko Schocher Cc: Michal Simek --- === This patch depends on the previous patch titled === "[PATCH] I2C:Zynq: Adapt this driver to the new model" === submitted 26 Sep. 2013. please squash this patch into the above patch, and add the rename of the drivers config define, and resubmit it, thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single
Yes I tested it on the master-probe branch of u-boot-spi.git. Am 7.10.2013 09:24, schrieb Jagan Teki: > Did you test this on u-boot-spi.git with master-probe branch? > > On Mon, Oct 7, 2013 at 12:20 PM, Timo Herbrecher > wrote: >> If dout buffer is not 32 bit-aligned or data to transmit is not multiple >> of 32 bit the read data pointer is already incremented on single byte reads. >> >> Signed-off-by: Timo Herbrecher >> --- >> drivers/spi/mxc_spi.c |2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c >> index fd72a65..95dd03f 100644 >> --- a/drivers/spi/mxc_spi.c >> +++ b/drivers/spi/mxc_spi.c >> @@ -255,8 +255,8 @@ int spi_xchg_single(struct spi_slave *slave, >> unsigned int bitlen, >> } else { >> data = *(u32 *)dout; >> data = cpu_to_be32(data); >> + dout += 4; >> } >> - dout += 4; >> } >> debug("Sending SPI 0x%x\n", data); >> reg_write(®s->txdata, data); >> -- >> 1.7.0.4 >> >> > > > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model
Hello Michael, Am 15.10.2013 07:24, schrieb Michal Simek: Hi Michael and Heiko, On 10/15/2013 07:13 AM, Heiko Schocher wrote: Hello Michael, Am 14.10.2013 18:25, schrieb Michael Burr: I am submitting a patch for 'include/zynq.h' as well as for the README file. and the drivers/i2c/Makefile ;-) Thanks! Regarding this change. I have asked Siva and Jagan to retest this patch. It was holiday/day off in India that's why I haven't got any reply yet. Ah, ok! So you can pickup this patch after it is tested. If patch is tested please resend it, so I can add my Acked-by to it. I might be able to add code for certain particular boards which use this driver -- however, I think it may be easier for everyone if we don't do that until mainline is synchronized with Michal's Xilinx repo. (That's because the Xilinx repo has config files for several individual boards, but the mainline repo doesn't yet have those files.) Ok, please sent this patches, if this is done ... or Michal pick up this patches? Maybe it is time to make a common include file for this boards, if all use the same i2c (not only i2c) settings? v2013.10 hasn't been tagged yet that's why I or Jagan haven't started with unification. But for the next release I want to synchronize our configuration with mainline one. It is mostly in include/configs/ folder. There should be a week after ELCE to look at it. Great! Thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] u-boot-xlnx/master-next: build error
Hi, On 10/14/2013 09:05 PM, Albert ARIBAUD wrote: > Hi Oleg, > > On Mon, 14 Oct 2013 11:54:18 -0700 (PDT), Oleg Dzhimiev > wrote: > >> Hi, >> >> Building u-boot-xlnx/master-next:4cb9c3de73d66372d40d24baf82fa87a702f0c9b >> throws an error: >>> lowlevel_init.S: Assembler messages: >>> lowlevel_init.S:35: Error: selected processor does not support ARM mode >>> `fmrx r1,FPEXC' >>> lowlevel_init.S:37: Error: selected processor does not support ARM mode >>> `fmxr FPEXC,r1' >>> make[1]: *** [lowlevel_init.o] Error 1 >> >> OS: Ubuntu 13.04 x64 >> target: zynq_zed_config >> cross-tools: cross compiler built with yocto poky: >>> export CROSS_COMPILE=arm-poky-linux-gnueabi- >>> export >>> PATH=/opt/poky/1.4.2/sysroots/x86_64-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/:$PATH >>> >> >> Thanks > > U-boot-xlnx is not a sub-repo of the official U-Boot; it is Xilinx' own > version, located at https://github.com/Xilinx/u-boot-xlnx. > > I suggest you ask the Xilinx folks about it. just FYI: this should be Linux issue not u-boot issue. I have got another message from your colleague which I have already answered. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform signature.asc Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] cm_t35: use scf0403 driver
On 10/09/13 16:46, Nikita Kiryanov wrote: > Use scf0403 driver to add scf0403x LCD support for cm-t35 and cm-t3730 > boards. > > Cc: Tom Rini > Cc: Anatolij Gustschin > Cc: Igor Grinberg > Signed-off-by: Nikita Kiryanov Acked-by: Igor Grinberg -- Regards, Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model
Hi Michael and Heiko, On 10/15/2013 07:13 AM, Heiko Schocher wrote: > Hello Michael, > > Am 14.10.2013 18:25, schrieb Michael Burr: >> I am submitting a patch for 'include/zynq.h' as well as for the README file. > > and the drivers/i2c/Makefile ;-) > Thanks! Regarding this change. I have asked Siva and Jagan to retest this patch. It was holiday/day off in India that's why I haven't got any reply yet. > >> I might be able to add code for certain particular boards which use this >> driver -- however, I think it may be easier for everyone if we don't do that >> until mainline is synchronized with Michal's Xilinx repo. (That's because >> the Xilinx repo has config files for several individual boards, but the >> mainline repo doesn't yet have those files.) > > Ok, please sent this patches, if this is done ... or Michal pick up > this patches? > > Maybe it is time to make a common include file for this boards, if all > use the same i2c (not only i2c) settings? v2013.10 hasn't been tagged yet that's why I or Jagan haven't started with unification. But for the next release I want to synchronize our configuration with mainline one. It is mostly in include/configs/ folder. There should be a week after ELCE to look at it. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform signature.asc Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model
Hello Michael, Am 14.10.2013 18:25, schrieb Michael Burr: I am submitting a patch for 'include/zynq.h' as well as for the README file. and the drivers/i2c/Makefile ;-) Thanks! I might be able to add code for certain particular boards which use this driver -- however, I think it may be easier for everyone if we don't do that until mainline is synchronized with Michal's Xilinx repo. (That's because the Xilinx repo has config files for several individual boards, but the mainline repo doesn't yet have those files.) Ok, please sent this patches, if this is done ... or Michal pick up this patches? Maybe it is time to make a common include file for this boards, if all use the same i2c (not only i2c) settings? bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3 v2] exynos: i2c: Fix i2c driver to handle NACKs properly
On 14 October 2013 11:59, Heiko Schocher wrote: > Hello Naveen, > > Am 03.10.2013 13:22, schrieb Naveen Krishna Chatradhi: > >> The Exynos5 i2c driver does not handle NACKs properly. This change: >> >> - fixes the NACK processing problem (do not continue transaction if >>address cycle was NACKed) >> >> - eliminates a fair amount of duplicate code >> >> Signed-off-by: Vadim Bendebury >> Reviewed-by: Simon Glass >> Signed-off-by: Naveen Krishna Chatradhi >> --- >> Changes since v1: >> 1. Removed the compilation error mentioned by Heiko for VCMA9 board... > > > Hmm.. just tried your patchset and I get for the VCMA9 board: > > http://patchwork.ozlabs.org/patch/280286/ > http://patchwork.ozlabs.org/patch/280287/ > http://patchwork.ozlabs.org/patch/280288/ > > > Configuring for VCMA9 board... > s3c24x0_i2c.c:125:39: error: 'CONFIG_MAX_I2C_NUM' undeclared here (not in a > function) > arm-linux-gnueabi-size: './u-boot': No such file > s3c24x0_i2c.c:125:39: error: 'CONFIG_MAX_I2C_NUM' undeclared here (not in a > function) > s3c24x0_i2c.c:125:31: warning: 'i2c_bus' defined but not used > [-Wunused-variable] > s3c24x0_i2c.c:295:12: warning: 'hsi2c_get_clk_details' defined but not used > [-Wunused-function] > make[1]: *** [s3c24x0_i2c.o] Fehler 1 > make: *** [drivers/i2c/libi2c.o] Fehler 2 > make: *** Warte auf noch nicht beendete Prozesse... > > Could you check this complete patchset, thanks! Just check with "make VCMA9 -j4 > err" I see the errors. Heiko, Whats the best way to check the compilation errors for all boards related to Samsung. Will resubmit the patchset. > > bye, > Heiko > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany -- Shine bright, (: Nav :) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3 v2] exynos: i2c: Fix i2c driver to handle NACKs properly
Hello Naveen, Am 15.10.2013 06:48, schrieb Naveen Krishna Ch: On 14 October 2013 11:59, Heiko Schocher wrote: Hello Naveen, Am 03.10.2013 13:22, schrieb Naveen Krishna Chatradhi: The Exynos5 i2c driver does not handle NACKs properly. This change: - fixes the NACK processing problem (do not continue transaction if address cycle was NACKed) - eliminates a fair amount of duplicate code Signed-off-by: Vadim Bendebury Reviewed-by: Simon Glass Signed-off-by: Naveen Krishna Chatradhi --- Changes since v1: 1. Removed the compilation error mentioned by Heiko for VCMA9 board... Hmm.. just tried your patchset and I get for the VCMA9 board: http://patchwork.ozlabs.org/patch/280286/ http://patchwork.ozlabs.org/patch/280287/ http://patchwork.ozlabs.org/patch/280288/ Configuring for VCMA9 board... s3c24x0_i2c.c:125:39: error: 'CONFIG_MAX_I2C_NUM' undeclared here (not in a function) arm-linux-gnueabi-size: './u-boot': No such file s3c24x0_i2c.c:125:39: error: 'CONFIG_MAX_I2C_NUM' undeclared here (not in a function) s3c24x0_i2c.c:125:31: warning: 'i2c_bus' defined but not used [-Wunused-variable] s3c24x0_i2c.c:295:12: warning: 'hsi2c_get_clk_details' defined but not used [-Wunused-function] make[1]: *** [s3c24x0_i2c.o] Fehler 1 make: *** [drivers/i2c/libi2c.o] Fehler 2 make: *** Warte auf noch nicht beendete Prozesse... Could you check this complete patchset, thanks! Just check with "make VCMA9 -j4> err" I see the errors. Heiko, Whats the best way to check the compilation errors for all boards related to Samsung. in U-Boot tree: all s3c24x0 boards: ./MAKEALL -s s3c24x0 (prefered check) all arm boards: ./MAKEALL arm Will resubmit the patchset. Thanks! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 0/2] add sdhci generic framework
On Mon, Oct 14, 2013 at 7:16 PM, Lei Wen wrote: > Hi Vadim, > > The quirk is standing for some workaround for those host that has some > limitation that it cannot directly be applied with standard sdhci.c code, > so that we add one quirk for it, which let it could use the sdhci.c. > > Like the quirk as SDHCI_QUIRK_32BIT_DMA_ADDR, it indicate that some host > has dma engine limitation that it must start from address with alignement. > So if sdhci find caller set this quirk, it would follow corresponding > workaround > for it. > > There is no formal description for it as I could see. > All right, that's what I figured :). Thank you for the explanation, --vb > Thanks, > Lei > >> -Original Message- >> From: vben...@gmail.com [mailto:vben...@gmail.com] On Behalf Of Vadim >> Bendebury >> Sent: Tuesday, October 15, 2013 10:09 AM >> To: Lei Wen >> Cc: Prafulla Wadaskar; aflem...@gmail.com; Rob Herring; u- >> b...@lists.denx.de; Yu Tang; Prabhanjan Sarnaik; Ashish Karkare; Andy >> Fleming >> Subject: Re: [U-Boot] [PATCH V2 0/2] add sdhci generic framework >> >> Hello Lei, >> >> I am looking into adding eMMC support for some intel SDHCI controllers >> based on this common SDHCI driver submission. >> >> One thing which is not quite clear is the quirks - can you (or somebody >> else on this list) please shed some light on what the quirks are. Is >> there some kind of formal description/definition of various defined >> quirks and their processing. >> >> Thank you in advance, >> >> --vb >> >> >> On Wed, Jun 29, 2011 at 12:50 AM, Lei Wen wrote: >> > V1: >> > add sdhci generic framework and with marvell sdhci implementation >> > >> > V2: >> > rename the previous file name from sdhci-mv to mv_sdhci >> > >> > Lei Wen (2): >> > MMC: add sdhci generic framework >> > MMC: add marvell sdhci driver >> > >> > drivers/mmc/Makefile |2 + >> > drivers/mmc/mv_sdhci.c | 21 +++ >> > drivers/mmc/sdhci.c| 433 >> >> > include/sdhci.h| 325 >> > 4 files changed, 781 insertions(+), 0 deletions(-) create mode >> > 100644 drivers/mmc/mv_sdhci.c create mode 100644 drivers/mmc/sdhci.c >> > create mode 100644 include/sdhci.h >> > >> > ___ >> > U-Boot mailing list >> > U-Boot@lists.denx.de >> > http://lists.denx.de/mailman/listinfo/u-boot > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 09/10] arm64: board support of vexpress_aemv8a
From: David Feng Signed-off-by: David Feng Signed-off-by: Bhupesh Sharma --- board/armltd/vexpress64/Makefile | 27 + board/armltd/vexpress64/vexpress64.c | 50 + boards.cfg |1 + include/configs/vexpress_aemv8a.h| 191 ++ 4 files changed, 269 insertions(+) create mode 100644 board/armltd/vexpress64/Makefile create mode 100644 board/armltd/vexpress64/vexpress64.c create mode 100644 include/configs/vexpress_aemv8a.h diff --git a/board/armltd/vexpress64/Makefile b/board/armltd/vexpress64/Makefile new file mode 100644 index 000..f907c92 --- /dev/null +++ b/board/armltd/vexpress64/Makefile @@ -0,0 +1,27 @@ +# +# (C) Copyright 2000-2004 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := vexpress64.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c new file mode 100644 index 000..dae18d4 --- /dev/null +++ b/board/armltd/vexpress64/vexpress64.c @@ -0,0 +1,50 @@ +/* + * (C) Copyright 2013 + * David Feng + * Sharma Bhupesh + * + * SPDX-License-Identifier:GPL-2.0+ + */ +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + return 0; +} + +int dram_init(void) +{ + gd->ram_size = PHYS_SDRAM_1_SIZE; + return 0; +} + +int timer_init(void) +{ + return 0; +} + +/* + * Board specific reset that is system reset. + */ +void reset_cpu(ulong addr) +{ +} + +/* + * Board specific ethernet initialization routine. + */ +int board_eth_init(bd_t *bis) +{ + int rc = 0; +#ifdef CONFIG_SMC9 + rc = smc9_initialize(0, CONFIG_SMC9_BASE); +#endif + return rc; +} diff --git a/boards.cfg b/boards.cfg index 85143c6..6d3dd69 100644 --- a/boards.cfg +++ b/boards.cfg @@ -383,6 +383,7 @@ Active arm pxa- - vpac270 Active arm pxa- icpdas lp8x4x lp8x4x - Sergey Yanovich Active arm pxa- toradex - colibri_pxa270 - Marek Vasut Active arm sa1100 - - - jornada - Kristoffer Ericson +Active arm armv8 - armltd vexpress64 vexpress_aemv8a vexpress_aemv8a:ARM64 David Feng Active avr32 at32ap at32ap700x atmel - atngw100 - Haavard Skinnemoen Active avr32 at32ap at32ap700x atmel - atngw100mkii - Andreas Bießmann Active avr32 at32ap at32ap700x atmel atstk1000 atstk1002- Haavard Skinnemoen diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h new file mode 100644 index 000..e93b00f --- /dev/null +++ b/include/configs/vexpress_aemv8a.h @@ -0,0 +1,191 @@ +/* + * Configuration for Versatile Express. Parts were derived from other ARM + * configurations. + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef __VEXPRESS_AEMV8A_H +#define __VEXPRESS_AEMV8A_H + +#define DEBUG + +#define CONFIG_REMAKE_ELF + +/*#define CONFIG_BOOTING_EL1*/ + +/*#define CONFIG_SYS_GENERIC_BOARD*/ + +#define CONFIG_SYS_NO_FLASH + +#define CONFIG_SUPPORT_RAW_INITRD + +/* Cache Definitions */ +#define CONFIG_SYS_DCACHE_OFF
[U-Boot] [RESEND PATCH v14 02/10] cmd_pxe: remove compiling warnings
From: David Feng Signed-off-by: David Feng --- common/cmd_pxe.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index c5f4a22..1df9a8a 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -57,7 +57,7 @@ static int format_mac_pxe(char *outbuf, size_t outbuf_len) uchar ethaddr[6]; if (outbuf_len < 21) { - printf("outbuf is too small (%d < 21)\n", outbuf_len); + printf("outbuf is too small (%zd < 21)\n", outbuf_len); return -EINVAL; } @@ -100,7 +100,7 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path, path_len = (last_slash - bootfile) + 1; if (bootfile_path_size < path_len) { - printf("bootfile_path too small. (%d < %d)\n", + printf("bootfile_path too small. (%zd < %zd)\n", bootfile_path_size, path_len); return -1; -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 07/10] arm64: core support
From: David Feng Relocation code based on a patch by Scott Wood, which is: Signed-off-by: Scott Wood Signed-off-by: David Feng --- arch/arm/config.mk |3 +- arch/arm/cpu/armv8/Makefile | 38 + arch/arm/cpu/armv8/cache.S | 130 + arch/arm/cpu/armv8/cache_v8.c | 218 arch/arm/cpu/armv8/config.mk| 15 ++ arch/arm/cpu/armv8/cpu.c| 67 + arch/arm/cpu/armv8/exceptions.S | 112 +++ arch/arm/cpu/armv8/start.S | 234 +++ arch/arm/cpu/armv8/timer.c | 80 +++ arch/arm/cpu/armv8/tlb.S| 30 arch/arm/cpu/armv8/u-boot.lds | 89 arch/arm/include/asm/armv8/mmu.h| 110 +++ arch/arm/include/asm/byteorder.h| 12 ++ arch/arm/include/asm/cache.h|5 + arch/arm/include/asm/config.h |6 + arch/arm/include/asm/global_data.h |6 +- arch/arm/include/asm/io.h | 15 +- arch/arm/include/asm/macro.h| 36 + arch/arm/include/asm/posix_types.h | 10 ++ arch/arm/include/asm/proc-armv/ptrace.h | 21 +++ arch/arm/include/asm/proc-armv/system.h | 59 +++- arch/arm/include/asm/system.h | 77 ++ arch/arm/include/asm/types.h|4 + arch/arm/include/asm/u-boot.h |4 + arch/arm/include/asm/unaligned.h|2 +- arch/arm/lib/Makefile | 14 ++ arch/arm/lib/board.c|7 +- arch/arm/lib/bootm.c| 16 +++ arch/arm/lib/crt0_64.S | 113 +++ arch/arm/lib/interrupts_64.c| 120 arch/arm/lib/relocate_64.S | 58 common/image.c |1 + doc/README.arm64| 45 ++ examples/standalone/stubs.c | 15 ++ include/image.h |1 + 35 files changed, 1762 insertions(+), 11 deletions(-) create mode 100644 arch/arm/cpu/armv8/Makefile create mode 100644 arch/arm/cpu/armv8/cache.S create mode 100644 arch/arm/cpu/armv8/cache_v8.c create mode 100644 arch/arm/cpu/armv8/config.mk create mode 100644 arch/arm/cpu/armv8/cpu.c create mode 100644 arch/arm/cpu/armv8/exceptions.S create mode 100644 arch/arm/cpu/armv8/start.S create mode 100644 arch/arm/cpu/armv8/timer.c create mode 100644 arch/arm/cpu/armv8/tlb.S create mode 100644 arch/arm/cpu/armv8/u-boot.lds create mode 100644 arch/arm/include/asm/armv8/mmu.h create mode 100644 arch/arm/lib/crt0_64.S create mode 100644 arch/arm/lib/interrupts_64.c create mode 100644 arch/arm/lib/relocate_64.S create mode 100644 doc/README.arm64 diff --git a/arch/arm/config.mk b/arch/arm/config.mk index d0cf43f..a259193 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -17,7 +17,8 @@ endif LDFLAGS_FINAL += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \ - -fno-common -ffixed-r9 -msoft-float + -fno-common -ffixed-r9 +PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) # Support generic board on ARM __HAVE_ARCH_GENERIC_BOARD := y diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile new file mode 100644 index 000..b216f27 --- /dev/null +++ b/arch/arm/cpu/armv8/Makefile @@ -0,0 +1,38 @@ +# +# (C) Copyright 2000-2003 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(CPU).o + +START := start.o + +COBJS += cpu.o +COBJS += timer.o +COBJS += cache_v8.o + +SOBJS += exceptions.o +SOBJS += cache.o +SOBJS += tlb.o + +SRCS := $(START:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS) $(SOBJS)) +START := $(addprefix $(obj),$(START)) + +all: $(obj).depend $(START) $(LIB) + +$(LIB):$(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/arch/arm/cpu/armv8/cache.S b/arch/arm/cpu/armv8/cache.S new file mode 100644 index 000..419f169 --- /dev/null +++ b/arch/arm/cpu/armv8/cache.S @@ -0,0 +1,130 @@ +/* + * (C) Copyright 2013 + * David Feng + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include +#include +#include + +/* + * void __asm_flush_dcache_level(level) + * + * clean and invalidate one level cache. + * + * x0: cache level + * x1~x9: clobbered + */ +ENTRY(__asm_flush_dcache_level) + lsl x1, x0, #1 + msr csselr_el1, x1 /* select cache level */ + isb /* isb to sych the new
[U-Boot] [RESEND PATCH v14 08/10] arm64: generic board support
From: David Feng Signed-off-by: David Feng --- common/board_f.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 0ada1af..d821dbe 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -458,7 +458,7 @@ static int reserve_round_4k(void) static int reserve_mmu(void) { /* reserve TLB table */ - gd->arch.tlb_size = 4096 * 4; + gd->arch.tlb_size = PGTABLE_SIZE; gd->relocaddr -= gd->arch.tlb_size; /* round down to next 64 kB limit */ @@ -610,7 +610,7 @@ static int reserve_stacks(void) * TODO(s...@chromium.org): Perhaps create arch_reserve_stack() * to handle this and put in arch/xxx/lib/stack.c */ -# ifdef CONFIG_ARM +# if defined(CONFIG_ARM) && !defined(CONFIG_ARM64) # ifdef CONFIG_USE_IRQ gd->start_addr_sp -= (CONFIG_STACKSIZE_IRQ + CONFIG_STACKSIZE_FIQ); debug("Reserving %zu Bytes for IRQ stack at: %08lx\n", @@ -807,11 +807,6 @@ static int mark_bootstage(void) } static init_fnc_t init_sequence_f[] = { -#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ - !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ - !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86) - zero_global_data, -#endif #ifdef CONFIG_SANDBOX setup_ram_buf, #endif @@ -1005,6 +1000,17 @@ void board_init_f(ulong boot_flags) gd = &data; #endif + /* +* Clear global data before it is accessed at debug print +* in initcall_run_list. Otherwise the debug print probably +* get the wrong vaule of gd->have_console. +*/ +#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \ + !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \ + !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86) + zero_global_data(); +#endif + gd->flags = boot_flags; if (initcall_run_list(init_sequence_f)) -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 10/10] arm64: MAKEALL, filter armv8 boards from LIST_arm
From: David Feng Signed-off-by: David Feng --- MAKEALL | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MAKEALL b/MAKEALL index 956f3da..cb414ca 100755 --- a/MAKEALL +++ b/MAKEALL @@ -370,6 +370,12 @@ LIST_ARM11="$(boards_by_cpu arm1136) \ LIST_ARMV7="$(boards_by_cpu armv7)" # +## ARMV8 Systems +# + +LIST_ARMV8="$(boards_by_cpu armv8)" + +# ## AT91 Systems # @@ -393,7 +399,11 @@ LIST_spear="$(boards_by_soc spear)" ## ARM groups # -LIST_arm="$(boards_by_arch arm)" +LIST_arm="$(boards_by_arch arm | \ + for ARMV8_BOARD in $LIST_ARMV8; \ + do sed "/$ARMV8_BOARD/d"; \ + done) \ +" # ## MIPS Systems(default = big endian) -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 01/10] fdt_support: 64bit initrd start address support
From: David Feng Signed-off-by: David Feng --- common/fdt_support.c | 66 ++ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index b034c98..9bc5821 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -21,6 +21,34 @@ */ DECLARE_GLOBAL_DATA_PTR; +/* + * Get cells len in bytes + * if #-cells property is 2 then len is 8 + * otherwise len is 4 + */ +static int get_cells_len(void *blob, char *nr_cells_name) +{ + const fdt32_t *cell; + + cell = fdt_getprop(blob, 0, nr_cells_name, NULL); + if (cell && fdt32_to_cpu(*cell) == 2) + return 8; + + return 4; +} + +/* + * Write a 4 or 8 byte big endian cell + */ +static void write_cell(u8 *addr, u64 val, int size) +{ + int shift = (size - 1) * 8; + while (size-- > 0) { + *addr++ = (val >> shift) & 0xff; + shift -= 8; + } +} + /** * fdt_getprop_u32_default - Find a node and return it's property or a default * @@ -131,9 +159,9 @@ static int fdt_fixup_stdout(void *fdt, int chosenoff) int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) { - int nodeoffset; + int nodeoffset, addr_cell_len; int err, j, total; - fdt32_t tmp; + fdt64_t tmp; const char *path; uint64_t addr, size; @@ -170,9 +198,11 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) return err; } + addr_cell_len = get_cells_len(fdt, "#address-cells"); + path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL); if ((path == NULL) || force) { - tmp = cpu_to_fdt32(initrd_start); + write_cell((u8 *)&tmp, initrd_start, addr_cell_len); err = fdt_setprop(fdt, nodeoffset, "linux,initrd-start", &tmp, sizeof(tmp)); if (err < 0) { @@ -181,7 +211,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) fdt_strerror(err)); return err; } - tmp = cpu_to_fdt32(initrd_end); + write_cell((u8 *)&tmp, initrd_end, addr_cell_len); err = fdt_setprop(fdt, nodeoffset, "linux,initrd-end", &tmp, sizeof(tmp)); if (err < 0) { @@ -343,34 +373,6 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat, do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); } -/* - * Get cells len in bytes - * if #-cells property is 2 then len is 8 - * otherwise len is 4 - */ -static int get_cells_len(void *blob, char *nr_cells_name) -{ - const fdt32_t *cell; - - cell = fdt_getprop(blob, 0, nr_cells_name, NULL); - if (cell && fdt32_to_cpu(*cell) == 2) - return 8; - - return 4; -} - -/* - * Write a 4 or 8 byte big endian cell - */ -static void write_cell(u8 *addr, u64 val, int size) -{ - int shift = (size - 1) * 8; - while (size-- > 0) { - *addr++ = (val >> shift) & 0xff; - shift -= 8; - } -} - #ifdef CONFIG_NR_DRAM_BANKS #define MEMORY_BANKS_MAX CONFIG_NR_DRAM_BANKS #else -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 04/10] arm64: Add tool to statically apply RELA relocations
From: Scott Wood ARM64 uses the newer RELA-style relocations rather than the older REL. RELA relocations have an addend in the relocation struct, rather than expecting the loader to read a value from the location to be updated. While this is beneficial for ordinary program loading, it's problematic for U-Boot because the location to be updated starts out with zero, rather than a pre-relocation value. Since we need to be able to run C code before relocation, we need a tool to apply the relocations at build time. In theory this tool is applicable to other newer architectures (mainly 64-bit), but currently the only relocations it supports are for arm64, and it assumes a 64-bit little-endian target. If the latter limitation is ever to be changed, we'll need a way to tell the tool what format the image is in. Eventually this may be replaced by a tool that uses libelf or similar and operates directly on the ELF file. I've written some code for such an approach but libelf does not make it easy to poke addresses by memory address (rather than by section), and I was hesitant to write code to manually parse the program headers and do the update outside of libelf (or to iterate over sections) -- especially since it wouldn't get test coverage on things like binaries with multiple PT_LOAD segments. This should be good enough for now to let the manual relocation stuff be removed from the arm64 patches. NOTE: Please make sure R_AARCH64_RELATIVE is defined at system include files or manually defined. Otherwise, the rela relocation will not apply. Signed-off-by: Scott Wood Signed-off-by: David Feng --- Makefile | 12 tools/Makefile|6 ++ tools/relocate-rela.c | 185 + 3 files changed, 203 insertions(+) create mode 100644 tools/relocate-rela.c diff --git a/Makefile b/Makefile index b09bfcc..5dd28a9 100644 --- a/Makefile +++ b/Makefile @@ -392,6 +392,17 @@ else BOARD_SIZE_CHECK = endif +# Statically apply RELA-style relocations (currently arm64 only) +ifneq ($(CONFIG_STATIC_RELA),) +# $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base +DO_STATIC_RELA = \ + start=$$($(NM) $(1) | grep __rel_dyn_start | cut -f 1 -d ' '); \ + end=$$($(NM) $(1) | grep __rel_dyn_end | cut -f 1 -d ' '); \ + $(obj)tools/relocate-rela $(2) $(3) $$start $$end +else +DO_STATIC_RELA = +endif + # Always append ALL so that arch config.mk's can add custom ones ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map @@ -431,6 +442,7 @@ $(obj)u-boot.srec: $(obj)u-boot $(obj)u-boot.bin: $(obj)u-boot $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ + $(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE)) $(BOARD_SIZE_CHECK) $(obj)u-boot.ldr: $(obj)u-boot diff --git a/tools/Makefile b/tools/Makefile index c36cde2..a5eb85e 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -59,6 +59,7 @@ BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) BIN_FILES-$(CONFIG_KIRKWOOD) += kwboot$(SFX) BIN_FILES-y += proftool(SFX) +BIN_FILES-$(CONFIG_STATIC_RELA) += relocate-rela$(SFX) # Source files which exist outside the tools directory EXT_OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += common/env_embedded.o @@ -84,6 +85,7 @@ NOPED_OBJ_FILES-y += os_support.o NOPED_OBJ_FILES-y += pblimage.o NOPED_OBJ_FILES-y += proftool.o NOPED_OBJ_FILES-y += ublimage.o +NOPED_OBJ_FILES-y += relocate-rela.o OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o @@ -250,6 +252,10 @@ $(obj)kwboot$(SFX): $(obj)kwboot.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ +$(obj)relocate-rela$(SFX): $(obj)relocate-rela.o + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + # Some of the tool objects need to be accessed from outside the tools directory $(obj)%.o: $(SRCTREE)/common/%.c $(HOSTCC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $< diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c new file mode 100644 index 000..47afe0b --- /dev/null +++ b/tools/relocate-rela.c @@ -0,0 +1,185 @@ +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier:GPL-2.0+ BSD-2-Clause + * + * 64-bit and little-endian target only until we need to support a different + * arch that needs this. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static const bool debug_en; + +static void debug(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + if (debug_en) + vprintf(fmt, args); +} + +static bool supported_rela(Elf64_Rela *rela) +{ + uint64_t mask = 0xULL; /* would be different on 32-bit */ + uint32_t type = rela->r_info & mask; + + switch (type) { +#ifdef R_AARCH64_RELATIVE + c
[U-Boot] [RESEND PATCH v14 06/10] arm64: Make checkarmreloc accept arm64 relocations
From: Scott Wood Signed-off-by: Scott Wood Signed-off-by: David Feng --- Makefile | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 86464c9..edf52f2 100644 --- a/Makefile +++ b/Makefile @@ -805,12 +805,16 @@ tools: $(VERSION_FILE) $(TIMESTAMP_FILE) $(MAKE) -C $@ all endif # config.mk -# ARM relocations should all be R_ARM_RELATIVE. +# ARM relocations should all be R_ARM_RELATIVE (32-bit) or +# R_AARCH64_RELATIVE (64-bit). checkarmreloc: $(obj)u-boot - @if test "R_ARM_RELATIVE" != \ - "`$(CROSS_COMPILE)readelf -r $< | cut -d ' ' -f 4 | grep R_ARM | sort -u`"; \ - then echo "$< contains relocations other than \ - R_ARM_RELATIVE"; false; fi + @RELOC="`$(CROSS_COMPILE)readelf -r -W $< | cut -d ' ' -f 4 | \ + grep R_A | sort -u`"; \ + if test "$$RELOC" != "R_ARM_RELATIVE" -a \ +"$$RELOC" != "R_AARCH64_RELATIVE"; then \ + echo "$< contains unexpected relocations: $$RELOC"; \ + false; \ + fi $(VERSION_FILE): @mkdir -p $(dir $(VERSION_FILE)) -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 05/10] arm64: Turn u-boot.bin back into an ELF file after relocate-rela
From: Scott Wood While performing relocations on u-boot.bin should be good enough for booting on real hardware, some simulators insist on booting an ELF file (and yet don't perform ELF relocations), so convert the relocated binary back into an ELF file. This can go away in the future if we change relocate-rela to operate directly on the ELF file, or if and when we stop caring about a simulator with this restriction. Signed-off-by: Scott Wood Signed-off-by: David Feng --- Makefile | 13 + 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 5dd28a9..86464c9 100644 --- a/Makefile +++ b/Makefile @@ -415,6 +415,7 @@ ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin ifneq ($(CONFIG_SPL_TARGET),) ALL-$(CONFIG_SPL) += $(obj)$(subst ",,$(CONFIG_SPL_TARGET)) endif +ALL-$(CONFIG_REMAKE_ELF) += $(obj)u-boot.elf # enable combined SPL/u-boot/dtb rules for tegra ifneq ($(CONFIG_TEGRA),) @@ -581,6 +582,18 @@ $(obj)u-boot-img-spl-at-end.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.img conv=notrunc 2>/dev/null cat $(obj)u-boot-pad.img $(obj)spl/u-boot-spl.bin > $@ +# Create a new ELF from a raw binary file. This is useful for arm64 +# where static relocation needs to be performed on the raw binary, +# but certain simulators only accept an ELF file (but don't do the +# relocation). +# FIXME refactor dts/Makefile to share target/arch detection +$(obj)u-boot.elf: $(obj)u-boot.bin + @$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \ + $< $(obj)u-boot-elf.o + @$(LD) $(obj)u-boot-elf.o -o $@ \ + --defsym=_start=$(CONFIG_SYS_TEXT_BASE) \ + -Ttext=$(CONFIG_SYS_TEXT_BASE) + ifeq ($(CONFIG_SANDBOX),y) GEN_UBOOT = \ cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 03/10] add weak entry definition
From: David Feng Signed-off-by: David Feng --- include/linux/linkage.h |4 1 file changed, 4 insertions(+) diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 9ddf830..2a2848a 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -49,6 +49,10 @@ .globl SYMBOL_NAME(name); \ LENTRY(name) +#define WEAK(name) \ + .weak SYMBOL_NAME(name); \ + LENTRY(name) + #ifndef END #define END(name) \ .size name, .-name -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RESEND PATCH v14 00/10] arm64 pat
From: David Feng The content is same with original v14. 04/05/06 patches is totally provided by scott wood. Them are mistakenly encoded "From: David Feng", so modify its to "From: Scott Wood". Changes for v14: - Merge rela relocation patches from Scott Wood . - Remove all CONFIG_NEED_MANUAL_RELOC and other fixups due to manual relocation. With rela relocation patches them are not needed. - Fix the bug of MEMORY_ATTRIBUTES definition due to assembler. That need put brackets around (MT_NORMAL*8). Otherwise the result is wrong.This bug is reported by York Sun . - -msoft-float is not supported by aarch64-gcc, make a test though $(call cc-option,-msoft-float). - Adjust the virtual address space to 42 bits. - Filter armv8 boards from LIST_arm in MAKEALL. - remove gpio.h in asm/arch-armv8/ and move mmu.h to asm/armv8/ directory. - remove vexpress64.dts from this patch, it could be accessed from linux kernel. Changes for v13: - fix the bug of board_r.c and arm/lib/board.c due to CONFIG_NEED_MANUAL_RELOC. adjust initr_serial() in board_r.c to the first entry of init_sequence_r[] and relocate serial_initialize() in arm/lib/board.c, routines of serial_device should be relocated firstly by serial_initialize(), so that printf access the correct puts function, otherwise uninitialized serial_current will be selected as the output device. - fix the bug of dcache_enable(). after mmu_setup the sctrl register value should be fetched again because it has been modifed by mmu_seup() function. This bug is reported by York Sun . - add macro branch_if_slave to macro.h, it choose processor with all zero affinity value as the master and is used in start.S. Changes for v12: - custom the patches to new format boards.cfg. Changes for v11: - Replace CONFIG_ARMV8 with CONFIG_ARM64. Currently, it's hard to distinguish what is armv8 specific and what is aarch64 specific, so we use CONFIG_ARM64 only, no CONFIG_ARMV8 used. - rename README.armv8 with README.arm64 and make some modification. Changes for v10: - add weak definition to include/linux/linkage.h and make setup_el2/setup_el3/lowlevel_init weak routines, so them can be easily overridden by processor specific code. - modify s-o-f of 0002-board-support-of-vexpress_aemv8a which use wrong mail address of Bhupesh Sharma. Changes for v9: - add Signed-off-by information to patch "board support of vexpress_aemv8a" which SMC9 support is integrated from Sharma Bhupesh's patch. - adjust pt_regs struct and add exception state preservation in exception.S. Changes for v8: - Integrate SMC9 patch of sharma bhupesh. - remove v8_outer_cache* which is not need currently. - Change license tag. - Mov crt0.S/relocate.S/interrupts.c to arm/lib and rename them with _64 suffix. - Make el3/el2 initializing process of start.S as two separate routines. It could be easier to be replaced with processor specific codes. - Remove exception stack save and restore routine, it is unnecessary now. - simplify __weak function declaration. Changes for v7: - Check the patches with checkpatch.pl and get rid of almost all warnings. There are a few warnings still, but I think it should be that. - change printf format in cmd_pxe.c, use %zd indtead of %ld to format size_t type variable. - add macro PGTABLE_SIZE to identify tlb table size. Changes for v6: - Make modification to inappropriate licensed file and bugs according to ScottWood's advice. Thanks Scott for his checking to these patches. - Enable u-boot's running at EL1. - Get rid of compiling warnings originated from cmd_pxe.c. Changes for v5: - fix the generic board_f.c, remove zero_global_data from init_sequence_f array and move it to board_init_f() function with CONFIG_X86 switch. The previous fixup is inaccurate. - Replace __ARMEB__ with __AARCH64EB__ in byteorder.h and unaligned.h, gcc for aarch64 use __AARCH64EB__ and __AARCH64EL__ to identify endian. - Some modification to README.armv8 Changes for v4: - merge arm64 to arm architecture. David Feng (10): fdt_support: 64bit initrd start address support cmd_pxe.c: remove compiling warnings add weak entry definition arm64: Add tool to statically apply RELA relocations arm64: Turn u-boot.bin back into an ELF file after relocate-rela arm64: Make checkarmreloc accept arm64 relocations arm64: core support arm64: generic board support arm64: board support of vexpress_aemv8a arm64: MAKEALL, filter armv8 boards from LIST_arm MAKEALL | 13 +- Makefile| 39 +- arch/arm/config.mk |3 +- arch/arm/cpu/armv8/Makefile | 38 + arch/arm/cpu/armv8/cache.S | 130 + arch/arm/cpu/armv8/cache_v8.c | 218 +++
Re: [U-Boot] [PATCH V2 0/2] add sdhci generic framework
Hi Vadim, The quirk is standing for some workaround for those host that has some limitation that it cannot directly be applied with standard sdhci.c code, so that we add one quirk for it, which let it could use the sdhci.c. Like the quirk as SDHCI_QUIRK_32BIT_DMA_ADDR, it indicate that some host has dma engine limitation that it must start from address with alignement. So if sdhci find caller set this quirk, it would follow corresponding workaround for it. There is no formal description for it as I could see. Thanks, Lei > -Original Message- > From: vben...@gmail.com [mailto:vben...@gmail.com] On Behalf Of Vadim > Bendebury > Sent: Tuesday, October 15, 2013 10:09 AM > To: Lei Wen > Cc: Prafulla Wadaskar; aflem...@gmail.com; Rob Herring; u- > b...@lists.denx.de; Yu Tang; Prabhanjan Sarnaik; Ashish Karkare; Andy > Fleming > Subject: Re: [U-Boot] [PATCH V2 0/2] add sdhci generic framework > > Hello Lei, > > I am looking into adding eMMC support for some intel SDHCI controllers > based on this common SDHCI driver submission. > > One thing which is not quite clear is the quirks - can you (or somebody > else on this list) please shed some light on what the quirks are. Is > there some kind of formal description/definition of various defined > quirks and their processing. > > Thank you in advance, > > --vb > > > On Wed, Jun 29, 2011 at 12:50 AM, Lei Wen wrote: > > V1: > > add sdhci generic framework and with marvell sdhci implementation > > > > V2: > > rename the previous file name from sdhci-mv to mv_sdhci > > > > Lei Wen (2): > > MMC: add sdhci generic framework > > MMC: add marvell sdhci driver > > > > drivers/mmc/Makefile |2 + > > drivers/mmc/mv_sdhci.c | 21 +++ > > drivers/mmc/sdhci.c| 433 > > > include/sdhci.h| 325 > > 4 files changed, 781 insertions(+), 0 deletions(-) create mode > > 100644 drivers/mmc/mv_sdhci.c create mode 100644 drivers/mmc/sdhci.c > > create mode 100644 include/sdhci.h > > > > ___ > > U-Boot mailing list > > U-Boot@lists.denx.de > > http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] serial: mxs_auart: Staticize local functions
Staticize local functions in mxs_auart driver. Signed-off-by: Axel Lin --- drivers/serial/mxs_auart.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/serial/mxs_auart.c b/drivers/serial/mxs_auart.c index 7cfe5bc..fc0fa96 100644 --- a/drivers/serial/mxs_auart.c +++ b/drivers/serial/mxs_auart.c @@ -40,7 +40,7 @@ static struct mxs_uartapp_regs *get_uartapp_registers(void) * Sets the baud rate and settings. * The settings are: 8 data bits, no parit and 1 stop bit. */ -void mxs_auart_setbrg(void) +static void mxs_auart_setbrg(void) { u32 div; u32 linectrl = 0; @@ -77,7 +77,7 @@ void mxs_auart_setbrg(void) writel(linectrl, ®s->hw_uartapp_linectrl); } -int mxs_auart_init(void) +static int mxs_auart_init(void) { struct mxs_uartapp_regs *regs = get_uartapp_registers(); /* Reset everything */ @@ -99,7 +99,7 @@ int mxs_auart_init(void) return 0; } -void mxs_auart_putc(const char c) +static void mxs_auart_putc(const char c) { struct mxs_uartapp_regs *regs = get_uartapp_registers(); /* Wait in loop while the transmit FIFO is full */ @@ -112,14 +112,14 @@ void mxs_auart_putc(const char c) mxs_auart_putc('\r'); } -int mxs_auart_tstc(void) +static int mxs_auart_tstc(void) { struct mxs_uartapp_regs *regs = get_uartapp_registers(); /* Checks if receive FIFO is empty */ return !(readl(®s->hw_uartapp_stat) & UARTAPP_STAT_RXFE_MASK); } -int mxs_auart_getc(void) +static int mxs_auart_getc(void) { struct mxs_uartapp_regs *regs = get_uartapp_registers(); /* Wait until a character is available to read */ -- 1.8.1.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 0/2] add sdhci generic framework
Hello Lei, I am looking into adding eMMC support for some intel SDHCI controllers based on this common SDHCI driver submission. One thing which is not quite clear is the quirks - can you (or somebody else on this list) please shed some light on what the quirks are. Is there some kind of formal description/definition of various defined quirks and their processing. Thank you in advance, --vb On Wed, Jun 29, 2011 at 12:50 AM, Lei Wen wrote: > V1: > add sdhci generic framework and with marvell sdhci implementation > > V2: > rename the previous file name from sdhci-mv to mv_sdhci > > Lei Wen (2): > MMC: add sdhci generic framework > MMC: add marvell sdhci driver > > drivers/mmc/Makefile |2 + > drivers/mmc/mv_sdhci.c | 21 +++ > drivers/mmc/sdhci.c| 433 > > include/sdhci.h| 325 > 4 files changed, 781 insertions(+), 0 deletions(-) > create mode 100644 drivers/mmc/mv_sdhci.c > create mode 100644 drivers/mmc/sdhci.c > create mode 100644 include/sdhci.h > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Prevent null pointer dereference originating in cmd_pxe.c
On Mon, Oct 07, 2013 at 09:51:48AM -0400, Steven Falco wrote: > Pass a valid cmdtp into do_tftpb(), do_ext2load(), and do_get_fat(), to avoid > possible crashes due to null pointer dereferencing. > > Signed-off-by: Steven A. Falco > > --- > > This doesn't apply cleanly, nor with --ignore-whitespace for me. Can > > you please re-check and re-send the patch? Thanks. > > Sorry - I've been having trouble getting Thunderbird to leave my text > alone. There was some insane "flowed text" setting that I just discovered > and disabled. > > I think I've got it right now. I'll download this email from the list > after I post it, and do a diff to be sure. > > Commit d7884e047d08447dfd1374e9fa2fdf7ab36e56f5 does not go far enough. There > is still at least one call chain that can result in a crash. > > The do_tftpb(), do_ext2load(), and do_get_fat() functions expect a valid > cmdtp. > Passing in NULL is particularly bad in the do_tftpb() case, because eventually > boot_get_kernel() will be called with a NULL cmdtp: > > do_tftpb() -> netboot_common() -> bootm_maybe_autostart() -> do_bootm() -> > do_bootm_states() -> bootm_find_os() -> boot_get_kernel() > > Around line 991 in cmd_bootm.c, boot_get_kernel() will dereference the null > pointer, and the board will crash. With a reworded commit message to include more details, applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] cmd_sandbox.c: Update for do_(load|save) not taking a number base
On Thu, Oct 10, 2013 at 10:46:56AM -0400, Tom Rini wrote: > Signed-off-by: Tom Rini > --- > common/cmd_sandbox.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied to u-boot/master -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Please pull u-boot-x86 buildman
On Thu, Oct 10, 2013 at 02:50:25PM -0600, Simon Glass wrote: > Hi Tom, > > The following changes since commit 99b4eaa68e0e2fdd9b0d0b1d40809d7e8f92044f: > > usb: Prevent using reserved registers on DM36x usb (2013-10-10 07:58:00 > -0400) > > are available in the git repository at: > > http://git.denx.de/u-boot-x86.git buildman > > for you to fetch changes up to 8bb2bddc2c18a3643ce53e793d5bc27a40e98a4f: > > buildman: don't fail --list-toolchains when toolchains fail > (2013-10-10 10:40:42 -0600) > > > Stephen Warren (1): > buildman: don't fail --list-toolchains when toolchains fail > > tools/buildman/toolchain.py | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v14 04/10] arm64: Add tool to statically apply RELA relocations
On Sat, 2013-10-12 at 16:14 +0800, feng...@phytium.com.cn wrote: > From: David Feng Please fix the From: line on patches which are from me. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2] ARM: omap4-panda: Add MAC address creation for panda
On Thu, Oct 10, 2013 at 08:54:23AM -0500, Dan Murphy wrote: > Add a MAC address create based on the OMAP die ID registers. > Then poplulate the ethaddr enviroment variable so that the device > tree alias can be updated prior to boot. > > Signed-off-by: Dan Murphy Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] am335x_evm.h: Make 'am335x_boneblack' use redundant environment
On Thu, Oct 10, 2013 at 10:25:18AM -0400, Tom Rini wrote: > Signed-off-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] .gitignore: add auto-generated /include/[s|t]pl-autoconf.mk
On Sun, Oct 13, 2013 at 05:08:02PM +0200, Daniel Schwierzeck wrote: > Signed-off-by: Daniel Schwierzeck Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] SPDX: document dual license notation
On Tue, Oct 08, 2013 at 09:53:45PM +0200, Wolfgang Denk wrote: > In [1] we discussed how we should deal with dual (or, more generally, > multiple) licensed files. Add this to Licenses/README so it's > properly documented. > > [1] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/166518 > > Signed-off-by: Wolfgang Denk Applied to u-boot/master with an ammendment of "list" as per Stephen's suggestion to the line in question, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM: omap4: Update sdram setting for panda rev A6
On Wed, Oct 09, 2013 at 01:53:58PM -0500, Dan Murphy wrote: > OMAP4 panda rev A6 is a 4430 es2.3 IC with an updated memory > part. > > The panda rev A6 uses Elpida 2x4Gb memory and no longer uses Micron > so the timings needs to be updated > > Signed-off-by: Dan Murphy Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 4/4] Coding Style cleanup: drop some excessive empty lines
On Fri, Oct 04, 2013 at 05:43:26PM +0200, Wolfgang Denk wrote: > Signed-off-by: Wolfgang Denk Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] env: dataflash: fix env_init issue
On Tue, Oct 08, 2013 at 04:30:21PM +0800, Bo Shen wrote: > As the SPI controller is not initialized before env_init(), it causes > reading env in dataflash failed. So, although saveenv() successfully, > it shows warning information when reboot the system as following: > > *** Warning - bad CRC, using default environment > > Let the env_relocate() to check env CRC and import it. > > Signed-off-by: Bo Shen Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 2/4] Coding Style cleanup: replace leading SPACEs by TABs
On Fri, Oct 04, 2013 at 05:43:24PM +0200, Wolfgang Denk wrote: > Signed-off-by: Wolfgang Denk With the change to dropping the changes to python tools that follow PEP 4 for an indentation method (if we want to convert them, we need to do it fully, this did not), applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 3/4] Coding Style cleanup: remove trailing empty lines
On Fri, Oct 04, 2013 at 05:43:25PM +0200, Wolfgang Denk wrote: > Signed-off-by: Wolfgang Denk Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 1/4, V2] Coding Style cleanup: remove trailing white space
On Mon, Oct 07, 2013 at 01:07:26PM +0200, Wolfgang Denk wrote: > Signed-off-by: Wolfgang Denk > > --- > Changes in V2: > - dropped incorrect modifications to > tools/easylogo/linux_blackfin.tga and > tools/easylogo/linux_logo.tga > Cudos to Michal Simek for pointing out. Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] pmic: max77686: fix the wrong offset
On Mon, Sep 30, 2013 at 02:23:37PM +0900, Jaehoon Chung wrote: > 0x1D is reserved. So BUCK3DVS1 is started from 0x1e. > > Signed-off-by: Jaehoon Chung Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] env_mmc: fix buffer allocation for armv7
On Fri, Oct 04, 2013 at 03:48:03PM +0200, Markus Niebel wrote: > From: Markus Niebel > > commit d196bd880347373237d73e0d115b4d51c68cf2ad adds > redundand environment to mmc. The usage of malloc in > env_relocate_spec triggers cache errors on armv7. > > Tested on a not mainlined i.MX53 board: > > Board: TQMa53 > I2C: ready > DRAM: 512 MiB > MMC: FSL_SDHC: 0, FSL_SDHC: 1 > ERROR: v7_dcache_inval_range - start address is not aligned - 0x8f57c2d8 > ERROR: v7_dcache_inval_range - stop address is not aligned - 0x8f57e2d8 > ERROR: v7_dcache_inval_range - start address is not aligned - 0x8f57e2e0 > ERROR: v7_dcache_inval_range - stop address is not aligned - 0x8f5802e0 > Using default environment > > Signed-off-by: Markus Niebel Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] u-boot-xlnx/master-next: build error
Hi Oleg, On Mon, 14 Oct 2013 11:54:18 -0700 (PDT), Oleg Dzhimiev wrote: > Hi, > > Building u-boot-xlnx/master-next:4cb9c3de73d66372d40d24baf82fa87a702f0c9b > throws an error: > > lowlevel_init.S: Assembler messages: > > lowlevel_init.S:35: Error: selected processor does not support ARM mode > > `fmrx r1,FPEXC' > > lowlevel_init.S:37: Error: selected processor does not support ARM mode > > `fmxr FPEXC,r1' > > make[1]: *** [lowlevel_init.o] Error 1 > > OS: Ubuntu 13.04 x64 > target: zynq_zed_config > cross-tools: cross compiler built with yocto poky: > > export CROSS_COMPILE=arm-poky-linux-gnueabi- > > export > > PATH=/opt/poky/1.4.2/sysroots/x86_64-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/:$PATH > > > > Thanks U-boot-xlnx is not a sub-repo of the official U-Boot; it is Xilinx' own version, located at https://github.com/Xilinx/u-boot-xlnx. I suggest you ask the Xilinx folks about it. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] declaring and initializing variables
On 10/07/2013 03:03 PM, Kim Phillips wrote: > On Mon, 30 Sep 2013 17:04:33 -0700 > York Sun wrote: > >> Kim, et al., >> >> I know I have asked this before. Pardon me as I don't consider myself a >> savy programmer. >> >> I am cleaning up the DDR driver for mpc83xx, mpc85xx and mpc86xx. The >> question is the accetable formats of declaring and initializing variable >> at the same time. The variables are the ccsr register pointers. I have >> two formats here >> >> struct ccsr_ddr __iomem *ddr = (void *) CONFIG_FOO_ADDR; >> struct ccsr_ddr __iomem *ddr = >> (struct ccsr_ddr __iomem *) CONFIG_FOO_ADDR; >> >> You have told me the second format is preferred. I have been using this >> format since. But in practice, the second format is often too long and I >> have to wrap to next line. It's not a problem for new code. As I am >> trying to cleanup the existing code, I would have to make more changes. >> So I am back to this question. Is the first format (using void *) >> accetable in long term? > > you're not running sparse, are you? :) > > Use 'make C=1' or 'MAKEALL -C' when building u-boot. > I see what you mean. We have so many issue with existing code. Is it practical to enforce? York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] u-boot-xlnx/master-next: build error
Hi, Building u-boot-xlnx/master-next:4cb9c3de73d66372d40d24baf82fa87a702f0c9b throws an error: > lowlevel_init.S: Assembler messages: > lowlevel_init.S:35: Error: selected processor does not support ARM mode > `fmrx r1,FPEXC' > lowlevel_init.S:37: Error: selected processor does not support ARM mode > `fmxr FPEXC,r1' > make[1]: *** [lowlevel_init.o] Error 1 OS: Ubuntu 13.04 x64 target: zynq_zed_config cross-tools: cross compiler built with yocto poky: > export CROSS_COMPILE=arm-poky-linux-gnueabi- > export > PATH=/opt/poky/1.4.2/sysroots/x86_64-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/:$PATH > Thanks -- View this message in context: http://u-boot.10912.n7.nabble.com/u-boot-xlnx-master-next-build-error-tp165385.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] u-boot-xlnx 'master-next' branch: usb not working for microzed
Hi, I've been working with xilinx's microzed board (zynq) recently. The actual goal is a fsbl-less u-boot. But even with fsbl - USB is not working in u-boot-xlnx 'master-next' branch. At the same time it works in the 'master'. Mostly interested in 'master-next'. Has anyone tried USB in the 'master-next' for microzed/zedboard? OS: Ubuntu 13.04 x64 board: MicroZed u-boot-xlnx 'master-next' rev: bbd91fc9ae290c31dc52fd8322f43f67ddd39247 u-boot-xlnx 'master' rev: 0f6dbff16b792a106f52ca37f4503335af30601b cross-tools: cross compiler built with yocto poky: > export CROSS_COMPILE=arm-poky-linux-gnueabi- > export > PATH=/opt/poky/1.4.2/sysroots/x86_64-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/:$PATH incorrect output: > ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver > ehci-pci: EHCI PCI platform driver correct output: > Found SMSC USB3320 ULPI transceiver. > ULPI integrity check: passed. > xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller > xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1 > xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x > xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00 Thanks -- View this message in context: http://u-boot.10912.n7.nabble.com/u-boot-xlnx-master-next-branch-usb-not-working-for-microzed-tp165384.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC] i2c_reloc_fixup fails on m68k
On Tuesday 24 September 2013 02:33:55 Heiko Schocher wrote: > Am 23.09.2013 15:50, schrieb Jens Scharsig: > > Hello, > > > > I have a access violation problem with i2c_reloc_fixup on coldfire > > m68k systems. > > > > I found out, the i2c_reloc_fixup tries to relocate the adapter itself, > > but at this time i2c_adap_p is already relocated. > > Which toolchain? > > > Can anybody confirm this? > > Added Mike Frysinger, Sonic Zhang (for blackfin) Jason Jin (for m68k) > and Macpaul Lin (for nds32) to Cc ... > > > I think also m68k, backfin and nds32 systems are affected > > Sorry, I have no such system ... maybe you are the first who stepped > in it ... Blackfin doesn't do self-relocation like that, so we don't care :) -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Hi Måns, On Mon, 14 Oct 2013 16:59:56 +0100, Måns Rullgård wrote: > Albert ARIBAUD writes: > > > Hi Måns, > > > > On Mon, 14 Oct 2013 15:09:39 +0100, Måns Rullgård > > wrote: > > > >> Albert ARIBAUD writes: > >> > >> > Hi Måns, > >> > > >> > On Mon, 14 Oct 2013 14:05:13 +0100, Måns Rullgård > >> > wrote: > >> > > >> >> Albert ARIBAUD writes: > >> >> > >> >> >> > Please do not advise using native unaligned accesses on code that > >> >> >> > is > >> >> >> > not strictly used by ARMv6+ architectures: the present code, for > >> >> >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, > >> >> >> > should never assume ability to perform unaligned accesses natively. > >> >> >> > >> >> >> I'm advising no such thing. I said two things: > >> >> >> > >> >> >> 1. Declaring a struct with the 'packed' attribute makes gcc > >> >> >> automatically generate correct code for all targets. _IF_ the > >> >> >> selected target supports unaligned ldr/str, these might get used. > >> >> >> > >> >> >> 2. If your target is ARMv6 or later _AND_ you enable strict > >> >> >> alignment > >> >> >> checking in the system control register, you _MUST_ build with > >> >> >> the > >> >> >> -mno-unaligned-access flag. > >> >> > > >> >> > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > >> >> > support unaligned addresses unless this is explicitly disabled in > >> >> > the system control register" as a suggestion to use that capability. > >> >> > >> >> If building for ARMv6 or later, I do suggest allowing unaligned > >> >> accesses. The moment you add -march=armv6 (or equivalent), you allow > >> >> for a number of things not supported by older versions, so why not > >> >> unaligned memory accesses? > >> > > >> > doc/README.arm-unaligned-accesses probably has the answer to your > >> > question, especially from line 21 onward. If not, I'll be happy to > >> > provide further clarification. > >> > >> That is about as backwards as it can get. By adding -munaligned-access > >> you are telling gcc that unaligned accesses are supported and welcome. > >> With this setting enabled, gcc can and will generate unaligned accesses > >> just about anywhere. This setting is NOT compatible with the SCTRL.A > >> bit being set (strict hardware alignment checking). > >> > >> You cannot enable strict alignment checking in hardware, tell the > >> compiler unaligned accesses are OK, and then expect not to have > >> problems. This is no more a valid combination than allowing > >> floating-point instructions when the target has no FPU. > > > > I sense that you have not understood the reason why I want alignment > > checking enabled in ARM yet also want ARMv6+ builds to emit native > > unaligned accesses if they consider it needed. > > Your wishes are mutually exclusive. You cannot both allow hardware > unaligned access AND at the same time trap them. These are not wishes, there are actual settings chosen for the reason already laid out. They do appear contradictory if your goal is to use ARMv6+ features to their maximum, but this is not the goal here. > > The reason is, if we prevent ARMv6 builds from using native unaligned > > accesses, they would replace *all* such accesses with smaller, aligned, > > ones, which would not trigger a data abort; even those unaligned > > accesses cased by programming errors. > > If you disable unaligned accesses in hardware (as u-boot does), you have > no option but doing them a byte at a time. Indeed, but I do *not* *disable* native unaligned accesses, I *allow* them; and I do not *want* them to be replaced by byte-by-byte emulation. > > Whereas if we allow ARMv6+ builds to use native unaligned accesses, yet > > enable alignment checks, then any native unaligned access will be > > caught as early as possible, and we'll find and cure the issue faster. > > > > This is, of course, assuming we don't voluntarily do native unaligned > > accesses, and in U-Boot, we indeed don't: in U-Boot, accesses are done > > on natural alignments. > > The hardware does not differentiate between intentional and > unintentional unaligned accesses. Unlike some architectures, which have > dedicated instructions for unaligned accesses, ARM uses the same > instructions in both cases (with some limitations). Indeed, the hardware does not differentiate between intentional vs unintentional unaligned accesses, which is why I decided that rather than suffer the latter, we should trap them both and fix them according to their nature: intentional ones get replaced by emulation, and the cause of unintentional ones gets fixed. > > Since I have set up this policy, experience (and it has been a while) > > shows that very few problems arise from alignment checks + native > > unaligned accesses. These roughly come from hardware- or standards- > > mandated unaligned fields, in which case they are worth explicitly > > accessing with "unaligned" macros, or from programming errors, wh
Re: [U-Boot] [PATCH] Makefile: Introduce ARCH_PLATFORM_LIBGCC variable
Hi Tom, On Mon, 14 Oct 2013 11:16:37 -0400, Tom Rini wrote: > On Sat, Oct 12, 2013 at 09:43:33AM +0200, Albert ARIBAUD wrote: > > Hi Tom, > > > > On Fri, 11 Oct 2013 16:13:03 -0400, Tom Rini wrote: > > > > > In some cases, such as arm multi-lib hardfloat (hf) toolchains, we will > > > have multiple libgcc.a's available, and the arch needs to provide > > > additional logic to determine the right file to use > > > (-print-libgcc-file-name contains no CFLAG parsing logic). > > > > > > Cc: Albert Aribaud > > > Signed-off-by: Tom Rini > > > --- > > > Makefile |4 > > > arch/arm/config.mk | 11 +++ > > > 2 files changed, 15 insertions(+) > > > > > > diff --git a/Makefile b/Makefile > > > index b09bfcc..13b396f 100644 > > > --- a/Makefile > > > +++ b/Makefile > > > @@ -357,8 +357,12 @@ else > > > PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc > > > endif > > > else > > > +ifneq ("$(ARCH_PLATFORM_LIBGCC)","") > > > +PLATFORM_LIBGCC := -L $(shell dirname $(ARCH_PLATFORM_LIBGCC)) -lgcc > > > +else > > > PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) > > > -print-libgcc-file-name`) -lgcc > > > endif > > > +endif > > > PLATFORM_LIBS += $(PLATFORM_LIBGCC) > > > export PLATFORM_LIBS > > > > > > diff --git a/arch/arm/config.mk b/arch/arm/config.mk > > > index d0cf43f..e1d0dec 100644 > > > --- a/arch/arm/config.mk > > > +++ b/arch/arm/config.mk > > > @@ -19,6 +19,17 @@ LDFLAGS_FINAL += --gc-sections > > > PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \ > > > -fno-common -ffixed-r9 -msoft-float > > > > > > +# > > > +# When we use a hardfp toolchain if there are both 'libgcc.a' (hardfp) > > > and > > > +# 'arm-linux-gnueabi/libgcc.a' (softfp) we need to use the latter. We > > > +# cannot always build with a hardfp-only toolchain. > > > > What does this last sentence mean exactly? > > What it says. If a hardfp only toolchain is used certain targets shall > not link. I had Marek confirm this as well. I don't have the exact > logs handy, but today there's a few targets that will fail, and the nand > flash patchset introduces another because we enforce -msoft-float on > U-Boot, and rely on libgcc from the toolchain for certain functions > (__udivdi3 for example). I was wondering if the sentence meant this, or if it meant "there is no way we can ensure that we'll always build with a hardfp-only toolchain". Maybe the ambiguity would be lifted by saying "Building with a hardfp-only toolchain will fail [for some targets]"? > I don't know how you weren't making this fail on ELDK 5.x armv7a-fp, but > I was and the Linaro 2013.03 toolchain also will show this problem. > Once I push the nand PR (shortly), building for am3517_crane for example > will fail without this patch. That may be because I have several toolchains installed, one of which is in the standard path (/usr/bin, /usr/lib, etc). Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] fatls shows duplicated entries with long and short names
On Mon, Oct 14, 2013 at 9:37 PM, Tom Rini wrote: > On Mon, Oct 14, 2013 at 06:00:20PM +0200, Hector Palacios wrote: >> Dear Marek, >> >> I noticed that 'fatls' displays duplicated filenames (short and >> long) for every file in the media: >> >> # fatls mmc 0 >> 2083460 uimage-myplatform >> 2083460 uimage~1 >> 1520 rootfs-dummy.jffs2 >> 1520 rootfs~1.jff >> 3294952 uimage >> 3294952 uimage >> >> The guilty commit is ff04f6d1224d8952b566b8671222151495883073 by >> you, who moved the chksum calculation out of an if() and now the >> code never enters this: >> >> #ifdef CONFIG_SUPPORT_VFAT >> else if (dols == LS_ROOT && csum == prevcksum) { >> prevcksum = 0x; >> dentptr++; >> continue; >> } >> #endif >> >> Could you please check? > > Can you please provide more details about your platform and what U-Boot > rev you see this on exactly? I haven't seen anything like this on > Beaglebone Black recently, for example. > This kind of issue we faced(by Michal) http://u-boot.10912.n7.nabble.com/FAT-problem-with-new-mkcksum-implementation-td145817.html Where the issue got resolved with the change from Marek "vfat: Fix mkcksum argument sizes" (sha: 6ad77d88e57f6ab815ec7e85c5ac329054318c73) My suggestion to Hector, can you try to reproduce the same by format the card again. -- Thanks, Jagan. Jagannadha Sutradharudu Teki, E: jagannadh.t...@gmail.com, P: +91-9676773388 Engineer - System Software Hacker U-boot - SPI Custodian and Zynq APSOC Ln: http://www.linkedin.com/in/jaganteki ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 2/2] arm:goni:dfu Add support for DFU at GONI target
From: Arkadiusz Wlodarczyk Proper adjustment for supporting DFU at GONI target has been made. The s5p_goni.h file has been updated. Moreover the code for low level USB initialization has been added to GONI board code. The malloc pool has been enlarged in order to support larger buffer sizes needed by DFU implementation. Change-Id: I1b4953368176e8a7588abb0da37de6321f835698 Signed-off-by: Arkadiusz Wlodarczyk Signed-off-by: Kyungmin Park Signed-off-by: Mateusz Zalega Tested-by: Arkadiusz Wlodarczyk Tested-by: Mateusz Zalega Cc: Minkyu Kang --- Changes since v3: - adjusted to match recently accepted USB patches --- board/samsung/goni/goni.c | 80 ++ include/configs/s5p_goni.h | 69 ++- 2 files changed, 127 insertions(+), 22 deletions(-) diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 366f648..3a2f686 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include + DECLARE_GLOBAL_DATA_PTR; static struct s5pc110_gpio *s5pc110_gpio; @@ -172,4 +175,81 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .regs_otg = S5PC110_OTG_BASE, .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, }; + +int board_usb_init(int index, enum board_usb_init_type init) +{ + debug("USB_udc_probe\n"); + s3c_udc_probe(&s5pc110_otg_data); + return 0; +} +#endif + +#ifdef CONFIG_USB_GADGET_MASS_STORAGE +static int ums_read_sector(struct ums_device *ums_dev, + ulong start, lbaint_t blkcnt, void *buf) +{ + if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num, + start + ums_dev->offset, + blkcnt, buf) != blkcnt) + return -1; + + return 0; +} + +static int ums_write_sector(struct ums_device *ums_dev, + ulong start, lbaint_t blkcnt, const void *buf) +{ + if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num, + start + ums_dev->offset, + blkcnt, buf) != blkcnt) + return -1; + + return 0; +} + +static void ums_get_capacity(struct ums_device *ums_dev, + long long int *capacity) +{ + long long int tmp_capacity; + + tmp_capacity = (long long int) ((ums_dev->offset + ums_dev->part_size) + * SECTOR_SIZE); + *capacity = ums_dev->mmc->capacity - tmp_capacity; +} + +static struct ums_board_info ums_board = { + .read_sector = ums_read_sector, + .write_sector = ums_write_sector, + .get_capacity = ums_get_capacity, + .name = "GONI UMS disk", + .ums_dev = { + .mmc = NULL, + .dev_num = 0, + .offset = 0, + .part_size = 0. + }, +}; + +struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned int offset, + unsigned int part_size) +{ + struct mmc *mmc; + + mmc = find_mmc_device(dev_num); + /* +* mmc initialization is necessary prior to the ums command usage +* due to fact that on goni target environment is read from oneNand +* memory, so the mmc remains uninitialized when u-boot prompt appears +*/ + if (!mmc || mmc_init(mmc)) + return NULL; + + ums_board.ums_dev.mmc = mmc; + ums_board.ums_dev.dev_num = dev_num; + ums_board.ums_dev.offset = offset; + ums_board.ums_dev.part_size = part_size; + + return &ums_board; +} + #endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index fd441c8..218cf3d 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -41,7 +41,7 @@ * Size of malloc() pool * 1MB = 0x10, 0x10 = 1024 * 1024 */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (1 << 20)) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (16 << 20)) /* * select serial console configuration */ @@ -71,28 +71,46 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_REGINFO #define CONFIG_CMD_ONENAND -#define CONFIG_CMD_MTDPARTS #define CONFIG_CMD_MMC +#define CONFIG_CMD_DFU +#define CONFIG_CMD_GPT -#define CONFIG_BOOTDELAY 1 -#define CONFIG_ZERO_BOOTDELAY_CHECK +/* USB Composite download gadget - g_dnl */ +#define CONFIG_USBDOWNLOAD_GADGET +#define CONFIG_DFU_FUNCTION +#define CONFIG_DFU_MMC -#define CONFIG_MTD_DEVICE -#define CONFIG_MTD_PARTITIONS +/* USB Samsung's IDs */ +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8 +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601 +#define CONFIG_G_DNL_MANUFACTURER "Samsung" -/* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */ -#define MTDIDS_DEFAULT "onenand0=samsung-onenand" -#defin
[U-Boot] [PATCH v4 1/2] arm:goni: Update configuration for goni target
From: Arkadiusz Wlodarczyk Configuration file for GONI has been updated to support FAT file system, new mmc partitioning scheme and read linux kernel from eMMC instead of OneNAND. Signed-off-by: Arkadiusz Wlodarczyk Signed-off-by: Kyungmin Park Signed-off-by: Mateusz Zalega Tested-by: Arkadiusz Wlodarczyk Tested-by: Mateusz Zalega Cc: Minkyu Kang --- Changes since v3: - added CMD_EXT4 - made it conform with current, recently accepted USB patches --- include/configs/s5p_goni.h | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index c303244..fd441c8 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -94,7 +94,7 @@ #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT -#define CONFIG_BOOTCOMMAND "run ubifsboot" +#define CONFIG_BOOTCOMMAND "run mmcboot" #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0" @@ -124,7 +124,7 @@ "onenand erase 0x0156 0x1eaa;" \ "onenand write 0x3200 0x126 0x8C\0" \ "bootk=" \ - "onenand read 0x30007FC0 0xc0 0x60;" \ + "run loaduimage;" \ "bootm 0x30007FC0\0" \ "flashboot=" \ "set bootargs root=/dev/mtdblock${bootblock} " \ @@ -143,16 +143,21 @@ "set bootargs " CONFIG_RAMDISK_BOOT \ " initrd=0x3300,8M ramdisk=8192\0" \ "mmcboot=" \ - "set bootargs root=${mmcblk} rootfstype=${rootfstype}" \ + "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ + "rootfstype=${rootfstype}" \ CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \ CONFIG_COMMON_BOOT "; run bootk\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "verify=n\0" \ - "rootfstype=cramfs\0" \ + "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "mtdparts=" MTDPARTS_DEFAULT \ "meminfo=mem=80M mem=256M@0x4000 mem=128M@0x5000\0" \ + "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \ + "mmcdev=0\0" \ + "mmcbootpart=2\0" \ + "mmcrootpart=5\0" \ "mmcblk=/dev/mmcblk1p1\0" \ "bootblock=9\0" \ "ubiblock=8\0" \ @@ -198,6 +203,11 @@ #define CONFIG_DOS_PARTITION 1 +/* FAT */ +#define CONFIG_CMD_FAT +#define CONFIG_CMD_EXT4 +#define CONFIG_FAT_WRITE + #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - 0x100) #define CONFIG_SYS_CACHELINE_SIZE 64 -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model
CONFIGs and README for driver 'zynq_i2c.c'. Signed-off-by: Michael Burr Cc: Heiko Schocher Cc: Michal Simek --- === This patch depends on the previous patch titled === "[PATCH] I2C:Zynq: Adapt this driver to the new model" === submitted 26 Sep. 2013. === This patch depends on the previous patch titled === "[PATCH] I2C: Zynq: Support for 0-length register address" === submitted 24 Sep. 2013. --- README |9 + include/configs/zynq.h | 10 -- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README b/README index ccd47fa..fd2c8fc 100644 --- a/README +++ b/README @@ -1995,6 +1995,15 @@ CBFS (Coreboot Filesystem) support - CONFIG_SYS_I2C_PPC4XX_CH0 activate hardware channel 0 - CONFIG_SYS_I2C_PPC4XX_CH1 activate hardware channel 1 + - drivers/i2c/zynq_i2c.c + - Activate this driver with CONFIG_SYS_I2C_ZYNQ + - This driver operates only as bus-master (i.e. slave- + address == 0) and supports only 100 kbps speed. + - Both bus-controller devices in the Zynq PS (I2C0 and I2C1) + are supported. (However, note that Zynq PL configuration + may be needed in order to route some bus lines to external + pins.) + additional defines: CONFIG_SYS_NUM_I2C_BUSES diff --git a/include/configs/zynq.h b/include/configs/zynq.h index b9f381f..1ae915f 100644 --- a/include/configs/zynq.h +++ b/include/configs/zynq.h @@ -56,15 +56,13 @@ # define CONFIG_DOS_PARTITION #endif -#define CONFIG_ZYNQ_I2C0 - /* I2C */ -#if defined(CONFIG_ZYNQ_I2C0) || defined(CONFIG_ZYNQ_I2C1) +#define CONFIG_SYS_I2C_ZYNQ +#ifdef CONFIG_SYS_I2C_ZYNQ +# define CONFIG_SYS_I2C # define CONFIG_CMD_I2C -# define CONFIG_ZYNQ_I2C -# define CONFIG_HARD_I2C # define CONFIG_SYS_I2C_SPEED 10 -# define CONFIG_SYS_I2C_SLAVE 1 +# define CONFIG_SYS_I2C_SLAVE 0 #endif #if defined(CONFIG_ZYNQ_DCC) -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] I2C:Zynq: Adapt this driver to the new model
I am submitting a patch for 'include/zynq.h' as well as for the README file. I might be able to add code for certain particular boards which use this driver -- however, I think it may be easier for everyone if we don't do that until mainline is synchronized with Michal's Xilinx repo. (That's because the Xilinx repo has config files for several individual boards, but the mainline repo doesn't yet have those files.) Michael Burr // Software Engineer II Logic PD T // 612.436.7273 NOTICE: Important disclaimers and limitations apply to this email. Please see this web page for our disclaimers and limitations: http://logicpd.com/email-disclaimer/ -Original Message- From: Heiko Schocher [mailto:h...@denx.de] Sent: Monday, October 14, 2013 1:00 AM To: Michael Burr Cc: u-boot@lists.denx.de; Michal Simek Subject: Re: [PATCH] I2C:Zynq: Adapt this driver to the new model Hello Michael, Am 26.09.2013 17:43, schrieb Michael Burr: > Signed-off-by: Michael Burr > Cc: Heiko Schocher > Cc: Michal Simek > --- > === Note: this patch depends on the previous patch titled === "[PATCH] > I2C: Zynq: Support for 0-length register address" > === submitted 24 Sep. 2013. > > Tested on Xilinx ZC702 eval board: > Select various I2C chips using TI PCA9548 bus multiplexer. > Write and read registers with addresses of length 0 and 1. > > drivers/i2c/zynq_i2c.c | 108 > ++-- > 1 file changed, 67 insertions(+), 41 deletions(-) Could you please change the config define for this driver from CONFIG_ZYNQ_I2C to CONFIG_SYS_I2C_ZYNQ ? Also, adapt please all boards, which use this driver. and add a entry in README. Thanks! > diff --git a/drivers/i2c/zynq_i2c.c b/drivers/i2c/zynq_i2c.c index > 9cbd3e4..7972a59 100644 > --- a/drivers/i2c/zynq_i2c.c > +++ b/drivers/i2c/zynq_i2c.c > @@ -7,6 +7,8 @@ >* >* Copyright (c) 2012-2013 Xilinx, Michal Simek >* > + * Copyright (c) 2013 Logic PD, Michael Burr > + * >* SPDX-License-Identifier: GPL-2.0+ >*/ > > @@ -64,18 +66,28 @@ struct zynq_i2c_registers { > #define ZYNQ_I2C_FIFO_DEPTH 16 > #define ZYNQ_I2C_TRANSFERT_SIZE_MAX 255 /* Controller transfer limit */ > > -#if defined(CONFIG_ZYNQ_I2C0) > -# define ZYNQ_I2C_BASE ZYNQ_I2C_BASEADDR0 > -#else > -# define ZYNQ_I2C_BASE ZYNQ_I2C_BASEADDR1 > -#endif > - > -static struct zynq_i2c_registers *zynq_i2c = > - (struct zynq_i2c_registers *)ZYNQ_I2C_BASE; > +static struct zynq_i2c_registers *i2c_select(struct i2c_adapter > +*adap) { > + return adap->hwadapnr ? > +/* Zynq PS I2C1 */ > +(struct zynq_i2c_registers *)ZYNQ_I2C_BASEADDR1 : > +/* Zynq PS I2C0 */ > +(struct zynq_i2c_registers *)ZYNQ_I2C_BASEADDR0; } > > /* I2C init called by cmd_i2c when doing 'i2c reset'. */ -void > i2c_init(int requested_speed, int slaveadd) > +static void zynq_i2c_init(struct i2c_adapter *adap, int speed, int > +slaveaddr) > { > + struct zynq_i2c_registers *zynq_i2c = i2c_select(adap); > + > + if (speed != 10) > + debug("Warning: requested speed not supported.\n"); > + if (slaveaddr) > + debug("Warning: slave mode not supported.\n"); > + > + /* The following _assumes_ clock rate cpu_1x = 111 MHz */ > + /* This could use improvement! Also see 'i2c_set_bus_speed' below */ > + > /* 111MHz / ( (3 * 17) * 22 ) = ~100KHz */ > writel((16<< ZYNQ_I2C_CONTROL_DIV_B_SHIFT) | > (2<< ZYNQ_I2C_CONTROL_DIV_A_SHIFT),&zynq_i2c->control); > @@ -86,7 +98,7 @@ void i2c_init(int requested_speed, int slaveadd) > } > > #ifdef DEBUG > -static void zynq_i2c_debug_status(void) > +static void zynq_i2c_debug_status(struct zynq_i2c_registers > +*zynq_i2c) > { > int int_status; > int status; > @@ -128,7 +140,7 @@ static void zynq_i2c_debug_status(void) > #endif > > /* Wait for an interrupt */ > -static u32 zynq_i2c_wait(u32 mask) > +static u32 zynq_i2c_wait(struct zynq_i2c_registers *zynq_i2c, u32 > +mask) > { > int timeout, int_status; > > @@ -139,7 +151,7 @@ static u32 zynq_i2c_wait(u32 mask) > break; > } > #ifdef DEBUG > - zynq_i2c_debug_status(); > + zynq_i2c_debug_status(zynq_i2c); > #endif > /* Clear interrupt status flags */ > writel(int_status& mask,&zynq_i2c->interrupt_status); > @@ -151,17 +163,19 @@ static u32 zynq_i2c_wait(u32 mask) >* I2C probe called by cmd_i2c when doing 'i2c probe'. >* Begin read, nak data byte, end. >*/ > -int i2c_probe(u8 dev) > +static int zynq_i2c_probe(struct i2c_adapter *adap, uint8_t chip) > { > + struct zynq_i2c_registers *zynq_i2c = i2c_select(adap); > + > /* Attempt to read a byte */ > setbits_le32(&zynq_i2c->control, ZYNQ_I2C_CONTROL_CLR_FIFO | > ZYNQ_I2C_CONTROL_RW); > clrbits_le32(&zynq_i2c->control, ZYNQ_I2C_CONTROL_HOLD); > writel(0xFF,&zynq_i2c->interrupt_status); > - write
Re: [U-Boot] fatls shows duplicated entries with long and short names
On Mon, Oct 14, 2013 at 06:00:20PM +0200, Hector Palacios wrote: > Dear Marek, > > I noticed that 'fatls' displays duplicated filenames (short and > long) for every file in the media: > > # fatls mmc 0 > 2083460 uimage-myplatform > 2083460 uimage~1 > 1520 rootfs-dummy.jffs2 > 1520 rootfs~1.jff > 3294952 uimage > 3294952 uimage > > The guilty commit is ff04f6d1224d8952b566b8671222151495883073 by > you, who moved the chksum calculation out of an if() and now the > code never enters this: > > #ifdef CONFIG_SUPPORT_VFAT > else if (dols == LS_ROOT && csum == prevcksum) { > prevcksum = 0x; > dentptr++; > continue; > } > #endif > > Could you please check? Can you please provide more details about your platform and what U-Boot rev you see this on exactly? I haven't seen anything like this on Beaglebone Black recently, for example. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] fatls shows duplicated entries with long and short names
Dear Hector Palacios, > Dear Marek, > > I noticed that 'fatls' displays duplicated filenames (short and long) for > every file in the media: > > # fatls mmc 0 >2083460 uimage-myplatform >2083460 uimage~1 > 1520 rootfs-dummy.jffs2 > 1520 rootfs~1.jff >3294952 uimage >3294952 uimage > > The guilty commit is ff04f6d1224d8952b566b8671222151495883073 by you, who > moved the chksum calculation out of an if() and now the code never enters > this: > > #ifdef CONFIG_SUPPORT_VFAT > else if (dols == LS_ROOT && csum == prevcksum) { > prevcksum = 0x; > dentptr++; > continue; > } > #endif > > Could you please check? CCing Tom. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Albert ARIBAUD writes: > Hi Måns, > > On Mon, 14 Oct 2013 15:09:39 +0100, Måns Rullgård > wrote: > >> Albert ARIBAUD writes: >> >> > Hi Måns, >> > >> > On Mon, 14 Oct 2013 14:05:13 +0100, Måns Rullgård >> > wrote: >> > >> >> Albert ARIBAUD writes: >> >> >> >> >> > Please do not advise using native unaligned accesses on code that is >> >> >> > not strictly used by ARMv6+ architectures: the present code, for >> >> >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, >> >> >> > should never assume ability to perform unaligned accesses natively. >> >> >> >> >> >> I'm advising no such thing. I said two things: >> >> >> >> >> >> 1. Declaring a struct with the 'packed' attribute makes gcc >> >> >> automatically generate correct code for all targets. _IF_ the >> >> >> selected target supports unaligned ldr/str, these might get used. >> >> >> >> >> >> 2. If your target is ARMv6 or later _AND_ you enable strict alignment >> >> >> checking in the system control register, you _MUST_ build with the >> >> >> -mno-unaligned-access flag. >> >> > >> >> > Then I apologize; I had read "Note that on ARMv6 and later ldr/str >> >> > support unaligned addresses unless this is explicitly disabled in >> >> > the system control register" as a suggestion to use that capability. >> >> >> >> If building for ARMv6 or later, I do suggest allowing unaligned >> >> accesses. The moment you add -march=armv6 (or equivalent), you allow >> >> for a number of things not supported by older versions, so why not >> >> unaligned memory accesses? >> > >> > doc/README.arm-unaligned-accesses probably has the answer to your >> > question, especially from line 21 onward. If not, I'll be happy to >> > provide further clarification. >> >> That is about as backwards as it can get. By adding -munaligned-access >> you are telling gcc that unaligned accesses are supported and welcome. >> With this setting enabled, gcc can and will generate unaligned accesses >> just about anywhere. This setting is NOT compatible with the SCTRL.A >> bit being set (strict hardware alignment checking). >> >> You cannot enable strict alignment checking in hardware, tell the >> compiler unaligned accesses are OK, and then expect not to have >> problems. This is no more a valid combination than allowing >> floating-point instructions when the target has no FPU. > > I sense that you have not understood the reason why I want alignment > checking enabled in ARM yet also want ARMv6+ builds to emit native > unaligned accesses if they consider it needed. Your wishes are mutually exclusive. You cannot both allow hardware unaligned access AND at the same time trap them. > The reason is, if we prevent ARMv6 builds from using native unaligned > accesses, they would replace *all* such accesses with smaller, aligned, > ones, which would not trigger a data abort; even those unaligned > accesses cased by programming errors. If you disable unaligned accesses in hardware (as u-boot does), you have no option but doing them a byte at a time. > Whereas if we allow ARMv6+ builds to use native unaligned accesses, yet > enable alignment checks, then any native unaligned access will be > caught as early as possible, and we'll find and cure the issue faster. > > This is, of course, assuming we don't voluntarily do native unaligned > accesses, and in U-Boot, we indeed don't: in U-Boot, accesses are done > on natural alignments. The hardware does not differentiate between intentional and unintentional unaligned accesses. Unlike some architectures, which have dedicated instructions for unaligned accesses, ARM uses the same instructions in both cases (with some limitations). > Since I have set up this policy, experience (and it has been a while) > shows that very few problems arise from alignment checks + native > unaligned accesses. These roughly come from hardware- or standards- > mandated unaligned fields, in which case they are worth explicitly > accessing with "unaligned" macros, or from programming errors, which > should be fixed. The problem is that when you tell gcc (using -munaligned-access) that hardware unaligned accesses are supported, you give it permission to compile even get/put_unaligned() calls (or otherwise annotated accesses) using regular LDR/STR instructions. If this code runs with strict checking enabled in hardware (SCTRL.A set), it will trap. What you probably want is to build with -mno-unaligned-access and enable strict hardware alignment checking. This ensures that any deliberate unaligned accesses (e.g. through get_unaligned) are split into multiple smaller accesses while trapping any (unintentional) unaligned word accesses. The most common alignment-related programming mistake is to dereference a pointer with insufficient alignment. It is far less common for pointers to be marked as unaligned when they do not need to be. > Another benefit of it is, if the code builds and runs in mainline with > alignment ch
Re: [U-Boot] [ANN] Release slightly delayed
Hi Tom, On Mon, 14 Oct 2013 11:19:58 -0400, Tom Rini wrote: > Hey all, > > Since I've pushed the nand PR today, and I see a few other patches in > patchwork that we need to get to avoid regressions, I'm going to push > the release out a few days (thinking Wednesday currently). We'll > lengthen the merge window slightly and cut one of the early on -rc's a > bit early in the next window to get us back on track. (Cc:in Prafulla) Prafulla, are you going to send a PR soon? Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] fatls shows duplicated entries with long and short names
Dear Marek, I noticed that 'fatls' displays duplicated filenames (short and long) for every file in the media: # fatls mmc 0 2083460 uimage-myplatform 2083460 uimage~1 1520 rootfs-dummy.jffs2 1520 rootfs~1.jff 3294952 uimage 3294952 uimage The guilty commit is ff04f6d1224d8952b566b8671222151495883073 by you, who moved the chksum calculation out of an if() and now the code never enters this: #ifdef CONFIG_SUPPORT_VFAT else if (dols == LS_ROOT && csum == prevcksum) { prevcksum = 0x; dentptr++; continue; } #endif Could you please check? Best regards, -- Hector Palacios ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request: u-boot-arm/master
On Fri, Oct 11, 2013 at 04:33:18PM +0200, Albert ARIBAUD wrote: > Hello Tom, > > The following changes since commit > 572886af5984febafa6f083e6b8af0465f4f5764: > > socfpga: Adding pin mux handoff files (2013-10-07 19:32:30 +0200) > > are available in the git repository at: > > git://git.denx.De/u-boot-arm master > > for you to fetch changes up to 5a9120439416a9101dec7c7dc65bb75a5ff09c4e: > > Merge branch 'u-boot-samsung/master' into > 'u-boot-arm/master' (2013-10-11 14:47:25 +0200) > > > > Albert ARIBAUD (1): > Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master' > > Piotr Wilczek (4): > drivers:power:max77693: add support for new multi function pmic > max77693 power:battery: add battery support for Trats2 board > samsung:common:i2c: add definions for third soft I2C adapter for > Trats2 board samsung: trats2: add support for new board Trats2 > > Makefile | 1 + > board/samsung/common/multi_i2c.c | 12 + > board/samsung/trats2/Makefile | 34 +++ > board/samsung/trats2/trats2.c | 513 > + > boards.cfg | 1 + > drivers/power/battery/Makefile | 1 + > drivers/power/battery/bat_trats2.c | 65 + > drivers/power/mfd/Makefile | 33 +++ > drivers/power/mfd/fg_max77693.c| 139 ++ > drivers/power/mfd/muic_max77693.c | 77 ++ > drivers/power/mfd/pmic_max77693.c | 96 +++ > include/configs/trats2.h | 311 ++ > include/power/max77693_fg.h| 49 > include/power/max77693_muic.h | 74 ++ > include/power/max77693_pmic.h | 43 15 files changed, 1449 > insertions(+) create mode 100644 board/samsung/trats2/Makefile > create mode 100644 board/samsung/trats2/trats2.c > create mode 100644 drivers/power/battery/bat_trats2.c > create mode 100644 drivers/power/mfd/Makefile > create mode 100644 drivers/power/mfd/fg_max77693.c > create mode 100644 drivers/power/mfd/muic_max77693.c > create mode 100644 drivers/power/mfd/pmic_max77693.c > create mode 100644 include/configs/trats2.h > create mode 100644 include/power/max77693_fg.h > create mode 100644 include/power/max77693_muic.h > create mode 100644 include/power/max77693_pmic.h Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [ANN] Release slightly delayed
Hey all, Since I've pushed the nand PR today, and I see a few other patches in patchwork that we need to get to avoid regressions, I'm going to push the release out a few days (thinking Wednesday currently). We'll lengthen the merge window slightly and cut one of the early on -rc's a bit early in the next window to get us back on track. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Hi Måns, On Mon, 14 Oct 2013 15:09:39 +0100, Måns Rullgård wrote: > Albert ARIBAUD writes: > > > Hi Måns, > > > > On Mon, 14 Oct 2013 14:05:13 +0100, Måns Rullgård > > wrote: > > > >> Albert ARIBAUD writes: > >> > >> >> > Please do not advise using native unaligned accesses on code that is > >> >> > not strictly used by ARMv6+ architectures: the present code, for > >> >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, > >> >> > should never assume ability to perform unaligned accesses natively. > >> >> > >> >> I'm advising no such thing. I said two things: > >> >> > >> >> 1. Declaring a struct with the 'packed' attribute makes gcc > >> >> automatically generate correct code for all targets. _IF_ the > >> >> selected target supports unaligned ldr/str, these might get used. > >> >> > >> >> 2. If your target is ARMv6 or later _AND_ you enable strict alignment > >> >> checking in the system control register, you _MUST_ build with the > >> >> -mno-unaligned-access flag. > >> > > >> > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > >> > support unaligned addresses unless this is explicitly disabled in > >> > the system control register" as a suggestion to use that capability. > >> > >> If building for ARMv6 or later, I do suggest allowing unaligned > >> accesses. The moment you add -march=armv6 (or equivalent), you allow > >> for a number of things not supported by older versions, so why not > >> unaligned memory accesses? > > > > doc/README.arm-unaligned-accesses probably has the answer to your > > question, especially from line 21 onward. If not, I'll be happy to > > provide further clarification. > > That is about as backwards as it can get. By adding -munaligned-access > you are telling gcc that unaligned accesses are supported and welcome. > With this setting enabled, gcc can and will generate unaligned accesses > just about anywhere. This setting is NOT compatible with the SCTRL.A > bit being set (strict hardware alignment checking). > > You cannot enable strict alignment checking in hardware, tell the > compiler unaligned accesses are OK, and then expect not to have > problems. This is no more a valid combination than allowing > floating-point instructions when the target has no FPU. I sense that you have not understood the reason why I want alignment checking enabled in ARM yet also want ARMv6+ builds to emit native unaligned accesses if they consider it needed. The reason is, if we prevent ARMv6 builds from using native unaligned accesses, they would replace *all* such accesses with smaller, aligned, ones, which would not trigger a data abort; even those unaligned accesses cased by programming errors. Whereas if we allow ARMv6+ builds to use native unaligned accesses, yet enable alignment checks, then any native unaligned access will be caught as early as possible, and we'll find and cure the issue faster. This is, of course, assuming we don't voluntarily do native unaligned accesses, and in U-Boot, we indeed don't: in U-Boot, accesses are done on natural alignments. Since I have set up this policy, experience (and it has been a while) shows that very few problems arise from alignment checks + native unaligned accesses. These roughly come from hardware- or standards- mandated unaligned fields, in which case they are worth explicitly accessing with "unaligned" macros, or from programming errors, which should be fixed. Another benefit of it is, if the code builds and runs in mainline with alignment checks *and* native unaligned accesses enabled, then it builds and runs also if you disable either one; whereas code that builds and runs with alignment checks or native unaligned accesses disabled might fail if both are enabled. And I don't see what we would gain by going from a strict "natural alignment only" policy to a relaxed "unalignment allowed" one. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request: nand flash
On Wed, Oct 09, 2013 at 01:29:55PM -0500, Scott Wood wrote: > Sorry for the lateness, but here are some MTD/UBI bugfixes. They've > been acked by Stefan Roese. > > The following changes since commit b770e88a6c2548727f0d57a3e9e8bb0830f977b5: > > Fix number base handling of "load" command (2013-10-07 15:54:18 -0400) > > are available in the git repository at: > > git://git.denx.de/u-boot-nand-flash.git master > > for you to fetch changes up to cc734f5ab26134e5e8d57c34edc257c89ac5b1d2: > > cmd_ubi: add write.part command, to write a volume in multiple parts > (2013-10-09 12:52:22 -0500) > > > Paul Burton (4): > mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN > cmd_mtdparts: use 64 bits for flash size, partition size & offset > cmd_ubi: use int64_t volume size for 'ubi create' > cmd_ubi: add write.part command, to write a volume in multiple parts > > common/cmd_mtdparts.c | 54 ++ > common/cmd_ubi.c | 79 > +++--- > doc/README.ubi | 3 ++ > drivers/mtd/mtdcore.c | 14 ++- > drivers/mtd/mtdpart.c | 12 +++--- > drivers/mtd/nand/nand_base.c | 18 +++-- > drivers/mtd/onenand/onenand_base.c | 3 +- > include/jffs2/load_kernel.h| 6 +-- > include/linux/mtd/nand.h | 3 ++ > 9 files changed, 129 insertions(+), 63 deletions(-) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Makefile: Introduce ARCH_PLATFORM_LIBGCC variable
On Sat, Oct 12, 2013 at 09:43:33AM +0200, Albert ARIBAUD wrote: > Hi Tom, > > On Fri, 11 Oct 2013 16:13:03 -0400, Tom Rini wrote: > > > In some cases, such as arm multi-lib hardfloat (hf) toolchains, we will > > have multiple libgcc.a's available, and the arch needs to provide > > additional logic to determine the right file to use > > (-print-libgcc-file-name contains no CFLAG parsing logic). > > > > Cc: Albert Aribaud > > Signed-off-by: Tom Rini > > --- > > Makefile |4 > > arch/arm/config.mk | 11 +++ > > 2 files changed, 15 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index b09bfcc..13b396f 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -357,8 +357,12 @@ else > > PLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc > > endif > > else > > +ifneq ("$(ARCH_PLATFORM_LIBGCC)","") > > +PLATFORM_LIBGCC := -L $(shell dirname $(ARCH_PLATFORM_LIBGCC)) -lgcc > > +else > > PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(CFLAGS) > > -print-libgcc-file-name`) -lgcc > > endif > > +endif > > PLATFORM_LIBS += $(PLATFORM_LIBGCC) > > export PLATFORM_LIBS > > > > diff --git a/arch/arm/config.mk b/arch/arm/config.mk > > index d0cf43f..e1d0dec 100644 > > --- a/arch/arm/config.mk > > +++ b/arch/arm/config.mk > > @@ -19,6 +19,17 @@ LDFLAGS_FINAL += --gc-sections > > PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \ > > -fno-common -ffixed-r9 -msoft-float > > > > +# > > +# When we use a hardfp toolchain if there are both 'libgcc.a' (hardfp) and > > +# 'arm-linux-gnueabi/libgcc.a' (softfp) we need to use the latter. We > > +# cannot always build with a hardfp-only toolchain. > > What does this last sentence mean exactly? What it says. If a hardfp only toolchain is used certain targets shall not link. I had Marek confirm this as well. I don't have the exact logs handy, but today there's a few targets that will fail, and the nand flash patchset introduces another because we enforce -msoft-float on U-Boot, and rely on libgcc from the toolchain for certain functions (__udivdi3 for example). I don't know how you weren't making this fail on ELDK 5.x armv7a-fp, but I was and the Linaro 2013.03 toolchain also will show this problem. Once I push the nand PR (shortly), building for am3517_crane for example will fail without this patch. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Hi Piotr, On Mon, 14 Oct 2013 15:49:43 +0200, Piotr Wilczek wrote: > Dear Albert and Måns, > > > -Original Message- > > From: Måns Rullgård [mailto:m...@mansr.com] > > Sent: Monday, October 14, 2013 3:05 PM > > To: Albert ARIBAUD > > Cc: Piotr Wilczek; 'Tom Rini'; u-boot@lists.denx.de; 'Kyungmin Park' > > Subject: Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi > > partition > > > > Albert ARIBAUD writes: > > > > >> > Please do not advise using native unaligned accesses on code that > > >> > is not strictly used by ARMv6+ architectures: the present code, > > for > > >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and > > thus, > > >> > should never assume ability to perform unaligned accesses > > natively. > > >> > > >> I'm advising no such thing. I said two things: > > >> > > >> 1. Declaring a struct with the 'packed' attribute makes gcc > > >> automatically generate correct code for all targets. _IF_ the > > >> selected target supports unaligned ldr/str, these might get > > used. > > >> > > >> 2. If your target is ARMv6 or later _AND_ you enable strict > > alignment > > >> checking in the system control register, you _MUST_ build with > > the > > >> -mno-unaligned-access flag. > > > > > > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > > > support unaligned addresses unless this is explicitly disabled in the > > > system control register" as a suggestion to use that capability. > > > > If building for ARMv6 or later, I do suggest allowing unaligned > > accesses. The moment you add -march=armv6 (or equivalent), you allow > > for a number of things not supported by older versions, so why not > > unaligned memory accesses? > > > > Thank you for your comments, I will follow your advice. I will NAK building part_efi.c with options to allow native unaligned access. I will, OTOH, be ok with explicit unaligned reads/writes. > Best regards > Piotr Wilczek Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Albert ARIBAUD writes: > Hi Måns, > > On Mon, 14 Oct 2013 14:05:13 +0100, Måns Rullgård > wrote: > >> Albert ARIBAUD writes: >> >> >> > Please do not advise using native unaligned accesses on code that is >> >> > not strictly used by ARMv6+ architectures: the present code, for >> >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, >> >> > should never assume ability to perform unaligned accesses natively. >> >> >> >> I'm advising no such thing. I said two things: >> >> >> >> 1. Declaring a struct with the 'packed' attribute makes gcc >> >> automatically generate correct code for all targets. _IF_ the >> >> selected target supports unaligned ldr/str, these might get used. >> >> >> >> 2. If your target is ARMv6 or later _AND_ you enable strict alignment >> >> checking in the system control register, you _MUST_ build with the >> >> -mno-unaligned-access flag. >> > >> > Then I apologize; I had read "Note that on ARMv6 and later ldr/str >> > support unaligned addresses unless this is explicitly disabled in >> > the system control register" as a suggestion to use that capability. >> >> If building for ARMv6 or later, I do suggest allowing unaligned >> accesses. The moment you add -march=armv6 (or equivalent), you allow >> for a number of things not supported by older versions, so why not >> unaligned memory accesses? > > doc/README.arm-unaligned-accesses probably has the answer to your > question, especially from line 21 onward. If not, I'll be happy to > provide further clarification. That is about as backwards as it can get. By adding -munaligned-access you are telling gcc that unaligned accesses are supported and welcome. With this setting enabled, gcc can and will generate unaligned accesses just about anywhere. This setting is NOT compatible with the SCTRL.A bit being set (strict hardware alignment checking). You cannot enable strict alignment checking in hardware, tell the compiler unaligned accesses are OK, and then expect not to have problems. This is no more a valid combination than allowing floating-point instructions when the target has no FPU. -- Måns Rullgård m...@mansr.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Dear Albert and Måns, > -Original Message- > From: Måns Rullgård [mailto:m...@mansr.com] > Sent: Monday, October 14, 2013 3:05 PM > To: Albert ARIBAUD > Cc: Piotr Wilczek; 'Tom Rini'; u-boot@lists.denx.de; 'Kyungmin Park' > Subject: Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi > partition > > Albert ARIBAUD writes: > > >> > Please do not advise using native unaligned accesses on code that > >> > is not strictly used by ARMv6+ architectures: the present code, > for > >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and > thus, > >> > should never assume ability to perform unaligned accesses > natively. > >> > >> I'm advising no such thing. I said two things: > >> > >> 1. Declaring a struct with the 'packed' attribute makes gcc > >> automatically generate correct code for all targets. _IF_ the > >> selected target supports unaligned ldr/str, these might get > used. > >> > >> 2. If your target is ARMv6 or later _AND_ you enable strict > alignment > >> checking in the system control register, you _MUST_ build with > the > >> -mno-unaligned-access flag. > > > > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > > support unaligned addresses unless this is explicitly disabled in the > > system control register" as a suggestion to use that capability. > > If building for ARMv6 or later, I do suggest allowing unaligned > accesses. The moment you add -march=armv6 (or equivalent), you allow > for a number of things not supported by older versions, so why not > unaligned memory accesses? > Thank you for your comments, I will follow your advice. Best regards Piotr Wilczek > -- > Måns Rullgård > m...@mansr.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Hi Måns, On Mon, 14 Oct 2013 14:05:13 +0100, Måns Rullgård wrote: > Albert ARIBAUD writes: > > >> > Please do not advise using native unaligned accesses on code that is > >> > not strictly used by ARMv6+ architectures: the present code, for > >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, > >> > should never assume ability to perform unaligned accesses natively. > >> > >> I'm advising no such thing. I said two things: > >> > >> 1. Declaring a struct with the 'packed' attribute makes gcc > >> automatically generate correct code for all targets. _IF_ the > >> selected target supports unaligned ldr/str, these might get used. > >> > >> 2. If your target is ARMv6 or later _AND_ you enable strict alignment > >> checking in the system control register, you _MUST_ build with the > >> -mno-unaligned-access flag. > > > > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > > support unaligned addresses unless this is explicitly disabled in > > the system control register" as a suggestion to use that capability. > > If building for ARMv6 or later, I do suggest allowing unaligned > accesses. The moment you add -march=armv6 (or equivalent), you allow > for a number of things not supported by older versions, so why not > unaligned memory accesses? doc/README.arm-unaligned-accesses probably has the answer to your question, especially from line 21 onward. If not, I'll be happy to provide further clarification. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4] socfpga: Adding Freeze Controller driver
Adding Freeze Controller driver. All HPS IOs need to be in freeze state during pin mux or IO buffer configuration. It is to avoid any glitch which might happen during the configuration from propagating to external devices. Signed-off-by: Chin Liang See Cc: Wolfgang Denk CC: Pavel Machek Cc: Dinh Nguyen Cc: Tom Rini Cc: Albert Aribaud --- Changes for v4 - Removed additional lines - Single function call to freeze and thaw all channels Changes for v3 - Removed unused macro in freeze_controller.h Changes for v2 - Removed FREEZE_CONTROLLER_FSM_HW - Removed the get_timer_count_masked and convert to use delay in us - Used shorter local variables --- arch/arm/cpu/armv7/socfpga/Makefile|2 +- arch/arm/cpu/armv7/socfpga/freeze_controller.c | 216 arch/arm/cpu/armv7/socfpga/spl.c |9 + .../include/asm/arch-socfpga/freeze_controller.h | 50 + 4 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 arch/arm/cpu/armv7/socfpga/freeze_controller.c create mode 100644 arch/arm/include/asm/arch-socfpga/freeze_controller.h diff --git a/arch/arm/cpu/armv7/socfpga/Makefile b/arch/arm/cpu/armv7/socfpga/Makefile index 0859e44..10d20f2 100644 --- a/arch/arm/cpu/armv7/socfpga/Makefile +++ b/arch/arm/cpu/armv7/socfpga/Makefile @@ -14,7 +14,7 @@ LIB = $(obj)lib$(SOC).o SOBJS := lowlevel_init.o COBJS-y:= misc.o timer.o reset_manager.o system_manager.o -COBJS-$(CONFIG_SPL_BUILD) += spl.o +COBJS-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o COBJS := $(COBJS-y) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) diff --git a/arch/arm/cpu/armv7/socfpga/freeze_controller.c b/arch/arm/cpu/armv7/socfpga/freeze_controller.c new file mode 100644 index 000..330b4aa --- /dev/null +++ b/arch/arm/cpu/armv7/socfpga/freeze_controller.c @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2013 Altera Corporation + * + * SPDX-License-Identifier:GPL-2.0+ + */ + + +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +static const struct socfpga_freeze_controller *freeze_controller_base = + (void *)(SOCFPGA_SYSMGR_ADDRESS + SYSMGR_FRZCTRL_ADDRESS); + +/* + * Default state from cold reset is FREEZE_ALL; the global + * flag is set to TRUE to indicate the IO banks are frozen + */ +static uint32_t frzctrl_channel_freeze[FREEZE_CHANNEL_NUM] + = { FREEZE_CTRL_FROZEN, FREEZE_CTRL_FROZEN, + FREEZE_CTRL_FROZEN, FREEZE_CTRL_FROZEN}; + +/* Freeze HPS IOs */ +void sys_mgr_frzctrl_freeze_req(void) +{ + u32 ioctrl_reg_offset; + u32 reg_value; + u32 reg_cfg_mask; + u32 channel_id; + + /* select software FSM */ + writel(SYSMGR_FRZCTRL_SRC_VIO1_ENUM_SW, &freeze_controller_base->src); + + /* Freeze channel 0 to 2 */ + for (channel_id = 0; channel_id <= 2; channel_id++) { + ioctrl_reg_offset = (u32)( + &freeze_controller_base->vioctrl + + (channel_id << SYSMGR_FRZCTRL_VIOCTRL_SHIFT)); + + /* +* Assert active low enrnsl, plniotri +* and niotri signals +*/ + reg_cfg_mask = + SYSMGR_FRZCTRL_VIOCTRL_SLEW_MASK + | SYSMGR_FRZCTRL_VIOCTRL_WKPULLUP_MASK + | SYSMGR_FRZCTRL_VIOCTRL_TRISTATE_MASK; + clrbits_le32(ioctrl_reg_offset, reg_cfg_mask); + + /* +* Note: Delay for 20ns at min +* Assert active low bhniotri signal and de-assert +* active high csrdone +*/ + reg_cfg_mask + = SYSMGR_FRZCTRL_VIOCTRL_BUSHOLD_MASK + | SYSMGR_FRZCTRL_VIOCTRL_CFG_MASK; + clrbits_le32(ioctrl_reg_offset, reg_cfg_mask); + + /* Set global flag to indicate channel is frozen */ + frzctrl_channel_freeze[channel_id] = FREEZE_CTRL_FROZEN; + } + + /* Freeze channel 3 */ + /* +* Assert active low enrnsl, plniotri and +* niotri signals +*/ + reg_cfg_mask + = SYSMGR_FRZCTRL_HIOCTRL_SLEW_MASK + | SYSMGR_FRZCTRL_HIOCTRL_WKPULLUP_MASK + | SYSMGR_FRZCTRL_HIOCTRL_TRISTATE_MASK; + clrbits_le32(&freeze_controller_base->hioctrl, reg_cfg_mask); + + /* +* assert active low bhniotri & nfrzdrv signals, +* de-assert active high csrdone and assert +* active high frzreg and nfrzdrv signals +*/ + reg_value = readl(&freeze_controller_base->hioctrl); + reg_cfg_mask + = SYSMGR_FRZCTRL_HIOCTRL_BUSHOLD_MASK + | SYSMGR_FRZCTRL_HIOCTRL_CFG_MASK; + reg_value + = (reg_value & ~reg_cfg_mask) + | SYSMGR_FRZCTRL_HIOCTRL_REGRST_MASK + | SYSMGR_FRZCTRL_HIOCTRL_OCTRST_MASK; + writel(reg_value, &freeze_controller_base->hioctrl
Re: [U-Boot] [PATCH 2/3] lcd: add DataImage SCF0403x LCD panel support
Hi Nikita, On 10/09/13 16:46, Nikita Kiryanov wrote: > Add SPI-based driver for DataImage SCF0403852GGU04 and SCF0403526GGU20 > LCD panels. > > Cc: Tom Rini > Cc: Anatolij Gustschin > Cc: Igor Grinberg > Signed-off-by: Nikita Kiryanov > --- > drivers/video/Makefile | 1 + > drivers/video/scf0403_lcd.c | 298 > > include/scf0403_lcd.h | 22 > include/spi.h | 1 + > 4 files changed, 322 insertions(+) > create mode 100644 drivers/video/scf0403_lcd.c > create mode 100644 include/scf0403_lcd.h [...] > diff --git a/drivers/video/scf0403_lcd.c b/drivers/video/scf0403_lcd.c > new file mode 100644 > index 000..1d1c3ff > --- /dev/null > +++ b/drivers/video/scf0403_lcd.c > @@ -0,0 +1,298 @@ [...] > +static void scf0403_gpio_reset(unsigned int gpio) > +{ > + if (!gpio_is_valid(gpio)) > + return; > + > + gpio_set_value(gpio, 1); > + mdelay(100); > + gpio_set_value(gpio, 0); > + mdelay(40); > + gpio_set_value(gpio, 1); > + mdelay(100); > +} [...] > +int scf0403_init(int reset_gpio) > +{ > + int error; > + > + if (!gpio_is_valid(reset_gpio)) { > + printf("scf0403 reset_gpio not valid\n"); > + return -1; The LCD reset pin does not have to be connected to a GPIO. Instead, it can be handled in another manner (e.g. by hardware). So, I don't think you should fail the LCD initialization if some kind of -EINVAL is passed. > + } > + > + priv.reset_gpio = reset_gpio; > + error = scf0403_request_reset_gpio(reset_gpio); > + if (error) { > + printf("Failed requesting reset GPIO%d: %d\n", > +reset_gpio, error); > + return error; > + } > + > + priv.spi = spi_setup_slave(3, 0, 100, SPI_MODE_0); > + error = spi_claim_bus(priv.spi); > + if (error) { > + gpio_free(priv.reset_gpio); > + return error; > + } > + > + /* reset LCD */ > + scf0403_gpio_reset(reset_gpio); > + > + error = scf0403_spi_read_rddid(priv.spi, &priv.rddid); > + if (error) { > + printf("IDs read failed\n"); > + gpio_free(priv.reset_gpio); > + spi_release_bus(priv.spi); > + > + return error; > + } > + > + if (priv.rddid == SCF0403852GGU04_ID) { > + priv.init_seq = scf0403_initseq_sn04; > + priv.seq_size = ARRAY_SIZE(scf0403_initseq_sn04); > + } else { > + priv.init_seq = scf0403_initseq_sn20; > + priv.seq_size = ARRAY_SIZE(scf0403_initseq_sn20); > + } > + > + scf0403_lcd_init(&priv); > + > + /* Start operation */ > + scf0403_spi_transfer(priv.spi, &scf0403_cmd_dison); > + mdelay(100); > + scf0403_spi_transfer(priv.spi, &scf0403_cmd_slpout); > + spi_release_bus(priv.spi); > + > + return 0; > +} [...] > diff --git a/include/spi.h b/include/spi.h > index ae318ff..4441527 100644 > --- a/include/spi.h > +++ b/include/spi.h > @@ -27,6 +27,7 @@ > /* SPI transfer flags */ > #define SPI_XFER_BEGIN 0x01/* Assert CS before > transfer */ > #define SPI_XFER_END 0x02/* Deassert CS after transfer */ > +#define SPI_XFER_ONCE(SPI_XFER_BEGIN | SPI_XFER_END) This bit does not belong to the patch. > > /* Header byte that marks the start of the message */ > #define SPI_PREAMBLE_END_BYTE0xec > -- Regards, Igor. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] spi: omap3: add support for more word lengths
Hi Nikita, On 10/09/13 16:46, Nikita Kiryanov wrote: > Current implementation only supports 8 bit word lengths, even though > omap3 can handle anything between 4 and 32. > > Update the spi interface to support changing the SPI word length, > and implement it in omap3_spi driver to support the full range of > possible word lengths. > This implementation is backwards compatible by defaulting to the old > behavior of 8 bit word lengths. > Also, it required a change to the omap3_spi non static I/O functions, > but since they are not used anywhere else, no collateral changes are required. > > Cc: Tom Rini > Cc: Igor Grinberg > Cc: Jagannadha Sutradharudu Teki > Signed-off-by: Nikita Kiryanov > --- > drivers/spi/omap3_spi.c | 78 > ++--- > drivers/spi/omap3_spi.h | 11 --- > include/spi.h | 13 + > 3 files changed, 81 insertions(+), 21 deletions(-) > > diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c > index 6bac245..add98e1 100644 > --- a/drivers/spi/omap3_spi.c > +++ b/drivers/spi/omap3_spi.c > @@ -20,7 +20,7 @@ > #include > #include "omap3_spi.h" > > -#define WORD_LEN 8 > +#define SPI_DEFAULT_WORDLEN 8; As already pointed out, the semicolon should not be there... > #define SPI_WAIT_TIMEOUT 300; While at this, can you please, send a separate patch to fix the above semicolon? > > static void spi_reset(struct omap3_spi_slave *ds) > @@ -128,10 +128,32 @@ struct spi_slave *spi_setup_slave(unsigned int bus, > unsigned int cs, > ds->regs = regs; > ds->freq = max_hz; > ds->mode = mode; > + ds->wordlen = SPI_DEFAULT_WORDLEN; While we know, OMAP SPI controller supports this, I think many other controllers can also support this feature and thus their drivers can benefit from this option. Wouldn't it be better to add the wordlen field to the generic slave structure instead of the OMAP specific structure? > > return &ds->slave; > } > > +int spi_set_wordlen(struct spi_slave *slave, unsigned int wordlen) > +{ > + struct omap3_spi_slave *ds; > + int chconf; > + > + if (wordlen < 4 || wordlen > 32) { > + printf("SPI error: unsupported wordlen %d\n", wordlen); > + return -1; > + } > + > + ds = to_omap3_spi(slave); > + ds->wordlen = wordlen; > + > + chconf = readl(&ds->regs->channel[ds->slave.cs].chconf); > + chconf &= ~OMAP3_MCSPI_CHCONF_WL_MASK; > + chconf |= (wordlen - 1) << 7; > + omap3_spi_write_chconf(ds, chconf); I would recommend to update the controller just before the transaction takes place, e.g. in spi_xfer() function, so the spi_set_wordlen() function will only update the slave structure and will not touch the hardware. Thus spi_set_wordlen() can be placed in the generic SPI code. > + > + return 0; > +} > + > void spi_free_slave(struct spi_slave *slave) > { > struct omap3_spi_slave *ds = to_omap3_spi(slave); > @@ -185,7 +207,7 @@ int spi_claim_bus(struct spi_slave *slave) > > /* wordlength */ > conf &= ~OMAP3_MCSPI_CHCONF_WL_MASK; > - conf |= (WORD_LEN - 1) << 7; > + conf |= (ds->wordlen - 1) << 7; > > /* set chipselect polarity; manage with FORCE */ > if (!(ds->mode & SPI_CS_HIGH)) > @@ -223,7 +245,7 @@ void spi_release_bus(struct spi_slave *slave) > spi_reset(ds); > } > > -int omap3_spi_write(struct spi_slave *slave, unsigned int len, const u8 *txp, > +int omap3_spi_write(struct spi_slave *slave, unsigned int len, const void > *txp, > unsigned long flags) > { > struct omap3_spi_slave *ds = to_omap3_spi(slave); > @@ -250,7 +272,13 @@ int omap3_spi_write(struct spi_slave *slave, unsigned > int len, const u8 *txp, > } > } > /* Write the data */ > - writel(txp[i], &ds->regs->channel[ds->slave.cs].tx); > + unsigned int *tx = &ds->regs->channel[ds->slave.cs].tx; > + if (ds->wordlen > 16) > + writel(((u32 *)txp)[i], tx); > + else if (ds->wordlen > 8) > + writel(((u16 *)txp)[i], tx); > + else > + writel(((u8 *)txp)[i], tx); Can we always have u32 for the txp and use masks ans shifts instead of the ugly castings? > } > > /* wait to finish of transfer */ > @@ -268,7 +296,7 @@ int omap3_spi_write(struct spi_slave *slave, unsigned int > len, const u8 *txp, > return 0; > } > > -int omap3_spi_read(struct spi_slave *slave, unsigned int len, u8 *rxp, > +int omap3_spi_read(struct spi_slave *slave, unsigned int len, void *rxp, > unsigned long flags) > { > struct omap3_spi_slave *ds = to_omap3_spi(slave); > @@ -302,7 +330,13 @@ int omap3_spi_read(struct spi_slave *slave, unsigned int > len, u8 *rxp, > omap3_spi_set_enable(ds,OMAP3_MCSPI_CHCTRL_DIS); > > /* Read the data */ > -
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Albert ARIBAUD writes: >> > Please do not advise using native unaligned accesses on code that is >> > not strictly used by ARMv6+ architectures: the present code, for >> > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, >> > should never assume ability to perform unaligned accesses natively. >> >> I'm advising no such thing. I said two things: >> >> 1. Declaring a struct with the 'packed' attribute makes gcc >> automatically generate correct code for all targets. _IF_ the >> selected target supports unaligned ldr/str, these might get used. >> >> 2. If your target is ARMv6 or later _AND_ you enable strict alignment >> checking in the system control register, you _MUST_ build with the >> -mno-unaligned-access flag. > > Then I apologize; I had read "Note that on ARMv6 and later ldr/str > support unaligned addresses unless this is explicitly disabled in > the system control register" as a suggestion to use that capability. If building for ARMv6 or later, I do suggest allowing unaligned accesses. The moment you add -march=armv6 (or equivalent), you allow for a number of things not supported by older versions, so why not unaligned memory accesses? -- Måns Rullgård m...@mansr.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Hi Måns, On Mon, 14 Oct 2013 13:19:27 +0100, Måns Rullgård wrote: > Albert ARIBAUD writes: > > > Hi Måns, > > > > On Mon, 14 Oct 2013 11:50:42 +0100, Måns Rullgård > > wrote: > > > >> Piotr Wilczek writes: > >> > >> >> -Original Message- > >> >> From: Måns Rullgård [mailto:m...@mansr.com] > >> >> Sent: Saturday, October 12, 2013 1:29 AM > >> >> To: Piotr Wilczek > >> >> Cc: u-boot@lists.denx.de; Tom Rini; Kyungmin Park > >> >> Subject: Re: [PATCH] disk:efi: avoid unaligned access on efi partition > >> >> > >> >> Piotr Wilczek writes: > >> >> > >> >> > In this patch static variable and memcpy instead of an assignment are > >> >> > used to avoid unaligned access exception on some ARM platforms. > >> >> > > >> >> > Signed-off-by: Piotr Wilczek > >> >> > Signed-off-by: Kyungmin Park > >> >> > CC: Tom Rini > >> >> > --- > >> >> > disk/part_efi.c |6 -- > >> >> > 1 file changed, 4 insertions(+), 2 deletions(-) > >> >> > > >> >> > diff --git a/disk/part_efi.c b/disk/part_efi.c index b7524d6..303b8af > >> >> > 100644 > >> >> > --- a/disk/part_efi.c > >> >> > +++ b/disk/part_efi.c > >> >> > @@ -224,7 +224,8 @@ static int set_protective_mbr(block_dev_desc_t > >> >> *dev_desc) > >> >> > p_mbr->signature = MSDOS_MBR_SIGNATURE; > >> >> > p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; > >> >> > p_mbr->partition_record[0].start_sect = 1; > >> >> > - p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba; > >> >> > + memcpy(&p_mbr->partition_record[0].nr_sects, &dev_desc->lba, > >> >> > +sizeof(dev_desc->lba)); > >> >> > >> >> Why is this assignment problematic? Note that the compiler may > >> >> optimise the memcpy() call into a plain assignment including any > >> >> alignment assumptions it was making in the original code. > >> >> > >> >> The correct fix is either to ensure that pointers are properly aligned > >> >> or that things are annotated as potentially unaligned, whichever is > >> >> more appropriate. > >> >> > >> > Problem is that the legacy_mbr structure consists 'le16 unknown' > >> > field before 'partition_record' filed and the structure is > >> > packed. As a result the address of 'partition_record' filed is > >> > halfword aligned. The compiler uses str/ldr instructions (address > >> > must be 4-byte aligned) to copy u32 'lba' data thus causing > >> > unaligned access exception. > >> > >> If the struct has __attribute__((packed)), gcc should do the right thing > >> already. Note that on ARMv6 and later ldr/str support unaligned > >> addresses unless this is explicitly disabled in the system control > >> register. If you do this, you _MUST_ compile with -mno-unaligned-access. > >> Otherwise you will get problems. > > > > Please do not advise using native unaligned accesses on code that is > > not strictly used by ARMv6+ architectures: the present code, for > > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, > > should never assume ability to perform unaligned accesses natively. > > I'm advising no such thing. I said two things: > > 1. Declaring a struct with the 'packed' attribute makes gcc > automatically generate correct code for all targets. _IF_ the > selected target supports unaligned ldr/str, these might get used. > > 2. If your target is ARMv6 or later _AND_ you enable strict alignment > checking in the system control register, you _MUST_ build with the > -mno-unaligned-access flag. Then I apologize; I had read "Note that on ARMv6 and later ldr/str support unaligned addresses unless this is explicitly disabled in the system control register" as a suggestion to use that capability. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Albert ARIBAUD writes: > Hi Måns, > > On Mon, 14 Oct 2013 11:50:42 +0100, Måns Rullgård > wrote: > >> Piotr Wilczek writes: >> >> >> -Original Message- >> >> From: Måns Rullgård [mailto:m...@mansr.com] >> >> Sent: Saturday, October 12, 2013 1:29 AM >> >> To: Piotr Wilczek >> >> Cc: u-boot@lists.denx.de; Tom Rini; Kyungmin Park >> >> Subject: Re: [PATCH] disk:efi: avoid unaligned access on efi partition >> >> >> >> Piotr Wilczek writes: >> >> >> >> > In this patch static variable and memcpy instead of an assignment are >> >> > used to avoid unaligned access exception on some ARM platforms. >> >> > >> >> > Signed-off-by: Piotr Wilczek >> >> > Signed-off-by: Kyungmin Park >> >> > CC: Tom Rini >> >> > --- >> >> > disk/part_efi.c |6 -- >> >> > 1 file changed, 4 insertions(+), 2 deletions(-) >> >> > >> >> > diff --git a/disk/part_efi.c b/disk/part_efi.c index b7524d6..303b8af >> >> > 100644 >> >> > --- a/disk/part_efi.c >> >> > +++ b/disk/part_efi.c >> >> > @@ -224,7 +224,8 @@ static int set_protective_mbr(block_dev_desc_t >> >> *dev_desc) >> >> > p_mbr->signature = MSDOS_MBR_SIGNATURE; >> >> > p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; >> >> > p_mbr->partition_record[0].start_sect = 1; >> >> > - p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba; >> >> > + memcpy(&p_mbr->partition_record[0].nr_sects, &dev_desc->lba, >> >> > + sizeof(dev_desc->lba)); >> >> >> >> Why is this assignment problematic? Note that the compiler may >> >> optimise the memcpy() call into a plain assignment including any >> >> alignment assumptions it was making in the original code. >> >> >> >> The correct fix is either to ensure that pointers are properly aligned >> >> or that things are annotated as potentially unaligned, whichever is >> >> more appropriate. >> >> >> > Problem is that the legacy_mbr structure consists 'le16 unknown' >> > field before 'partition_record' filed and the structure is >> > packed. As a result the address of 'partition_record' filed is >> > halfword aligned. The compiler uses str/ldr instructions (address >> > must be 4-byte aligned) to copy u32 'lba' data thus causing >> > unaligned access exception. >> >> If the struct has __attribute__((packed)), gcc should do the right thing >> already. Note that on ARMv6 and later ldr/str support unaligned >> addresses unless this is explicitly disabled in the system control >> register. If you do this, you _MUST_ compile with -mno-unaligned-access. >> Otherwise you will get problems. > > Please do not advise using native unaligned accesses on code that is > not strictly used by ARMv6+ architectures: the present code, for > instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, > should never assume ability to perform unaligned accesses natively. I'm advising no such thing. I said two things: 1. Declaring a struct with the 'packed' attribute makes gcc automatically generate correct code for all targets. _IF_ the selected target supports unaligned ldr/str, these might get used. 2. If your target is ARMv6 or later _AND_ you enable strict alignment checking in the system control register, you _MUST_ build with the -mno-unaligned-access flag. -- Måns Rullgård m...@mansr.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Handling hangs (was: [PATCH v1] arm: remove unneeded symbol offsets and _TEXT_BASE)
> Depends. You may want the log to o as faithful a state dump as feasible. "...to *do* as faithful..." Apologies, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Hi Måns, On Mon, 14 Oct 2013 11:50:42 +0100, Måns Rullgård wrote: > Piotr Wilczek writes: > > >> -Original Message- > >> From: Måns Rullgård [mailto:m...@mansr.com] > >> Sent: Saturday, October 12, 2013 1:29 AM > >> To: Piotr Wilczek > >> Cc: u-boot@lists.denx.de; Tom Rini; Kyungmin Park > >> Subject: Re: [PATCH] disk:efi: avoid unaligned access on efi partition > >> > >> Piotr Wilczek writes: > >> > >> > In this patch static variable and memcpy instead of an assignment are > >> > used to avoid unaligned access exception on some ARM platforms. > >> > > >> > Signed-off-by: Piotr Wilczek > >> > Signed-off-by: Kyungmin Park > >> > CC: Tom Rini > >> > --- > >> > disk/part_efi.c |6 -- > >> > 1 file changed, 4 insertions(+), 2 deletions(-) > >> > > >> > diff --git a/disk/part_efi.c b/disk/part_efi.c index b7524d6..303b8af > >> > 100644 > >> > --- a/disk/part_efi.c > >> > +++ b/disk/part_efi.c > >> > @@ -224,7 +224,8 @@ static int set_protective_mbr(block_dev_desc_t > >> *dev_desc) > >> > p_mbr->signature = MSDOS_MBR_SIGNATURE; > >> > p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; > >> > p_mbr->partition_record[0].start_sect = 1; > >> > -p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba; > >> > +memcpy(&p_mbr->partition_record[0].nr_sects, &dev_desc->lba, > >> > + sizeof(dev_desc->lba)); > >> > >> Why is this assignment problematic? Note that the compiler may > >> optimise the memcpy() call into a plain assignment including any > >> alignment assumptions it was making in the original code. > >> > >> The correct fix is either to ensure that pointers are properly aligned > >> or that things are annotated as potentially unaligned, whichever is > >> more appropriate. > >> > > Problem is that the legacy_mbr structure consists 'le16 unknown' field > > before 'partition_record' filed and the structure is packed. As a result the > > address of 'partition_record' filed is halfword aligned. The compiler uses > > str/ldr instructions (address must be 4-byte aligned) to copy u32 'lba' data > > thus causing unaligned access exception. > > If the struct has __attribute__((packed)), gcc should do the right thing > already. Note that on ARMv6 and later ldr/str support unaligned > addresses unless this is explicitly disabled in the system control > register. If you do this, you _MUST_ compile with -mno-unaligned-access. > Otherwise you will get problems. Please do not advise using native unaligned accesses on code that is not strictly used by ARMv6+ architectures: the present code, for instance, might be run on pre-ARMv6 or non-ARM platforms, and thus, should never assume ability to perform unaligned accesses natively. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Handling hangs (was: [PATCH v1] arm: remove unneeded symbol offsets and _TEXT_BASE)
Hi Benoît, On Mon, 14 Oct 2013 12:22:31 +0200 (CEST), Benoît Thébaudeau wrote: > Hi Albert, > > On Monday, October 14, 2013 8:59:17 AM, Albert ARIBAUD wrote: > > On Sun, 13 Oct 2013 19:16:33 +0200, Albert ARIBAUD > > wrote: > > > > > Hi Benoît, > > > > > > On Sun, 13 Oct 2013 17:00:25 +0200 (CEST), Benoît Thébaudeau > > > wrote: > > > > > > > Hi Albert, > > > > > > > > On Sunday, October 13, 2013 9:10:28 AM, Albert ARIBAUD wrote: > > > > > Remove the last uses of symbol offsets in ARM U-Boot. > > > > > Remove some needless uses of _TEXT_BASE. > > > > > Remove all _TEXT_BASE definitions. > > > > > > > > > > Signed-off-by: Albert ARIBAUD > > > > > --- > > > > > _TEXT_BASE was only used by ARM to allow resolution of > > > > > symbol offsets, themselves only needed due to absolute > > > > > relocations. > > > > > > > > > > In some places, _TEXT_BASE was locally defined only > > > > > to provide a literal for CONFIG_SYS_TEXT_BASE when the > > > > > latter could have been used directly. > > > > > > > > > > Sometimes even, _TEXT_BASE was defined but unused. > > > > > > > > > > Since all relocations in ARM are relative, offsets, > > > > > _TEXT_BASE and CONFIG_SYS_SYM_OFFSETS can be completely > > > > > removed, and their uses can be replaced with adequate > > > > > use of compiler-generated symbols from sections.c file. > > > > > > > > [...] > > > > > > > > > diff --git a/arch/arm/cpu/arm1136/start.S > > > > > b/arch/arm/cpu/arm1136/start.S > > > > > index bd1e067..d15124b 100644 > > > > > --- a/arch/arm/cpu/arm1136/start.S > > > > > +++ b/arch/arm/cpu/arm1136/start.S > > > > > > > > [...] > > > > > > > > > @@ -295,7 +269,6 @@ cpu_init_crit: > > > > > #ifdef CONFIG_SPL_BUILD > > > > > .align 5 > > > > > do_hang: > > > > > - ldr sp, _TEXT_BASE /* use 32 words about > > > > > stack */ > > > > > bl hang/* hang and never > > > > > return */ > > > > > #else/* !CONFIG_SPL_BUILD */ > > > > > .align 5 > > > > > > > > Is this change (and the same change in the other start.S files) safe? > > > > > > > > lib/hang.c/hang() may need a valid stack pointer because the functions > > > > that it > > > > calls may use the stack. > > > > > > > > When the CPU lands in do_hang, it's because some exception occurred, > > > > which may > > > > follow a situation having corrupted sp. If sp is corrupted, the CPU > > > > won't > > > > be > > > > able to push the exception context onto the stack, but it might still be > > > > able to > > > > run the exception vector. > > > > > > > > Setting sp to *_TEXT_BASE was not great, but at least this provided a > > > > few > > > > valid > > > > words of RAM for the stack. > > > > > > Yes, there is a call to hang() which might or might not imply saving on > > > the stack depending on code generation, and sp might be incorrect > > > depending on the exception raised. I'll reintroduce the sp setting but > > > use the runtime value of _start as stack top. As you say, not great but > > > hey. > > > > Thinking further about hangs: when we call do_hang(), by definition we > > are in a critical situation where for some reason we cannot proceed > > any more; and in the worst scenario, the only guaranteed valid register > > we have is pc. Therefore, I'm not sure it is wise to try to do anything > > else than actually hanging. > > > > OTOH, I do understand that we may also want to do something else > > than hanging, such as trying to diagnose, but we should choose more > > clearly: > > > > - either we hang for the purpose of being post-mortem-debugged from > > there, and therefore, we limit alterations to the system state as > > much as we can, by only affecting pc (to the point that 'bl hang' > > should be turned into 'b do_hang' so that lr is also preserved); > > > > - or we want e.g. to tell the operator about it, and we make sure we > > have a correct setting, that is, we reserve and use a proper stack > > rather than set it just below _start and hope for luck. > > > > Choosing between one or the other would be done through a configuration > > option such as for instance CONFIG_SYS_LOG_HANGS. > > > > Regarding the stack, we could use some existing exception stack, but it > > might be better if it was preserved, so that its contents could be > > looked into. > > > > Comments? > > This configuration option would be great. The verbose log should be enabled by > default, indicating the configuration option to change in order to investigate > the hang. I suspect some people would argue that for SPL, the default should be to hang rather than log. > In the log case, we care about having a valid stack, not about preserving the > possible exception stack contents. In the post-mortem debug case, this is the > opposite. Depends. You may want the log to o as faithful a state dump as feasible. > Best regards, > Benoît Amicalement, -- Albert. ___
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
Piotr Wilczek writes: >> -Original Message- >> From: Måns Rullgård [mailto:m...@mansr.com] >> Sent: Saturday, October 12, 2013 1:29 AM >> To: Piotr Wilczek >> Cc: u-boot@lists.denx.de; Tom Rini; Kyungmin Park >> Subject: Re: [PATCH] disk:efi: avoid unaligned access on efi partition >> >> Piotr Wilczek writes: >> >> > In this patch static variable and memcpy instead of an assignment are >> > used to avoid unaligned access exception on some ARM platforms. >> > >> > Signed-off-by: Piotr Wilczek >> > Signed-off-by: Kyungmin Park >> > CC: Tom Rini >> > --- >> > disk/part_efi.c |6 -- >> > 1 file changed, 4 insertions(+), 2 deletions(-) >> > >> > diff --git a/disk/part_efi.c b/disk/part_efi.c index b7524d6..303b8af >> > 100644 >> > --- a/disk/part_efi.c >> > +++ b/disk/part_efi.c >> > @@ -224,7 +224,8 @@ static int set_protective_mbr(block_dev_desc_t >> *dev_desc) >> >p_mbr->signature = MSDOS_MBR_SIGNATURE; >> >p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; >> >p_mbr->partition_record[0].start_sect = 1; >> > - p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba; >> > + memcpy(&p_mbr->partition_record[0].nr_sects, &dev_desc->lba, >> > + sizeof(dev_desc->lba)); >> >> Why is this assignment problematic? Note that the compiler may >> optimise the memcpy() call into a plain assignment including any >> alignment assumptions it was making in the original code. >> >> The correct fix is either to ensure that pointers are properly aligned >> or that things are annotated as potentially unaligned, whichever is >> more appropriate. >> > Problem is that the legacy_mbr structure consists 'le16 unknown' field > before 'partition_record' filed and the structure is packed. As a result the > address of 'partition_record' filed is halfword aligned. The compiler uses > str/ldr instructions (address must be 4-byte aligned) to copy u32 'lba' data > thus causing unaligned access exception. If the struct has __attribute__((packed)), gcc should do the right thing already. Note that on ARMv6 and later ldr/str support unaligned addresses unless this is explicitly disabled in the system control register. If you do this, you _MUST_ compile with -mno-unaligned-access. Otherwise you will get problems. -- Måns Rullgård m...@mansr.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request for u-boot-marvell.git
> -Original Message- > From: Holger Brunck [mailto:holger.bru...@keymile.com] > Sent: 10 October 2013 22:37 > To: Prafulla Wadaskar > Cc: Albert ARIBAUD; 'u-boot@lists.denx.de'; Manas > Saksena > Subject: Re: Pull request for u-boot-marvell.git > > On 10/07/2013 02:58 PM, Prafulla Wadaskar wrote: > > > > > >> -Original Message- > >> From: Holger Brunck > [mailto:holger.bru...@keymile.com] > >> Sent: 07 October 2013 12:48 > >> To: Prafulla Wadaskar > >> Cc: Albert ARIBAUD; 'u-boot@lists.denx.de'; Manas > >> Saksena > >> Subject: Re: Pull request for u-boot-marvell.git > >> > >> Hi, > >> > >> On 10/02/2013 02:51 PM, Albert ARIBAUD wrote: > >>> Hi Prafulla, > >>> > >>> On Wed, 25 Sep 2013 04:20:24 -0700, Prafulla > Wadaskar > >>> wrote: > >>> > Hi Albert, > Please kindly pull > The following changes since commit > >> 12eba1b49380988fd87cc0b3af44014cca8b71c4: > Jeroen Hofstee (1): > README: update ARM register usage > > are available in the git repository at: > > u-boot-marvell.git master branch. > > Holger Brunck (2): > arm/km: drop unneeded define > arm/km: make local function startup_allowed > >> static > > Karlheinz Jerg (1): > arm/km: add support for km_kirkwood_128m16 > >> board > > board/keymile/km_arm/km_arm.c |6 +- > boards.cfg|1 + > include/configs/km_kirkwood.h | 10 ++ > 3 files changed, 12 insertions(+), 5 deletions(-) > > Regards... > Prafulla . . . > >>> > >>> For km_kirkwood_128m16: > >>> > >>> ../common/ivm.c: In function 'ivm_read_eeprom': > >>> ../common/ivm.c:304:18: error: 'CONFIG_KM_IVM_BUS' > >> undeclared (first > >>> use in this function) ../common/ivm.c:304:18: note: > >> each undeclared > >>> identifier is reported only once for each function > it > >> appears in > >>> make[1]: *** > >>> [/home/albert/src/u-boot- > >> > arm/build/km_kirkwood_128m16/board/keymile/km_arm/../co > >> mmon/ivm.o] > >>> Error 1 make: *** > >>> [/home/albert/src/u-boot- > >> > arm/build/km_kirkwood_128m16/board/keymile/km_arm/libkm > >> _arm.o] > >>> Error 2 > >> > >> ok there is some interdependency with Heikos i2c mux > >> rework. > >> > >> Prafulla should I send a patch on top of your branch > >> which fixes this or should > >> I send a v3 of the whole patch? > > > > Please send the patch to fix this issue on the top of > branch. > > > > done three days ago. So could you please pick it up and > send Albert a new pull > request? Surely I will be doing the same. Regards... Prafulla . . . ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Handling hangs (was: [PATCH v1] arm: remove unneeded symbol offsets and _TEXT_BASE)
Hi Albert, On Monday, October 14, 2013 8:59:17 AM, Albert ARIBAUD wrote: > On Sun, 13 Oct 2013 19:16:33 +0200, Albert ARIBAUD > wrote: > > > Hi Benoît, > > > > On Sun, 13 Oct 2013 17:00:25 +0200 (CEST), Benoît Thébaudeau > > wrote: > > > > > Hi Albert, > > > > > > On Sunday, October 13, 2013 9:10:28 AM, Albert ARIBAUD wrote: > > > > Remove the last uses of symbol offsets in ARM U-Boot. > > > > Remove some needless uses of _TEXT_BASE. > > > > Remove all _TEXT_BASE definitions. > > > > > > > > Signed-off-by: Albert ARIBAUD > > > > --- > > > > _TEXT_BASE was only used by ARM to allow resolution of > > > > symbol offsets, themselves only needed due to absolute > > > > relocations. > > > > > > > > In some places, _TEXT_BASE was locally defined only > > > > to provide a literal for CONFIG_SYS_TEXT_BASE when the > > > > latter could have been used directly. > > > > > > > > Sometimes even, _TEXT_BASE was defined but unused. > > > > > > > > Since all relocations in ARM are relative, offsets, > > > > _TEXT_BASE and CONFIG_SYS_SYM_OFFSETS can be completely > > > > removed, and their uses can be replaced with adequate > > > > use of compiler-generated symbols from sections.c file. > > > > > > [...] > > > > > > > diff --git a/arch/arm/cpu/arm1136/start.S > > > > b/arch/arm/cpu/arm1136/start.S > > > > index bd1e067..d15124b 100644 > > > > --- a/arch/arm/cpu/arm1136/start.S > > > > +++ b/arch/arm/cpu/arm1136/start.S > > > > > > [...] > > > > > > > @@ -295,7 +269,6 @@ cpu_init_crit: > > > > #ifdef CONFIG_SPL_BUILD > > > > .align 5 > > > > do_hang: > > > > - ldr sp, _TEXT_BASE /* use 32 words about > > > > stack */ > > > > bl hang/* hang and never > > > > return */ > > > > #else /* !CONFIG_SPL_BUILD */ > > > > .align 5 > > > > > > Is this change (and the same change in the other start.S files) safe? > > > > > > lib/hang.c/hang() may need a valid stack pointer because the functions > > > that it > > > calls may use the stack. > > > > > > When the CPU lands in do_hang, it's because some exception occurred, > > > which may > > > follow a situation having corrupted sp. If sp is corrupted, the CPU won't > > > be > > > able to push the exception context onto the stack, but it might still be > > > able to > > > run the exception vector. > > > > > > Setting sp to *_TEXT_BASE was not great, but at least this provided a few > > > valid > > > words of RAM for the stack. > > > > Yes, there is a call to hang() which might or might not imply saving on > > the stack depending on code generation, and sp might be incorrect > > depending on the exception raised. I'll reintroduce the sp setting but > > use the runtime value of _start as stack top. As you say, not great but > > hey. > > Thinking further about hangs: when we call do_hang(), by definition we > are in a critical situation where for some reason we cannot proceed > any more; and in the worst scenario, the only guaranteed valid register > we have is pc. Therefore, I'm not sure it is wise to try to do anything > else than actually hanging. > > OTOH, I do understand that we may also want to do something else > than hanging, such as trying to diagnose, but we should choose more > clearly: > > - either we hang for the purpose of being post-mortem-debugged from > there, and therefore, we limit alterations to the system state as > much as we can, by only affecting pc (to the point that 'bl hang' > should be turned into 'b do_hang' so that lr is also preserved); > > - or we want e.g. to tell the operator about it, and we make sure we > have a correct setting, that is, we reserve and use a proper stack > rather than set it just below _start and hope for luck. > > Choosing between one or the other would be done through a configuration > option such as for instance CONFIG_SYS_LOG_HANGS. > > Regarding the stack, we could use some existing exception stack, but it > might be better if it was preserved, so that its contents could be > looked into. > > Comments? This configuration option would be great. The verbose log should be enabled by default, indicating the configuration option to change in order to investigate the hang. In the log case, we care about having a valid stack, not about preserving the possible exception stack contents. In the post-mortem debug case, this is the opposite. Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3] cmd/gpt: Support gpt command for all devices
> -Original Message- > From: Egbert Eich [mailto:egbert.e...@gmail.com] > Sent: Sunday, October 13, 2013 1:14 AM > To: Piotr Wilczek > Cc: 'Egbert Eich'; u-boot@lists.denx.de; 'Tom Rini'; 'Egbert Eich' > Subject: Re: [Patch v3] cmd/gpt: Support gpt command for all devices > > On Fri, Oct 11, 2013 at 09:13:22AM +0200, Piotr Wilczek wrote: > > Dear Egbert Eich, > > > > > -Original Message- > > > From: Egbert Eich [mailto:egbert.e...@gmail.com] > > > Sent: Friday, October 04, 2013 6:53 PM > > > To: u-boot@lists.denx.de > > > Cc: Piotr Wilczek; Tom Rini; Egbert Eich; Egbert Eich > > > Subject: [Patch v3] cmd/gpt: Support gpt command for all devices > > > > > > From: Egbert Eich > > > > > > The gpt command was only implemented for mmc devices. There is no > > > reason why this command should not be generalized and be applied > all > > > other storage device classes. > > > This change both simplifies the implementation and eliminates a > > > build failure for systems that don't support mmcs. > > > > > > Signed-off-by: Egbert Eich > > > --- > > > Changes for v2: > > >- Coding style cleanup. > > > Changes for v3: > > >- Removed wrong '&' > > >- Removed unused variable > > >- Fixed argument checking > > >Spotted by Piotr Wilczek > > > > > > common/cmd_gpt.c | 45 +++- > - > > > 1 file changed, 19 insertions(+), 26 deletions(-) > > > > > > diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c index > > > a46f5cc..17b1180 > > > 100644 > > > --- a/common/cmd_gpt.c > > > +++ b/common/cmd_gpt.c > > [..] > > > > > > > @@ -287,27 +279,28 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, > > > int > > [..] > > > > - /* device: 'mmc' */ > > > - if (strcmp(argv[2], "mmc") == 0) { > > > - /* check if 'dev' is a number */ > > > - for (pstr = argv[3]; *pstr != '\0'; pstr++) > > > - if (!isdigit(*pstr)) { > > > - printf("'%s' is not a number\n", > > > - argv[3]); > > > - return CMD_RET_USAGE; > > > - } > > > - dev = (int)simple_strtoul(argv[3], NULL, 10); > > > - /* write to mmc */ > > > - if (gpt_mmc_default(dev, argv[4])) > > > - return CMD_RET_FAILURE; > > > + char *ep; > > > + block_dev_desc_t *blk_dev_desc; > > This probably should be at the beginning of the function > > I personally prefer to keep symbols as local as possible (ie. declare > them in the block they are used in if they are just used within a > single block) for the following rasons: > 1. It makes the code more readable ie. the definition is closeby to >the location where it is used and doesn't require scrolling to >the beginning of a function and the scope of the variable is is >much more obvious. > 2. The compiler can optimize much better as it knows that a variable >can be discarded at the end of the block also by reusing stack >slots stack sapce can be used much more efficiently by the compiler. > > I agree that in the case at hand the second argument is not too > relevant, it is more a coding style issue. If there is a coding style > requirement to have those definitions at the beginning of the function > I will create a new patch. > Agreed, I think it is a coding style rule in U-boot. Let the maintainer to decide. > > [..] > > > > + blk_dev_desc = get_dev(argv[2], dev); > > > + if (!blk_dev_desc) { > > > + printf("%s: %s dev %d NOT available\n", > > > +__func__, argv[2], dev); > > I think it is not necessary since the mmc subsystem prints 'MMC > Device > > not found'. > > I've done a quick look over the code - of all subsystems MMC seems to > be the only one which prints a message when its get_dev() method is > called but no device is found. Therefore I'd prefer to leave this > there. > Ok. > > > > Except minor comments this patch looks good to me. > > I tested it on mmc device (Trats2) and works well. > > Ok, thanks! > > > > > Tested-by: Piotr Wilczek > > > > Thanks a lot for testing! > > Cheers, > Egbert. Best regards, Piotr Wilczek ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Suggestion for building all boards
Hi Simon, On Fri, 11 Oct 2013 16:00:37 -0600, Simon Glass wrote: > Hi Masahiro, > > On Fri, Oct 11, 2013 at 5:29 AM, Masahiro Yamada > wrote: > > Hello experts, custodians. > > > > > To sum up my suggestion, > > > > - Collect pre-built suitable crosstools for all architectures > >on U-boot ftp site. > > Great idea. If you can organize a tarball (or more than one) and a > place to put it then we could make buildman fetch and setup > automatically. > > > > > - Check all boards automatically using those recommended > >crosstools and post the result to the mailing list. > > Would be very helpful. > > > > > - Add new status to boards.cfg to mark boards with a problem. > > This is for boards that are already broken I think. There is some discussion about the Status field in boards.cfg, which might result in moving it from its current "build/don't build" semantics into something more like "maintainers mentioned at the end are active / inactive, but the board still builds anyway". Still, boards.Cfg is for long-term board info, whereas the build breaks discussed here are short-term: if someone submits a patch which breaks some board, we don't apply it until there is a new version that fixes the break. Granted, we may detect board breaks after a patch is applied, but then we as the submitter to provide a separate fix patch within the same release cycle. Also, adding some "builds / doesn't build right now" info in boards.cfg will IMO cause either one of two bad side effects: an observable volume of patches submitted just to keep boards.cfg up to date wrt which board builds or not; or a burden to submitters whose patch (series) break or fix some board(s) and who would then have to also update boards.cfg with this. I don't think we want to ask any submitter to add this to their work, or even to build-test across all of U-Boot's boards to see if they're breaking some board they don't know in an architecture they know nothing about. That's for custodians to do, not for submitters. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] kirkwood: ib62x0: use device tree and update config
Hi Fabio, On Sun, Oct 13, 2013 at 11:41:44PM -0300, Fabio Estevam wrote: > On Sun, Oct 13, 2013 at 11:38 PM, Luka Perkov wrote: > > /* > > - * Machine type > > + * Enable device tree support > > */ > > -#define CONFIG_MACH_TYPE MACH_TYPE_NAS6210 > > +#define CONFIG_OF_LIBFDT > > I am not familiar with this platform, but couldn't you also keep > CONFIG_MACH_TYPE ? > > This way people have the option to load both dt and non-dt kernels. Upstream uses only DT. When uboot support was pushed we had non-DT kernel patches that were never merged upstream. IMO we should just drop CONFIG_MACH_TYPE and use CONFIG_OF_LIBFDT. Luka ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: mxs: Do not reconfigure FEC clock in FEC init
Hi Marek, On 13/10/2013 17:20, Marek Vasut wrote: > Do not reconfigure the FEC clock during board_eth_init(), otherwise > the FEC might have stability issues, refuse to autonegotiate link > entirely or even corrupt packets while indicating correct checksum > on them. Instead, move the FEC clock init to board_early_init_f(), > where all the other upstream clock are initialized and also make > sure there is proper stabilization delay. However, it seems to me that moving the code remove the problem on the mx28evk without finding the cause. Really there is still a big chunk of time between the initialization of the clock and the first packet is sent to the network, when the autonegotiation should occur. > > Signed-off-by: Marek Vasut > Cc: Fabio Estevam > Cc: Hector Palacios > Cc: Oliver Metz > Cc: Otavio Salvador > Cc: Stefano Babic > Cc: Tom Rini > --- > board/bluegiga/apx4devkit/apx4devkit.c | 10 -- > board/denx/m28evk/m28evk.c | 21 +++-- > board/freescale/mx28evk/mx28evk.c| 9 + > board/schulercontrol/sc_sps_1/sc_sps_1.c | 19 +++ > 4 files changed, 31 insertions(+), 28 deletions(-) > > NOTE: I'd like to get this into current release as it fixes a serious > issue I observe here on the MX28EVK (packets being corrupted on > long transfers initiated early after boot). Please test this and > report back ASAP. > > diff --git a/board/bluegiga/apx4devkit/apx4devkit.c > b/board/bluegiga/apx4devkit/apx4devkit.c > index 08e79bd..044a182 100644 > --- a/board/bluegiga/apx4devkit/apx4devkit.c > +++ b/board/bluegiga/apx4devkit/apx4devkit.c > @@ -39,6 +39,10 @@ int board_early_init_f(void) > /* SSP0 clock at 96MHz */ > mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); > > +#ifdef CONFIG_CMD_NET > + cpu_eth_init(NULL); > + udelay(1); > +#endif This looks like a hack... Calling cpu_eth_init() without parameters is absolutely an exception in u-boot, there is no other instance / SOC doing this. Are we sure that the issue you see on mx28evk are reproducible on the other boards ? You are starting to fix all boards, but you report corruption only on one board. > return 0; > } > > @@ -79,12 +83,6 @@ int board_eth_init(bd_t *bis) > int ret; > struct eth_device *dev; > > - ret = cpu_eth_init(bis); > - if (ret) { > - printf("FEC MXS: Unable to init FEC clocks\n"); > - return ret; > - } > - > ret = fecmxc_initialize(bis); > if (ret) { > printf("FEC MXS: Unable to init FEC\n"); > diff --git a/board/denx/m28evk/m28evk.c b/board/denx/m28evk/m28evk.c > index 33d38cf..5065ee8 100644 > --- a/board/denx/m28evk/m28evk.c > +++ b/board/denx/m28evk/m28evk.c > @@ -26,6 +26,9 @@ DECLARE_GLOBAL_DATA_PTR; > */ > int board_early_init_f(void) > { > + struct mxs_clkctrl_regs *clkctrl_regs = > + (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE; > + > /* IO0 clock at 480MHz */ > mxs_set_ioclk(MXC_IOCLK0, 48); > /* IO1 clock at 480MHz */ > @@ -36,6 +39,14 @@ int board_early_init_f(void) > /* SSP2 clock at 160MHz */ > mxs_set_sspclk(MXC_SSPCLK2, 16, 0); > > +#ifdef CONFIG_CMD_NET > + cpu_eth_init(NULL); > + clrsetbits_le32(&clkctrl_regs->hw_clkctrl_enet, > + CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN, > + CLKCTRL_ENET_TIME_SEL_RMII_CLK); > + udelay(1); It seems to me that the most obvious change is the 10mS delay you added after setting the clock. If we find that such delay is really necessary, should we not fix it insife the cpu_eth_init() else in all board initialization functions ? Best regards, Stefano Babic -- = DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] sf: add missing Atmel at25df321 spi flash support
Hi Jagan, On 10/14/2013 16:14, Jagan Teki wrote: On Sat, Oct 12, 2013 at 6:50 AM, Bo Shen wrote: Hi Jagan, Cc Tom. On 10/11/2013 09:24, Bo Shen wrote: Hi Jagan, On 10/10/2013 22:14, Jagan Teki wrote: Thanks for this. On Thu, Oct 10, 2013 at 10:37 AM, Bo Shen wrote: As the spi flash transfer to multiple parts, it is forgot to add Atmel AT25DF321 spi flash support, which broken several Atmel EK boards which this chip. So, add it Signed-off-by: Bo Shen --- drivers/mtd/spi/sf_probe.c |1 + 1 file changed, 1 insertion(+) If this patch not applied before release at Oct 14, it will make a regression for several Atmel EK boards boot from spi flash. Agreed, thanks for your concern. Would you please pick it before release? Yes, I will pick this. and will send one more pull request for cleanup, this should be part of. Thanks. Best Regards, Bo Shen ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] disk:efi: avoid unaligned access on efi partition
> -Original Message- > From: Måns Rullgård [mailto:m...@mansr.com] > Sent: Saturday, October 12, 2013 1:29 AM > To: Piotr Wilczek > Cc: u-boot@lists.denx.de; Tom Rini; Kyungmin Park > Subject: Re: [PATCH] disk:efi: avoid unaligned access on efi partition > > Piotr Wilczek writes: > > > In this patch static variable and memcpy instead of an assignment are > > used to avoid unaligned access exception on some ARM platforms. > > > > Signed-off-by: Piotr Wilczek > > Signed-off-by: Kyungmin Park > > CC: Tom Rini > > --- > > disk/part_efi.c |6 -- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/disk/part_efi.c b/disk/part_efi.c index b7524d6..303b8af > > 100644 > > --- a/disk/part_efi.c > > +++ b/disk/part_efi.c > > @@ -224,7 +224,8 @@ static int set_protective_mbr(block_dev_desc_t > *dev_desc) > > p_mbr->signature = MSDOS_MBR_SIGNATURE; > > p_mbr->partition_record[0].sys_ind = EFI_PMBR_OSTYPE_EFI_GPT; > > p_mbr->partition_record[0].start_sect = 1; > > - p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba; > > + memcpy(&p_mbr->partition_record[0].nr_sects, &dev_desc->lba, > > + sizeof(dev_desc->lba)); > > Why is this assignment problematic? Note that the compiler may > optimise the memcpy() call into a plain assignment including any > alignment assumptions it was making in the original code. > > The correct fix is either to ensure that pointers are properly aligned > or that things are annotated as potentially unaligned, whichever is > more appropriate. > Problem is that the legacy_mbr structure consists 'le16 unknown' field before 'partition_record' filed and the structure is packed. As a result the address of 'partition_record' filed is halfword aligned. The compiler uses str/ldr instructions (address must be 4-byte aligned) to copy u32 'lba' data thus causing unaligned access exception. The best option would be to rearrange field in the structure but for other reasons I cannot do that. I will use put/get_unaligned as Albert suggested. Best regards Piotr Wilczek > -- > Måns Rullgård > m...@mansr.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Fix: nommu I2C adapter relocation error
From: "Jens Scharsig (BuS Elektronik)" NoMMU systems have a access violation problem with i2c_reloc_fixup. Blame for it is a double relocation of the adapter itself. The i2c_adap_p is already relocated, if i2c_reloc_fixup is called. This patch removes the relocation of i2c_adap_p from i2c_reloc_fixup to fix this. Signed-off-by: Jens Scharsig (BuS Elektronik) --- drivers/i2c/i2c_core.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/i2c/i2c_core.c b/drivers/i2c/i2c_core.c index d1072e8..bb5d4db 100644 --- a/drivers/i2c/i2c_core.c +++ b/drivers/i2c/i2c_core.c @@ -53,10 +53,6 @@ void i2c_reloc_fixup(void) return; for (i = 0; i < max; i++) { - /* adapter itself */ - addr = (unsigned long)i2c_adap_p; - addr += gd->reloc_off; - i2c_adap_p = (struct i2c_adapter *)addr; /* i2c_init() */ addr = (unsigned long)i2c_adap_p->init; addr += gd->reloc_off; -- 1.8.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: mxs: Do not reconfigure FEC clock in FEC init
Dear Marek, On 10/13/2013 05:20 PM, Marek Vasut wrote: Do not reconfigure the FEC clock during board_eth_init(), otherwise the FEC might have stability issues, refuse to autonegotiate link entirely or even corrupt packets while indicating correct checksum on them. Instead, move the FEC clock init to board_early_init_f(), where all the other upstream clock are initialized and also make sure there is proper stabilization delay. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Hector Palacios Cc: Oliver Metz Cc: Otavio Salvador Cc: Stefano Babic Cc: Tom Rini --- board/bluegiga/apx4devkit/apx4devkit.c | 10 -- board/denx/m28evk/m28evk.c | 21 +++-- board/freescale/mx28evk/mx28evk.c| 9 + board/schulercontrol/sc_sps_1/sc_sps_1.c | 19 +++ 4 files changed, 31 insertions(+), 28 deletions(-) [...] diff --git a/board/freescale/mx28evk/mx28evk.c b/board/freescale/mx28evk/mx28evk.c index 5005fe2..2c93c44 100644 --- a/board/freescale/mx28evk/mx28evk.c +++ b/board/freescale/mx28evk/mx28evk.c @@ -41,6 +41,11 @@ int board_early_init_f(void) /* SSP2 clock at 160MHz */ mxs_set_sspclk(MXC_SSPCLK2, 16, 0); +#ifdef CONFIG_CMD_NET + cpu_eth_init(NULL); + udelay(1); +#endif + #ifdefCONFIG_CMD_USB mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); mxs_iomux_setup_pad(MX28_PAD_AUART2_RX__GPIO_3_8 | @@ -102,10 +107,6 @@ int board_eth_init(bd_t *bis) struct eth_device *dev; int ret; - ret = cpu_eth_init(bis); - if (ret) - return ret; - /* MX28EVK uses ENET_CLK PAD to drive FEC clock */ writel(CLKCTRL_ENET_TIME_SEL_RMII_CLK | CLKCTRL_ENET_CLK_OUT_EN, &clkctrl_regs->hw_clkctrl_enet); Why didn't you move the clk enable instruction on mx28evk, as you did with the rest of platforms? Best regards, -- Hector Palacios ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] sf: add missing Atmel at25df321 spi flash support
On Sat, Oct 12, 2013 at 6:50 AM, Bo Shen wrote: > Hi Jagan, > Cc Tom. > > > On 10/11/2013 09:24, Bo Shen wrote: >> >> Hi Jagan, >> >> On 10/10/2013 22:14, Jagan Teki wrote: >>> >>> Thanks for this. >>> >>> On Thu, Oct 10, 2013 at 10:37 AM, Bo Shen wrote: As the spi flash transfer to multiple parts, it is forgot to add Atmel AT25DF321 spi flash support, which broken several Atmel EK boards which this chip. So, add it Signed-off-by: Bo Shen --- drivers/mtd/spi/sf_probe.c |1 + 1 file changed, 1 insertion(+) > > > If this patch not applied before release at Oct 14, it will make a > regression for several Atmel EK boards boot from spi flash. Agreed, thanks for your concern. > > Would you please pick it before release? Yes, I will pick this. and will send one more pull request for cleanup, this should be part of. -- Thanks, Jagan. Jagannadha Sutradharudu Teki, E: jagannadh.t...@gmail.com, P: +91-9676773388 Engineer - System Software Hacker U-boot - SPI Custodian and Zynq APSOC Ln: http://www.linkedin.com/in/jaganteki ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 5/5] sf: probe: Add missing Atmel at25df321 flash
From: Bo Shen As the spi flash transfer to multiple parts, it is forgot to add Atmel AT25DF321 spi flash support, which broken several Atmel EK boards which this chip. So, add it Signed-off-by: Bo Shen --- Changes for v2: - none drivers/mtd/spi/sf_probe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index 633a6eb..5eb8ffe 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -46,6 +46,7 @@ static const struct spi_flash_params spi_flash_params_table[] = { {"AT45DB161D", 0x1f2600, 0x0, 64 * 1024,32, SECT_4K}, {"AT45DB321D", 0x1f2700, 0x0, 64 * 1024,64, SECT_4K}, {"AT45DB641D", 0x1f2800, 0x0, 64 * 1024, 128, SECT_4K}, + {"AT25DF321", 0x1f4701, 0x0, 64 * 1024,64, SECT_4K}, #endif #ifdef CONFIG_SPI_FLASH_EON/* EON */ {"EN25Q32B", 0x1c3016, 0x0, 64 * 1024,64, 0}, -- 1.8.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot