[U-Boot] Pull request: u-boot-sh/rmobile into u-boot-arm/master
Dear Albert Aribaud, Please pull u-boot-sh/rmobile into u-boot-arm/master. The following changes since commit c9aab0f9dd23fddcebf5984dc19e62b514e759a7: Merge branch 'u-boot-ti/master' into 'u-boot-arm/master' (2014-04-21 21:01:35 +0200) are available in the git repository at: git://git.denx.de/u-boot-sh.git rmobile for you to fetch changes up to 8d18bcfd439b8422ab3bada2001cc2abd525d9f8: arm: rmobile: lager: Remove MACH_TYPE_LAGER and CONFIG_MACH_TYPE (2014-04-28 04:35:12 +0900) Nobuhiro Iwamatsu (22): arm: rmobile: Coordinate the common part of the header file of r8a7790 and r8a7791 arm: rmobile: r8a779x: Fix L2 cache init and latency setting arm: rmobile: koelsch: Change name of structure arm: rmobile: koelsch: Remove NOR-Flash support arm: rmobile: lager: Change name of the structure arm: rmobile: lager: Remove NOR-Flash support arm: rmobile: Merge functions to get the CPU information of R8A7790 and R8A7791 arm: rmobile: Add 1 to value of the CPU revision in rmobile_get_cpu_rev_integer() arm: rmobile: Add rmobile_get_cpu_rev_fraction() for R-Car SoCs arm: rmobile: Add prototype for function to get the CPU information to rmobile.h arm: rmobile: Update print_cpuinfo function arm: rmobile: r8a7790: Add support ES2 revision arm: rmobile: r8a7791: Add support ES2 revision arm: rmobile: keolsch: Add support ES2 revision of R8A7791 arm: rmobile: lager: Update QoS initialization to version 0.955 arm: rmobile: koelsch: Update QoS initialization arm: rmobile: koelsch: Update calculation of CONFIG_SH_TMU_CLK_FREQ arm: rmobile: Add register infomation of PLL regsiter arm: rmobile: koelsch: Change to maximum CPU frequency arm: rmobile: lager: Update calculation of CONFIG_SH_TMU_CLK_FREQ arm: rmobile: lager: Change to maximum CPU frequency arm: rmobile: lager: Remove MACH_TYPE_LAGER and CONFIG_MACH_TYPE arch/arm/cpu/armv7/rmobile/Makefile| 4 +- arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c | 29 - .../{cpu_info-r8a7790.c = cpu_info-rcar.c}| 12 +- arch/arm/cpu/armv7/rmobile/cpu_info.c | 49 +- arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S| 20 +- arch/arm/include/asm/arch-rmobile/r8a7790.h| 609 +--- arch/arm/include/asm/arch-rmobile/r8a7791.h| 626 +--- arch/arm/include/asm/arch-rmobile/rcar-base.h | 637 + arch/arm/include/asm/arch-rmobile/rmobile.h| 6 + board/renesas/koelsch/koelsch.c| 194 +-- board/renesas/koelsch/qos.c| 404 +++-- board/renesas/lager/lager.c| 196 +-- board/renesas/lager/qos.c | 236 boards.cfg | 2 - include/configs/koelsch.h | 36 +- include/configs/lager.h| 40 +- 16 files changed, 1092 insertions(+), 2008 deletions(-) delete mode 100644 arch/arm/cpu/armv7/rmobile/cpu_info-r8a7791.c rename arch/arm/cpu/armv7/rmobile/{cpu_info-r8a7790.c = cpu_info-rcar.c} (50%) create mode 100644 arch/arm/include/asm/arch-rmobile/rcar-base.h -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request: u-boot-sh/master
Dear Tom Rini. Please pull u-boot-sh master branch. The following changes since commit 8854070784450f7ade382c5792b2721fbe27315a: Merge branch 'master' of git://www.denx.de/git/u-boot-arc (2014-04-25 15:08:43 -0400) are available in the git repository at: git://git.denx.de/u-boot-sh.git next for you to fetch changes up to 994b56616bae5bb3fab7122c0aeb346afbb12523: sh: delete an unused source file (2014-04-30 07:18:21 +0900) Masahiro Yamada (1): sh: delete an unused source file arch/sh/cpu/sh2/cache.c | 96 - 1 file changed, 96 deletions(-) delete mode 100644 arch/sh/cpu/sh2/cache.c -- Nobuhiro Iwamatsu iwamatsu at {nigauri.org / debian.org} GPG ID: 40AD1FA6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] wandboard: add Future Eletronics 7 WVGA LCD extension board
On Thu, May 1, 2014 at 5:16 PM, Otavio Salvador ota...@ossystems.com.br wrote: This adds support for the 7 WVGA produced by Future Eletronics and make it dynamically detect if it is connected or not based on the touchscreen controller. What kind of display is this? Parallel display or LVDS? -int board_video_skip(void) -{ - int ret; +static iomux_v3_cfg_t const fwadapt_7wvga_pads[] = { + MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK, + MX6_PAD_DI0_PIN2__IPU1_DI0_PIN02, /* HSync */ + MX6_PAD_DI0_PIN3__IPU1_DI0_PIN03, /* VSync */ + MX6_PAD_DI0_PIN4__IPU1_DI0_PIN04 + | MUX_PAD_CTRL(PAD_CTL_DSE_120ohm), /* Contrast */ + MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* DISP0_DRDY */ + + MX6_PAD_DISP0_DAT0__IPU1_DISP0_DATA00, + MX6_PAD_DISP0_DAT1__IPU1_DISP0_DATA01, + MX6_PAD_DISP0_DAT2__IPU1_DISP0_DATA02, + MX6_PAD_DISP0_DAT3__IPU1_DISP0_DATA03, + MX6_PAD_DISP0_DAT4__IPU1_DISP0_DATA04, + MX6_PAD_DISP0_DAT5__IPU1_DISP0_DATA05, + MX6_PAD_DISP0_DAT6__IPU1_DISP0_DATA06, + MX6_PAD_DISP0_DAT7__IPU1_DISP0_DATA07, + MX6_PAD_DISP0_DAT8__IPU1_DISP0_DATA08, + MX6_PAD_DISP0_DAT9__IPU1_DISP0_DATA09, + MX6_PAD_DISP0_DAT10__IPU1_DISP0_DATA10, + MX6_PAD_DISP0_DAT11__IPU1_DISP0_DATA11, + MX6_PAD_DISP0_DAT12__IPU1_DISP0_DATA12, + MX6_PAD_DISP0_DAT13__IPU1_DISP0_DATA13, + MX6_PAD_DISP0_DAT14__IPU1_DISP0_DATA14, + MX6_PAD_DISP0_DAT15__IPU1_DISP0_DATA15, + MX6_PAD_DISP0_DAT16__IPU1_DISP0_DATA16, + MX6_PAD_DISP0_DAT17__IPU1_DISP0_DATA17, It seems like this is a parallel display... static void setup_display(void) { struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; int reg; enable_ipu_clock(); imx_setup_hdmi(); + /* Turn on LDB0, LDB1, IPU,IPU DI0 clocks */ + reg = __raw_readl(mxc_ccm-CCGR3); + reg |= MXC_CCM_CCGR3_LDB_DI0_MASK | MXC_CCM_CCGR3_LDB_DI1_MASK; + writel(reg, mxc_ccm-CCGR3); ,but here you turn on the LDB clocks, why? + + /* set LDB0, LDB1 clk select to 011/011 */ + reg = readl(mxc_ccm-cs2cdr); + reg = ~(MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK +| MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK); + reg |= (3 MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_OFFSET) + | (3 MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET); + writel(reg, mxc_ccm-cs2cdr); + + reg = readl(mxc_ccm-cscmr2); + reg |= MXC_CCM_CSCMR2_LDB_DI0_IPU_DIV | MXC_CCM_CSCMR2_LDB_DI1_IPU_DIV; + writel(reg, mxc_ccm-cscmr2); + reg = readl(mxc_ccm-chsccdr); reg |= (CHSCCDR_CLK_SEL_LDB_DI0 MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET); + reg |= (CHSCCDR_CLK_SEL_LDB_DI0 +MXC_CCM_CHSCCDR_IPU1_DI1_CLK_SEL_OFFSET); writel(reg, mxc_ccm-chsccdr); + + reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES +| IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_LOW +| IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW +| IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG +| IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT +| IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG +| IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT +| IOMUXC_GPR2_LVDS_CH0_MODE_DISABLED +| IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0; + writel(reg, iomux-gpr[2]); + + reg = readl(iomux-gpr[3]); + reg = (reg ~(IOMUXC_GPR3_LVDS1_MUX_CTL_MASK + | IOMUXC_GPR3_HDMI_MUX_CTL_MASK)) + | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 + IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET); + writel(reg, iomux-gpr[3]); ,and also set a lot of LDB related registers. So I am confused here. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] wandboard: add Future Eletronics 7 WVGA LCD extension board
[Removing wandboard list, as it bounces when I reply to it] On Thu, May 1, 2014 at 5:16 PM, Otavio Salvador ota...@ossystems.com.br wrote: mmcargs=setenv bootargs console=${console},${baudrate} \ - root=${mmcroot}\0 \ + root=${mmcroot}; run videoargs\0 \ + videoargs= \ + setenv nextcon 0; \ + if hdmidet; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=hdmi,1280x720M@60, \ + if=RGB24; \ This video line is specific to some FSL kernel version. Mainline kernel does not need this, so I prefer not to pass such argument in the kernel command line. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] wandboard: add Future Eletronics 7 WVGA LCD extension board
On Thu, May 1, 2014 at 5:39 PM, Fabio Estevam feste...@gmail.com wrote: [Removing wandboard list, as it bounces when I reply to it] On Thu, May 1, 2014 at 5:16 PM, Otavio Salvador ota...@ossystems.com.br wrote: mmcargs=setenv bootargs console=${console},${baudrate} \ - root=${mmcroot}\0 \ + root=${mmcroot}; run videoargs\0 \ + videoargs= \ + setenv nextcon 0; \ + if hdmidet; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=hdmi,1280x720M@60, \ + if=RGB24; \ This video line is specific to some FSL kernel version. Mainline kernel does not need this, so I prefer not to pass such argument in the kernel command line. This works with Wandboard supported kernel and seems to be very widely used. I think it won't work in this user case. -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
On 05/01/2014 08:54 AM, Simon Glass wrote: Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. For what you have, I think CONFIG_SYS_EARLY_GLOBAL_DATA might be more descriptive. Also I think you should describe the purpose more precisely here - it's not just the use that you need to discuss. - The CPU init code must set it up and zero it - Then board_init_f() doesn't zero it Will add these. York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
On Thu, 2014-05-01 at 14:16 -0700, York Sun wrote: On 05/01/2014 08:54 AM, Simon Glass wrote: Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. Why wait to do it right? Which arches actually don't need this, given that Simon said he thinks ARM needs it as well? -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
On 05/01/2014 02:21 PM, Scott Wood wrote: On Thu, 2014-05-01 at 14:16 -0700, York Sun wrote: On 05/01/2014 08:54 AM, Simon Glass wrote: Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. Why wait to do it right? Which arches actually don't need this, given that Simon said he thinks ARM needs it as well? Adding something I can't test? Even Simon said he thinks ARM needs it, it is not what current code has. If I revert this logic, #ifdef CONFIG_SYS_GLOBAL_DATA_STACK gd_dt data; gd = data; zero_global_data(); #endif I need to add #define CONFIG_SYS_GLOBAL_DATA_STACK to the board/arch who needs it. I have no idea which needs in the 70+ boards with CONFIG_DISPLAY_BOARDINFO defined. York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] wandboard: add Future Eletronics 7 WVGA LCD extension board
This adds support for the 7 WVGA produced by Future Eletronics and make it dynamically detect if it is connected or not based on the touchscreen controller. Signed-off-by: Otavio Salvador ota...@ossystems.com.br --- Fabio, I haven't change the environment script as I consider important to have it working with Wandboard kernel. Please take a look and comment accordingly. Changes in v2: - Drop LDB related code (unused) board/wandboard/wandboard.c | 165 +--- include/configs/wandboard.h | 36 +- 2 files changed, 174 insertions(+), 27 deletions(-) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index f1951dc..d88e9b7 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Freescale Semiconductor, Inc. + * Copyright (C) 2014 O.S. Systems Software LTDA. * * Author: Fabio Estevam fabio.este...@freescale.com * @@ -15,18 +16,19 @@ #include asm/arch/sys_proto.h #include asm/gpio.h #include asm/imx-common/iomux-v3.h +#include asm/imx-common/mxc_i2c.h #include asm/imx-common/boot_mode.h +#include asm/imx-common/video.h #include asm/io.h #include linux/sizes.h #include common.h #include fsl_esdhc.h -#include ipu_pixfmt.h #include mmc.h #include miiphy.h #include netdev.h -#include linux/fb.h #include phy.h #include input.h +#include i2c.h DECLARE_GLOBAL_DATA_PTR; @@ -41,6 +43,10 @@ DECLARE_GLOBAL_DATA_PTR; #define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS) +#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ + PAD_CTL_ODE | PAD_CTL_SRE_FAST) + #define USDHC1_CD_GPIO IMX_GPIO_NR(1, 2) #define USDHC3_CD_GPIO IMX_GPIO_NR(3, 9) #define ETH_PHY_RESET IMX_GPIO_NR(3, 29) @@ -210,41 +216,124 @@ int board_phy_config(struct phy_device *phydev) } #if defined(CONFIG_VIDEO_IPUV3) -static struct fb_videomode const hdmi = { - .name = HDMI, - .refresh= 60, - .xres = 1024, - .yres = 768, - .pixclock = 15385, - .left_margin= 220, - .right_margin = 40, - .upper_margin = 21, - .lower_margin = 7, - .hsync_len = 60, - .vsync_len = 10, - .sync = FB_SYNC_EXT, - .vmode = FB_VMODE_NONINTERLACED +struct i2c_pads_info i2c2_pad_info = { + .scl = { + .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gp = IMX_GPIO_NR(4, 12) + }, + .sda = { + .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gp = IMX_GPIO_NR(4, 13) + } }; -int board_video_skip(void) -{ - int ret; +static iomux_v3_cfg_t const fwadapt_7wvga_pads[] = { + MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK, + MX6_PAD_DI0_PIN2__IPU1_DI0_PIN02, /* HSync */ + MX6_PAD_DI0_PIN3__IPU1_DI0_PIN03, /* VSync */ + MX6_PAD_DI0_PIN4__IPU1_DI0_PIN04 + | MUX_PAD_CTRL(PAD_CTL_DSE_120ohm), /* Contrast */ + MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* DISP0_DRDY */ + + MX6_PAD_DISP0_DAT0__IPU1_DISP0_DATA00, + MX6_PAD_DISP0_DAT1__IPU1_DISP0_DATA01, + MX6_PAD_DISP0_DAT2__IPU1_DISP0_DATA02, + MX6_PAD_DISP0_DAT3__IPU1_DISP0_DATA03, + MX6_PAD_DISP0_DAT4__IPU1_DISP0_DATA04, + MX6_PAD_DISP0_DAT5__IPU1_DISP0_DATA05, + MX6_PAD_DISP0_DAT6__IPU1_DISP0_DATA06, + MX6_PAD_DISP0_DAT7__IPU1_DISP0_DATA07, + MX6_PAD_DISP0_DAT8__IPU1_DISP0_DATA08, + MX6_PAD_DISP0_DAT9__IPU1_DISP0_DATA09, + MX6_PAD_DISP0_DAT10__IPU1_DISP0_DATA10, + MX6_PAD_DISP0_DAT11__IPU1_DISP0_DATA11, + MX6_PAD_DISP0_DAT12__IPU1_DISP0_DATA12, + MX6_PAD_DISP0_DAT13__IPU1_DISP0_DATA13, + MX6_PAD_DISP0_DAT14__IPU1_DISP0_DATA14, + MX6_PAD_DISP0_DAT15__IPU1_DISP0_DATA15, + MX6_PAD_DISP0_DAT16__IPU1_DISP0_DATA16, + MX6_PAD_DISP0_DAT17__IPU1_DISP0_DATA17, + + MX6_PAD_SD4_DAT2__GPIO2_IO10 + | MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_BKLEN */ + MX6_PAD_SD4_DAT3__GPIO2_IO11 + | MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_VDDEN */ +}; - ret = ipuv3_fb_init(hdmi, 0, IPU_PIX_FMT_RGB24); +static void do_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} - if (ret) { - printf(HDMI cannot be configured: %d\n, ret); - return ret; - } +static int detect_i2c(struct display_info_t const *dev) +{ + return (0 ==
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
On Thu, 2014-05-01 at 14:29 -0700, York Sun wrote: On 05/01/2014 02:21 PM, Scott Wood wrote: On Thu, 2014-05-01 at 14:16 -0700, York Sun wrote: On 05/01/2014 08:54 AM, Simon Glass wrote: Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. Why wait to do it right? Which arches actually don't need this, given that Simon said he thinks ARM needs it as well? Adding something I can't test? By that rationale nobody could ever make changes that aren't localized to a few boards. That type of development produces the sort of mess that the generic board is meant to remedy. Even Simon said he thinks ARM needs it, it is not what current code has. If I revert this logic, #ifdef CONFIG_SYS_GLOBAL_DATA_STACK This looks like a global stack of data, not global data on the stack. How about CONFIG_SYS_GENERIC_GLOBAL_DATA? gd_dt data; gd = data; zero_global_data(); #endif I need to add #define CONFIG_SYS_GLOBAL_DATA_STACK to the board/arch who needs it. I have no idea which needs in the 70+ boards with CONFIG_DISPLAY_BOARDINFO defined. I see only 10 boards that currently use CONFIG_SYS_GENERIC_BOARD in include/configs, plus sandbox and x86 which hide it in config.mk. I don't know what CONFIG_DISPLAY_BOARDINFO has to do with it. To invert the symbol, add the new symbol to all of the current users. Removal from ARM boards can come afterward if it's confirmed that it's the right thing to do. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] usb: ums: add error handling for failed registration
From: Stephen Warren swar...@nvidia.com Without this, if g_dnl_register() fails, the UMS code continues on blindly and crashes. This fix makes it simply print an error message instead. Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_usb_mass_storage.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c index d8d9efd4f62b..31b7eb0b57ef 100644 --- a/common/cmd_usb_mass_storage.c +++ b/common/cmd_usb_mass_storage.c @@ -40,7 +40,11 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, return CMD_RET_FAILURE; } - g_dnl_register(usb_dnl_ums); + rc = g_dnl_register(usb_dnl_ums); + if (rc) { + error(g_dnl_register failed); + return CMD_RET_FAILURE; + } /* Timeout unit: seconds */ int cable_ready_timeout = UMS_CABLE_READY_TIMEOUT; -- 1.8.1.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] USB: gadget: save driver name before registering it
From: Stephen Warren swar...@nvidia.com g_dnl_register() currently first attempts to register a composite driver by name, and then saves the driver name once it's registered. Internally to the registration code, g_dnl_do_config() is called and attempts to compare the composite device's name with the list of known device names. This fails since the composite device's name has not yet been stored. This means that the first time ums 0 0 is run, it fails, but subsequent attempts succeed. Re-order the name-saving and registration code to solve this. Fixes: e5b834e07f51 (USB: gadget: added a saner gadget downloader registration API) Signed-off-by: Stephen Warren swar...@nvidia.com --- This should likely be applied to u-boot-dfu/master along with Mateusz's original patch, or folded into it. drivers/usb/gadget/g_dnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index 743bae535ac8..25611acd607f 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -245,11 +245,12 @@ static struct usb_composite_driver g_dnl_driver = { */ int g_dnl_register(const char *name) { - int ret = usb_composite_register(g_dnl_driver); + int ret; debug(%s: g_dnl_driver.name = %s\n, __func__, name); g_dnl_driver.name = name; + ret = usb_composite_register(g_dnl_driver); if (ret) { printf(%s: failed!, error: %d\n, __func__, ret); return ret; -- 1.8.1.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] ums: move all variable declarations to the start of the block
On 05/01/2014 01:43 PM, Lukasz Majewski wrote: Hi Stephen, On 05/01/2014 04:51 AM, Marek Vasut wrote: On Wednesday, April 30, 2014 at 11:13:21 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com It's easier to assign values to the variables inside an if statement body if the assignment and declaration are separate. Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_usb_mass_storage.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) This doesn't apply on u-boot-usb/master, sorry. Is this the first patch in the series which doesn't apply? Did you apply any of the earlier patches? I guess I'll go try to rebase the series and find out myself... This is why we need a uboot-next just like linux-next, and stricter controls on which git repos take patches that touch subsystem code, to avoid cross-repo conflicts:-( +1 Yesterday Marek and I agreed that some patches regarding DFU and gadgets (patches 1 to 8) done by Mateusz: http://patchwork.ozlabs.org/patch/343517/ will be go through u-boot-dfu tree, which will be rebased on top of u-boot-usb tree. Afterwards I will send PR to Marek. Unfortunately I didn't manage to add them to u-boot-denx tree yesterday. I will do it on Monday as well as the review regarding your ums work. I hope, that you can wait until then. OK, that's fine. FWIW, I have applied that series locally and rebased my patches on top of it. If you want to see the latest version, feel free to look at: git://github.com/swarren/u-boot.git tegra_dev Note that branch gets rebased as I do local development. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] wandboard: add Future Eletronics 7 WVGA LCD extension board
On Thu, May 1, 2014 at 6:35 PM, Otavio Salvador ota...@ossystems.com.br wrote: static void setup_display(void) { struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; int reg; enable_ipu_clock(); @@ -254,6 +343,28 @@ static void setup_display(void) reg |= (CHSCCDR_CLK_SEL_LDB_DI0 MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET); writel(reg, mxc_ccm-chsccdr); + + reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES +| IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_LOW +| IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW +| IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG +| IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT +| IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG +| IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT +| IOMUXC_GPR2_LVDS_CH0_MODE_DISABLED +| IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0; + writel(reg, iomux-gpr[2]); This is all LVDS related and the LCD you are adding is not a LVDS. + + reg = readl(iomux-gpr[3]); + reg = (reg ~(IOMUXC_GPR3_LVDS1_MUX_CTL_MASK + | IOMUXC_GPR3_HDMI_MUX_CTL_MASK)) + | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 + IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET); + writel(reg, iomux-gpr[3]); Same here. #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S) #define CONFIG_DEFAULT_FDT_FILEimx6dl-wandboard.dtb @@ -152,7 +160,33 @@ fi; \ fi\0 \ mmcargs=setenv bootargs console=${console},${baudrate} \ - root=${mmcroot}\0 \ + root=${mmcroot}; run videoargs\0 \ + videoargs= \ + setenv nextcon 0; \ + if hdmidet; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=hdmi,1280x720M@60, \ + if=RGB24; \ This is unrelated to adding a LVDS display and would be better handled on a separate patch. + setenv fbmen fbmem=28M; \ + setexpr nextcon ${nextcon} + 1; \ + else \ + echo - no HDMI monitor; \ + fi; \ + i2c dev 1; \ + if i2c probe 0x10; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=lcd,800x480@60, \ + if=RGB666; \ + if test 0 -eq ${nextcon}; then \ + setenv fbmem fbmem=10M; \ + else \ + setenv fbmem ${fbmem},10M; \ + fi; \ + setexpr nextcon ${nextcon} + 1; \ + else \ + echo '- no FWBADAPT-7WVGA-LCD-F07A-0102 display'; \ + fi; \ + setenv bootargs ${bootargs} ${fbmem}\0 \ Changing the environment variables would be more appropriate on a separate patch, but still don't like the idea of hardcoding the video argument specific to a FSL kernel version. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
+Albert Hi, On 1 May 2014 15:41, Scott Wood scottw...@freescale.com wrote: On Thu, 2014-05-01 at 14:29 -0700, York Sun wrote: On 05/01/2014 02:21 PM, Scott Wood wrote: On Thu, 2014-05-01 at 14:16 -0700, York Sun wrote: On 05/01/2014 08:54 AM, Simon Glass wrote: Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. Why wait to do it right? Which arches actually don't need this, given that Simon said he thinks ARM needs it as well? Thanks for working on this, York. I looked at ARM and I think it is similar. See arch/arm/lib/crt0.S. It sets up gd - the only problem is that it does not zero the area unfortunately. But once that is added we can switch ARM over. Adding something I can't test? By that rationale nobody could ever make changes that aren't localized to a few boards. That type of development produces the sort of mess that the generic board is meant to remedy. Even Simon said he thinks ARM needs it, it is not what current code has. If I revert this logic, #ifdef CONFIG_SYS_GLOBAL_DATA_STACK This looks like a global stack of data, not global data on the stack. How about CONFIG_SYS_GENERIC_GLOBAL_DATA? gd_dt data; gd = data; zero_global_data(); #endif I need to add #define CONFIG_SYS_GLOBAL_DATA_STACK to the board/arch who needs it. I have no idea which needs in the 70+ boards with CONFIG_DISPLAY_BOARDINFO defined. I see only 10 boards that currently use CONFIG_SYS_GENERIC_BOARD in include/configs, plus sandbox and x86 which hide it in config.mk. I don't know what CONFIG_DISPLAY_BOARDINFO has to do with it. To invert the symbol, add the new symbol to all of the current users. Removal from ARM boards can come afterward if it's confirmed that it's the right thing to do. SGTM. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 1/2] wandboard: add Future Eletronics 7 WVGA LCD extension board
This adds support for the 7 WVGA produced by Future Eletronics and make it dynamically detect if it is connected or not based on the touchscreen controller. Signed-off-by: Otavio Salvador ota...@ossystems.com.br --- Changes in v3: - Drop LVDS related code (unused) Changes in v2: - Drop LDB related code (unused) board/wandboard/wandboard.c | 147 include/configs/wandboard.h | 7 +++ 2 files changed, 128 insertions(+), 26 deletions(-) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index f1951dc..311a442 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Freescale Semiconductor, Inc. + * Copyright (C) 2014 O.S. Systems Software LTDA. * * Author: Fabio Estevam fabio.este...@freescale.com * @@ -15,18 +16,19 @@ #include asm/arch/sys_proto.h #include asm/gpio.h #include asm/imx-common/iomux-v3.h +#include asm/imx-common/mxc_i2c.h #include asm/imx-common/boot_mode.h +#include asm/imx-common/video.h #include asm/io.h #include linux/sizes.h #include common.h #include fsl_esdhc.h -#include ipu_pixfmt.h #include mmc.h #include miiphy.h #include netdev.h -#include linux/fb.h #include phy.h #include input.h +#include i2c.h DECLARE_GLOBAL_DATA_PTR; @@ -41,6 +43,10 @@ DECLARE_GLOBAL_DATA_PTR; #define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS) +#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ + PAD_CTL_ODE | PAD_CTL_SRE_FAST) + #define USDHC1_CD_GPIO IMX_GPIO_NR(1, 2) #define USDHC3_CD_GPIO IMX_GPIO_NR(3, 9) #define ETH_PHY_RESET IMX_GPIO_NR(3, 29) @@ -210,41 +216,124 @@ int board_phy_config(struct phy_device *phydev) } #if defined(CONFIG_VIDEO_IPUV3) -static struct fb_videomode const hdmi = { - .name = HDMI, - .refresh= 60, - .xres = 1024, - .yres = 768, - .pixclock = 15385, - .left_margin= 220, - .right_margin = 40, - .upper_margin = 21, - .lower_margin = 7, - .hsync_len = 60, - .vsync_len = 10, - .sync = FB_SYNC_EXT, - .vmode = FB_VMODE_NONINTERLACED +struct i2c_pads_info i2c2_pad_info = { + .scl = { + .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gp = IMX_GPIO_NR(4, 12) + }, + .sda = { + .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gp = IMX_GPIO_NR(4, 13) + } }; -int board_video_skip(void) -{ - int ret; +static iomux_v3_cfg_t const fwadapt_7wvga_pads[] = { + MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK, + MX6_PAD_DI0_PIN2__IPU1_DI0_PIN02, /* HSync */ + MX6_PAD_DI0_PIN3__IPU1_DI0_PIN03, /* VSync */ + MX6_PAD_DI0_PIN4__IPU1_DI0_PIN04 + | MUX_PAD_CTRL(PAD_CTL_DSE_120ohm), /* Contrast */ + MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* DISP0_DRDY */ + + MX6_PAD_DISP0_DAT0__IPU1_DISP0_DATA00, + MX6_PAD_DISP0_DAT1__IPU1_DISP0_DATA01, + MX6_PAD_DISP0_DAT2__IPU1_DISP0_DATA02, + MX6_PAD_DISP0_DAT3__IPU1_DISP0_DATA03, + MX6_PAD_DISP0_DAT4__IPU1_DISP0_DATA04, + MX6_PAD_DISP0_DAT5__IPU1_DISP0_DATA05, + MX6_PAD_DISP0_DAT6__IPU1_DISP0_DATA06, + MX6_PAD_DISP0_DAT7__IPU1_DISP0_DATA07, + MX6_PAD_DISP0_DAT8__IPU1_DISP0_DATA08, + MX6_PAD_DISP0_DAT9__IPU1_DISP0_DATA09, + MX6_PAD_DISP0_DAT10__IPU1_DISP0_DATA10, + MX6_PAD_DISP0_DAT11__IPU1_DISP0_DATA11, + MX6_PAD_DISP0_DAT12__IPU1_DISP0_DATA12, + MX6_PAD_DISP0_DAT13__IPU1_DISP0_DATA13, + MX6_PAD_DISP0_DAT14__IPU1_DISP0_DATA14, + MX6_PAD_DISP0_DAT15__IPU1_DISP0_DATA15, + MX6_PAD_DISP0_DAT16__IPU1_DISP0_DATA16, + MX6_PAD_DISP0_DAT17__IPU1_DISP0_DATA17, + + MX6_PAD_SD4_DAT2__GPIO2_IO10 + | MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_BKLEN */ + MX6_PAD_SD4_DAT3__GPIO2_IO11 + | MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_VDDEN */ +}; - ret = ipuv3_fb_init(hdmi, 0, IPU_PIX_FMT_RGB24); +static void do_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} - if (ret) { - printf(HDMI cannot be configured: %d\n, ret); - return ret; - } +static int detect_i2c(struct display_info_t const *dev) +{ + return (0 == i2c_set_bus_num(dev-bus)) + (0 == i2c_probe(dev-addr)); +} - imx_enable_hdmi_phy(); +static void
[U-Boot] [PATCH v3 2/2] wandboard: Pass video kernel arguments for HDMI and LCD
This checks if the 7 WVGA produced by Future Eletronics is detected and pass the needed kernel arguments for it to work. Signed-off-by: Otavio Salvador ota...@ossystems.com.br --- Changes in v3: - New patch Changes in v2: None include/configs/wandboard.h | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h index 6defc00..ac78ede 100644 --- a/include/configs/wandboard.h +++ b/include/configs/wandboard.h @@ -121,6 +121,7 @@ #define CONFIG_VIDEO_LOGO #define CONFIG_VIDEO_BMP_LOGO #define CONFIG_IPUV3_CLK 26000 +#define CONFIG_CMD_HDMIDETECT #define CONFIG_IMX_HDMI #define CONFIG_IMX_VIDEO_SKIP @@ -159,7 +160,33 @@ fi; \ fi\0 \ mmcargs=setenv bootargs console=${console},${baudrate} \ - root=${mmcroot}\0 \ + root=${mmcroot}; run videoargs\0 \ + videoargs= \ + setenv nextcon 0; \ + if hdmidet; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=hdmi,1280x720M@60, \ + if=RGB24; \ + setenv fbmen fbmem=28M; \ + setexpr nextcon ${nextcon} + 1; \ + else \ + echo - no HDMI monitor; \ + fi; \ + i2c dev 1; \ + if i2c probe 0x10; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=lcd,800x480@60, \ + if=RGB666; \ + if test 0 -eq ${nextcon}; then \ + setenv fbmem fbmem=10M; \ + else \ + setenv fbmem ${fbmem},10M; \ + fi; \ + setexpr nextcon ${nextcon} + 1; \ + else \ + echo '- no FWBADAPT-7WVGA-LCD-F07A-0102 display'; \ + fi; \ + setenv bootargs ${bootargs} ${fbmem}\0 \ loadbootscript= \ fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0 \ bootscript=echo Running bootscript from mmc ...; \ -- 2.0.0.rc0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] wandboard: add Future Eletronics 7 WVGA LCD extension board
Hello Fabio, On Thu, May 1, 2014 at 6:48 PM, Fabio Estevam feste...@gmail.com wrote: On Thu, May 1, 2014 at 6:35 PM, Otavio Salvador ota...@ossystems.com.br wrote: static void setup_display(void) { struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; int reg; enable_ipu_clock(); @@ -254,6 +343,28 @@ static void setup_display(void) reg |= (CHSCCDR_CLK_SEL_LDB_DI0 MXC_CCM_CHSCCDR_IPU1_DI0_CLK_SEL_OFFSET); writel(reg, mxc_ccm-chsccdr); + + reg = IOMUXC_GPR2_BGREF_RRMODE_EXTERNAL_RES +| IOMUXC_GPR2_DI1_VS_POLARITY_ACTIVE_LOW +| IOMUXC_GPR2_DI0_VS_POLARITY_ACTIVE_LOW +| IOMUXC_GPR2_BIT_MAPPING_CH1_SPWG +| IOMUXC_GPR2_DATA_WIDTH_CH1_18BIT +| IOMUXC_GPR2_BIT_MAPPING_CH0_SPWG +| IOMUXC_GPR2_DATA_WIDTH_CH0_18BIT +| IOMUXC_GPR2_LVDS_CH0_MODE_DISABLED +| IOMUXC_GPR2_LVDS_CH1_MODE_ENABLED_DI0; + writel(reg, iomux-gpr[2]); This is all LVDS related and the LCD you are adding is not a LVDS. + + reg = readl(iomux-gpr[3]); + reg = (reg ~(IOMUXC_GPR3_LVDS1_MUX_CTL_MASK + | IOMUXC_GPR3_HDMI_MUX_CTL_MASK)) + | (IOMUXC_GPR3_MUX_SRC_IPU1_DI0 + IOMUXC_GPR3_LVDS1_MUX_CTL_OFFSET); + writel(reg, iomux-gpr[3]); Same here. #if defined(CONFIG_MX6DL) || defined(CONFIG_MX6S) #define CONFIG_DEFAULT_FDT_FILEimx6dl-wandboard.dtb @@ -152,7 +160,33 @@ fi; \ fi\0 \ mmcargs=setenv bootargs console=${console},${baudrate} \ - root=${mmcroot}\0 \ + root=${mmcroot}; run videoargs\0 \ + videoargs= \ + setenv nextcon 0; \ + if hdmidet; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=hdmi,1280x720M@60, \ + if=RGB24; \ This is unrelated to adding a LVDS display and would be better handled on a separate patch. + setenv fbmen fbmem=28M; \ + setexpr nextcon ${nextcon} + 1; \ + else \ + echo - no HDMI monitor; \ + fi; \ + i2c dev 1; \ + if i2c probe 0x10; then \ + setenv bootargs ${bootargs} \ + video=mxcfb${nextcon}:dev=lcd,800x480@60, \ + if=RGB666; \ + if test 0 -eq ${nextcon}; then \ + setenv fbmem fbmem=10M; \ + else \ + setenv fbmem ${fbmem},10M; \ + fi; \ + setexpr nextcon ${nextcon} + 1; \ + else \ + echo '- no FWBADAPT-7WVGA-LCD-F07A-0102 display'; \ + fi; \ + setenv bootargs ${bootargs} ${fbmem}\0 \ Changing the environment variables would be more appropriate on a separate patch, but still don't like the idea of hardcoding the video argument specific to a FSL kernel version. I hope to have handled all the comments in v3 :-) -- Otavio Salvador O.S. Systems http://www.ossystems.com.brhttp://code.ossystems.com.br Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
On 05/01/2014 02:41 PM, Scott Wood wrote: On Thu, 2014-05-01 at 14:29 -0700, York Sun wrote: On 05/01/2014 02:21 PM, Scott Wood wrote: On Thu, 2014-05-01 at 14:16 -0700, York Sun wrote: On 05/01/2014 08:54 AM, Simon Glass wrote: Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. Why wait to do it right? Which arches actually don't need this, given that Simon said he thinks ARM needs it as well? Adding something I can't test? By that rationale nobody could ever make changes that aren't localized to a few boards. That type of development produces the sort of mess that the generic board is meant to remedy. Even Simon said he thinks ARM needs it, it is not what current code has. If I revert this logic, #ifdef CONFIG_SYS_GLOBAL_DATA_STACK This looks like a global stack of data, not global data on the stack. How about CONFIG_SYS_GENERIC_GLOBAL_DATA? gd_dt data; gd = data; zero_global_data(); #endif I need to add #define CONFIG_SYS_GLOBAL_DATA_STACK to the board/arch who needs it. I have no idea which needs in the 70+ boards with CONFIG_DISPLAY_BOARDINFO defined. I see only 10 boards that currently use CONFIG_SYS_GENERIC_BOARD in include/configs, plus sandbox and x86 which hide it in config.mk. I don't know what CONFIG_DISPLAY_BOARDINFO has to do with it. To invert the symbol, add the new symbol to all of the current users. Removal from ARM boards can come afterward if it's confirmed that it's the right thing to do. I made a typo when I search it. Yes, it is only 10 boards. I can add the new macro to their arch header file. York York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Possible race condition when accessing SPI NOR Flash ?
Dear Valentin, In message 53623597.8040...@keymile.com you wrote: Now when fw_setenv ([1], [2]) updates the environment variables, it sometimes (approximately 1 out of 100 runs) triggers such kernel errors: ... I see the same behavior with both the 2013.10 and the 2014.04 releases of u-boot/fw_env. The kernel we are using is 3.10.36. I suspect that the problem is related to SPI NOR/m25p80 driver: on the system we have a NAND Flash device with UBI volumes. If I create 2 ubi volumes on the NAND Flash and configure fw_setenv (/etc/fw_env.config) to use them instead of the the mtd devices targetting the s25fl256s1, I am not able to reproduce the problem, even over more than 10'000 runs. Um... this is _Linux_ crashing - at this point the U-Boot driver has nothing to do with it.. If there is a problem, then with the Linux kernel / driver code. I guess you should rather post this on the MTD mailing ist. One other possible culprit that I see is the fsl_espi.c driver for the underlying hardware connection from the CPU to the NOR Flash, but I wanted to ask here if someone had an idea about what's going wrong. It's Linux code Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Don't hit a man when he's down - kick him; it's easier. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 03/11] kconfig: add board Kconfig and defconfig files
On Mon, 2014-04-28 at 11:47 -0600, Stephen Warren wrote: I guess the main issue I see here is that all the HW-configuration needs to be repeated in seaboard_defconfig and spl/seaboard_defconfig. (As an aside, if there's nothing special about SPL-vs-not and they're just different builds of U-Boot, why put the SPL configurations into a special-case sub-directory, why not name them seaboard_spl_defconfig and seaboard_defconfig, and put them in the same configs directory). It's special in that both configs are built and assembled into what looks to the user like one output image. Can we allow one defconfig to include or inherit from another? I know that ChromeOS stores kernel defconfigs in split configs that build upon each-other. Probably, this feature comes from elsewhere, and we could just crib the config split/combine script for U-Boot's use. Yes, that'd be nice. To make this work, we'd probably need the user to run something like: ./build-u-boot seaboard or: ./build-u-boot seaboard_spl ... rather than running make directly, so that script could generate the .config from a set of defconfigs, and then invoke make. Why couldn't the makefile do this when asked to use a board's defconfig? The user shouldn't need to know about the details of SPL or that there are separate sub-builds. Both seaboard and seaboard_spl would need to be built, not one or the other. (as an aside, having the user run a script to build rather than make directly gives us a huge amount more flexibility to add run arbitrary code to set up the build process before invoking make. I've found this kind of thing extremely useful in the past on other projects). What arbitrary code do you want to run that can't be run in the config makefile target? There is MAKEALL for users that want a one-step build. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board
Some platforms (tested on mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). The data should not be cleared later. Any arch which uses global data in generic board board_init_f() should define CONFIG_SYS_GENERIC_GLOBAL_DATA. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org CC: Albert ARIBAUD albert.u.b...@aribaud.net --- Change log v4: Replace with CONFIG_SYS_GENERIC_GLOBAL_DATA, a positive logic v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README |6 ++ arch/arc/include/asm/config.h |2 ++ arch/arm/include/asm/config.h |2 ++ arch/mips/include/asm/config.h |2 ++ common/board_f.c | 12 +++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..c66f988 100644 --- a/README +++ b/README @@ -440,6 +440,12 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_GENERIC_GLOBAL_DATA + Defines global data is initialized in generic board board_init_f(). + If this macro is defined, global data is created and cleared in + generic board board_init_f(). Without this macro, architecture/board + should initialize global data before calling board_init_f(). + CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN Defines the endianess of the CPU. Implementation of those diff --git a/arch/arc/include/asm/config.h b/arch/arc/include/asm/config.h index 5761def..3d331cc 100644 --- a/arch/arc/include/asm/config.h +++ b/arch/arc/include/asm/config.h @@ -7,6 +7,8 @@ #ifndef __ASM_ARC_CONFIG_H_ #define __ASM_ARC_CONFIG_H_ +#define CONFIG_SYS_GENERIC_GLOBAL_DATA + #define CONFIG_LMB #endif /*__ASM_ARC_CONFIG_H_ */ diff --git a/arch/arm/include/asm/config.h b/arch/arm/include/asm/config.h index abf79e5..2a20a77 100644 --- a/arch/arm/include/asm/config.h +++ b/arch/arm/include/asm/config.h @@ -7,6 +7,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +#define CONFIG_SYS_GENERIC_GLOBAL_DATA + #define CONFIG_LMB #define CONFIG_SYS_BOOT_RAMDISK_HIGH diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h index 3a891ba..1c8a42b 100644 --- a/arch/mips/include/asm/config.h +++ b/arch/mips/include/asm/config.h @@ -7,6 +7,8 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +#define CONFIG_SYS_GENERIC_GLOBAL_DATA + #define CONFIG_LMB #define CONFIG_SYS_BOOT_RAMDISK_HIGH diff --git a/common/board_f.c b/common/board_f.c index cbdf06f..7601a98 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -970,20 +970,22 @@ static init_fnc_t init_sequence_f[] = { void board_init_f(ulong boot_flags) { -#ifndef CONFIG_X86 +#ifdef CONFIG_SYS_GENERIC_GLOBAL_DATA + /* +* For some archtectures, global data is initialized and used before +* calling this function. The data should be preserved. For others, +* CONFIG_SYS_GENERIC_GLOBAL_DATA should be defined and use the stack +* here to host global data until relocation. +*/ gd_t data; 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 -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [Patch v4 2/2] common/board_f: Fix size variable
DRAM size should use 64-bit variable when the size could be more than 4GB. Caught and verified on P4080DS with 4GB DDR. Signed-off-by: York Sun york...@freescale.com --- Change log v4: no change since v1 common/board_f.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index 7601a98..c268cf9 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -194,7 +194,7 @@ static int init_func_ram(void) static int show_dram_config(void) { - ulong size; + unsigned long long size; #ifdef CONFIG_NR_DRAM_BANKS int i; -- 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 7/8] ums: move all variable declarations to the start of the block
Hi Stephen, On 05/01/2014 04:51 AM, Marek Vasut wrote: On Wednesday, April 30, 2014 at 11:13:21 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com It's easier to assign values to the variables inside an if statement body if the assignment and declaration are separate. Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_usb_mass_storage.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) This doesn't apply on u-boot-usb/master, sorry. Is this the first patch in the series which doesn't apply? Did you apply any of the earlier patches? I guess I'll go try to rebase the series and find out myself... This is why we need a uboot-next just like linux-next, and stricter controls on which git repos take patches that touch subsystem code, to avoid cross-repo conflicts:-( +1 Yesterday Marek and I agreed that some patches regarding DFU and gadgets (patches 1 to 8) done by Mateusz: http://patchwork.ozlabs.org/patch/343517/ will be go through u-boot-dfu tree, which will be rebased on top of u-boot-usb tree. Afterwards I will send PR to Marek. Unfortunately I didn't manage to add them to u-boot-denx tree yesterday. I will do it on Monday as well as the review regarding your ums work. I hope, that you can wait until then. Best regards, Lukasz Majewski ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot signature.asc Description: PGP signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board
On 1 May 2014 16:00, York Sun york...@freescale.com wrote: Some platforms (tested on mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). The data should not be cleared later. Any arch which uses global data in generic board board_init_f() should define CONFIG_SYS_GENERIC_GLOBAL_DATA. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org CC: Albert ARIBAUD albert.u.b...@aribaud.net --- Change log v4: Replace with CONFIG_SYS_GENERIC_GLOBAL_DATA, a positive logic v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README |6 ++ arch/arc/include/asm/config.h |2 ++ arch/arm/include/asm/config.h |2 ++ arch/mips/include/asm/config.h |2 ++ I think you will need sandbox also. Otherwise looks good. Reviewed-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] U-Boot, dm, ubi: struct device is declared twice
Hello Simon, Marek, just updating to current mainline code and defining CONFIG_SYS_GENERIC_BOARD pops up the following error: CC common/board_r.o In file included from include/linux/mtd/flashchip.h:21:0, from include/linux/mtd/nand.h:31, from include/nand.h:39, from common/board_r.c:40: include/ubi_uboot.h:202:8: error: redefinition of 'struct device' struct device { ^ In file included from include/dm.h:10:0, from common/board_r.c:21: include/dm/device.h:56:8: note: originally defined here struct device { ^ make[1]: *** [common/board_r.o] Fehler 1 make: *** [common] Fehler 2 pollux:u-boot hs [20140502] $ for a not yet mainlined imx6 board using UBI/UBIFS on nand. I am currently sync current Linux MTD/UBI and UBIFS code to U-Boot, but I think this error should pop up for all boards using DM and UBI ... How to solve this double named struct? I do not want to change this in Linux code as struct device is very much used, and this would be a maintaining nightmare for future syncs with linux code. Should we rename the DM struct device in include/dm/device.h ? diff --git a/include/dm/device.h b/include/dm/device.h index 4cd38ed..ba9f128 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -24,7 +24,7 @@ struct driver_info; #define DM_FLAG_ALLOC_PDATA(2 0) /** - * struct device - An instance of a driver + * struct dm_device - An instance of a driver * * This holds information about a device, which is a driver bound to a * particular port or peripheral (essentially a driver instance). @@ -53,12 +53,12 @@ struct driver_info; * @sibling_node: Next device in list of all devices * @flags: Flags for this device DM_FLAG_... */ -struct device { +struct dm_device { What do you think? 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, dm, ubi: struct device is declared twice
Dear Heiko, In message 53632ac5.1030...@denx.de you wrote: How to solve this double named struct? I do not want to change this in Linux code as struct device is very much used, and this would be a maintaining nightmare for future syncs with linux code. Should we rename the DM struct device in include/dm/device.h ? ... - * struct device - An instance of a driver + * struct dm_device - An instance of a driver I agree that we should keep U-Boot code as compatible with Linux as possible, i. e. I would suggest to rename our U-Boot struct. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If I had to live my life again, I'd make the same mistakes, only sooner. -- Tallulah Bankhead ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ums: respect CONFIG_USB_CABLE_CHECK
On Wednesday, April 30, 2014 at 11:10:35 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Not all boards support usb_cable_connected(). CONFIG_USB_CABLE_CHECK is used elsewhere to indicate whether a board does support that function. Enhance cmd_usb_mass_storage.c to honor that config variable. Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_usb_mass_storage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c index 5f557d5f857d..2f69a53acc67 100644 --- a/common/cmd_usb_mass_storage.c +++ b/common/cmd_usb_mass_storage.c @@ -42,6 +42,7 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, g_dnl_register(ums); +#ifdef CONFIG_USB_CABLE_CHECK /* Timeout unit: seconds */ int cable_ready_timeout = UMS_CABLE_READY_TIMEOUT; @@ -65,6 +66,7 @@ int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, } puts(\r\n); } +#endif while (1) { usb_gadget_handle_interrupts(); Please look at: [PATCH v5 03/12] usb: dfu: fix boards wo USB cable detection Does this work for you instead ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Getting started with SPL
HI Michal. Thanks for your answers. I have few related questions which I will ask separately. Rgrds, Heshsham On 30/04/2014, Michal Simek mon...@monstr.eu wrote: Hi On 04/30/2014 11:32 AM, Heshsham Abdul Basit wrote: *HI, * *OS:* petalinux https://github.com/Xilinx/u-boot-xlnx/tree/master-next it is not OS - it is just xilinx u-boot repo. And petalinux is using this repo too. *Board:* Xilinx z702 evaluation boardhttp://www.xilinx.com/products/boards-and-kits/EK-Z7-ZC702-G.htm having ARM Cortex A9 and FPGA on the zc700 SoC * Background:* I observed that first message on the console comes after 1 second. It is the message from u-boot. Why this was happening? Because I had to use a fsbl (first stage boot loader)http://blog.fakultaet-technik.de/development-with-zynq-part-3-build-boot-files/ for initialization of hardware. I suspected that it is this fsbl that is consuming 1 second initializing useless hardware which I will not use at all. in fact I am not going to use any fpga bitstream also. In standard flow there is bootrom - fsbl - u-boot. I have never measured where we are spending time in boot. So I am trying to boot my Linux image using uboot-SPL methodhttp://www.denx.de/en/pub/Documents/Presentations/EWC2012_Roeder_Zundel_Fastboot.pdf bypassing fsbl. The main advantage I can get is perhaps fastest possible boot. yes. But also keep in your mind that depends on which boot device you are using. QSPI mode should be the fastest one. I found thishttps://github.com/Xilinx/u-boot-xlnx/blob/master/doc/README.SPL (README.SPL) document that explains how to work with SPL. However I have following question w.r.t to the this passage in the document: The building of SPL images can be with: define CONFIG_SPL Because SPL images normally have a different text base, one has to be configured by defining CONFIG_SPL_TEXT_BASE. The linker script has to be defined with CONFIG_SPL_LDSCRIPT. Questions: 1- In which file I should define #define CONFIG_SPL and CONFIG_SPL_TEXT_BASE? Just config file - you can just grep code and you will find out that it is in include/configs/ folder. 2-Where is the linker script? Do I need to define CONFIG_SPL_LDSCRIPT in the linker script ? If you want to use private linker script then yes. There is also generic one. Source code of SPL enabled u-boot for xilinx board I am using is thishttps://github.com/Xilinx/u-boot-xlnx/tree/master-next yes. I have enabled it by default but for correct function you have to copy ps7_init.c/h files from your hardware design to be align with your hw design 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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] cmd_bootm.c: Only say XIP image when load is image_start
We say we have an XIP (in this case, image loaded at desired execution address) when the image header has been offset in the load. It's possible that in some cases executing the header is non-fatal but that's not true in many other cases. Signed-off-by: Tom Rini tr...@ti.com --- common/cmd_bootm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index c243a5b..e683af3 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -388,7 +388,7 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end, image_buf = map_sysmem(image_start, image_len); switch (comp) { case IH_COMP_NONE: - if (load == blob_start || load == image_start) { + if (load == image_start) { printf( XIP %s ... , type_name); no_overlap = 1; } else { -- 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 1/8] kmp204x: Add support for the unit LEDs
Hi York, On 04/30/2014 07:04 PM, York Sun wrote: On 04/30/2014 06:01 AM, Valentin Longchamp wrote: From: Stefan Bigler stefan.big...@keymile.com snip diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c index 49f9aa2..11949f4 100644 --- a/board/keymile/kmp204x/qrio.c +++ b/board/keymile/kmp204x/qrio.c @@ -144,3 +144,17 @@ void qrio_prstcfg(u8 bit, u8 mode) out_be32(qrio_base + PRSTCFG_OFF, prstcfg); } + +#define CTRLH_OFF 0x02 +#define CTRLH_WRL_BOOT 0x01 +#define CTRLH_WRL_UNITRUN 0x02 + +void qrio_set_leds(void) +{ +u8 ctrlh; +void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE; Please insert a blank line here. OK, that's correct. Do you want me to resend the whole series or are the first 2 patches with the additional blank line OK ? +/* set UNIT LED to RED and BOOT LED to ON */ +ctrlh = in_8(qrio_base + CTRLH_OFF); +ctrlh |= (CTRLH_WRL_BOOT | CTRLH_WRL_UNITRUN); +out_8(qrio_base + CTRLH_OFF, ctrlh); +} ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] ums: move all variable declarations to the start of the block
On Wednesday, April 30, 2014 at 11:13:21 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com It's easier to assign values to the variables inside an if statement body if the assignment and declaration are separate. Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_usb_mass_storage.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) This doesn't apply on u-boot-usb/master, sorry. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] usb: tegra: fix PHY selection code
On Wednesday, April 30, 2014 at 11:09:55 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com The TRM for Tegra30 and later all state that USBMODE_CM_HC must be set before writing to hostpc1_devlc to select which PHY to use for a USB controller. However, neither init_{utmi,ulpi}_usb_controller() do this today, so the register writes they perform for PHY selection do not work. For the UTMI case, this was hacked around in commit 7e44d9320ed4 ARM: Tegra: USB: EHCI: Add support for Tegra30/Tegra114 by adding code to ehci_hcd_init() which sets USBMODE_CM_HC and duplicates the PHY selection register write. This code doesn't cover the ULPI case, so I wouldn't be surprised if ULPI doesn't work with the current code, unless the ordering requirement only ends up being an issue in HW for UTMI not ULPI. This patch fixes init_{utmi,ulpi}_usb_controller() to correctly set USBMODE_CM_HC before selecting the PHY. Now that this works, we can remove the duplicate UTMI-specific code in ehci_hcd_init(), thus simplifying that function. This doesn't apply on u-boot-usb/master , so I cannot pick this, sorry . Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/8] kmp204x: Add support for the unit LEDs
On 05/01/2014 07:00 AM, Valentin Longchamp wrote: Hi York, On 04/30/2014 07:04 PM, York Sun wrote: On 04/30/2014 06:01 AM, Valentin Longchamp wrote: From: Stefan Bigler stefan.big...@keymile.com snip diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c index 49f9aa2..11949f4 100644 --- a/board/keymile/kmp204x/qrio.c +++ b/board/keymile/kmp204x/qrio.c @@ -144,3 +144,17 @@ void qrio_prstcfg(u8 bit, u8 mode) out_be32(qrio_base + PRSTCFG_OFF, prstcfg); } + +#define CTRLH_OFF 0x02 +#define CTRLH_WRL_BOOT 0x01 +#define CTRLH_WRL_UNITRUN 0x02 + +void qrio_set_leds(void) +{ + u8 ctrlh; + void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE; Please insert a blank line here. OK, that's correct. Do you want me to resend the whole series or are the first 2 patches with the additional blank line OK ? For a simple change like this, you can do either way. Make sure to change the subject prefix so it doesn't confuse me or anyone. York ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data
Hi York, On 30 April 2014 18:01, York Sun york...@freescale.com wrote: Some platforms (including mpc85xx, mpc86xx) use global data before calling function baord_inti_f(). This data should not be cleared later. Any arch which needs to preserve global data should define CONFIG_SYS_EARLY_GD. Signed-off-by: York Sun york...@freescale.com CC: Scott Wood scottw...@freescale.com CC: Simon Glass s...@chromium.org --- Change log v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. README|3 +++ arch/powerpc/include/asm/config.h |2 ++ arch/x86/include/asm/config.h |1 + common/board_f.c | 10 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 12758dc..1a51b11 100644 --- a/README +++ b/README @@ -440,6 +440,9 @@ The following options need to be configured: supported, core will start to execute uboot when wakes up. - Generic CPU options: + CONFIG_SYS_EARLY_GD + Defines global data is used before board_init_f(). + This looks like a good solution, but I believe that 'early' is in fact where we are headed. So perhaps you should create an inverted option and define it for archs that don't support it? For what you have, I think CONFIG_SYS_EARLY_GLOBAL_DATA might be more descriptive. Also I think you should describe the purpose more precisely here - it's not just the use that you need to discuss. - The CPU init code must set it up and zero it - Then board_init_f() doesn't zero it CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN Defines the endianess of the CPU. Implementation of those diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h index 423a6fb..4b6103b 100644 --- a/arch/powerpc/include/asm/config.h +++ b/arch/powerpc/include/asm/config.h @@ -10,11 +10,13 @@ #ifdef CONFIG_MPC85xx #include asm/config_mpc85xx.h #define CONFIG_SYS_FSL_DDR +#define CONFIG_SYS_EARLY_GD #endif #ifdef CONFIG_MPC86xx #include asm/config_mpc86xx.h #define CONFIG_SYS_FSL_DDR +#define CONFIG_SYS_EARLY_GD #endif #ifdef CONFIG_MPC83xx diff --git a/arch/x86/include/asm/config.h b/arch/x86/include/asm/config.h index f06a15c..940461d 100644 --- a/arch/x86/include/asm/config.h +++ b/arch/x86/include/asm/config.h @@ -7,5 +7,6 @@ #ifndef _ASM_CONFIG_H_ #define _ASM_CONFIG_H_ +#define CONFIG_SYS_EARLY_GD #define CONFIG_SYS_GENERIC_BOARD #endif diff --git a/common/board_f.c b/common/board_f.c index cbdf06f..0823bed 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -970,20 +970,20 @@ static init_fnc_t init_sequence_f[] = { void board_init_f(ulong boot_flags) { -#ifndef CONFIG_X86 + /* +* For some archtecture, global data is initialized and used before +* calling this function. The data should be preserved. +*/ +#ifndef CONFIG_SYS_EARLY_GD gd_t data; 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 As a separate issue/patch, I think this should be defined for ARM also. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] usb: tegra: fix PHY selection code
On 05/01/2014 04:49 AM, Marek Vasut wrote: On Wednesday, April 30, 2014 at 11:09:55 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com The TRM for Tegra30 and later all state that USBMODE_CM_HC must be set before writing to hostpc1_devlc to select which PHY to use for a USB controller. However, neither init_{utmi,ulpi}_usb_controller() do this today, so the register writes they perform for PHY selection do not work. For the UTMI case, this was hacked around in commit 7e44d9320ed4 ARM: Tegra: USB: EHCI: Add support for Tegra30/Tegra114 by adding code to ehci_hcd_init() which sets USBMODE_CM_HC and duplicates the PHY selection register write. This code doesn't cover the ULPI case, so I wouldn't be surprised if ULPI doesn't work with the current code, unless the ordering requirement only ends up being an issue in HW for UTMI not ULPI. This patch fixes init_{utmi,ulpi}_usb_controller() to correctly set USBMODE_CM_HC before selecting the PHY. Now that this works, we can remove the duplicate UTMI-specific code in ehci_hcd_init(), thus simplifying that function. This doesn't apply on u-boot-usb/master , so I cannot pick this, sorry . Ah right. That's because I'm working on top of a merge of u-boot-arm/master and u-boot/master, and that includes the following changes to the Tegra USB driver that went in through u-boot-tegra/master - u-boot-arm/master rather than the USB tree: 8f9fd6caafb8 usb: tegra: combine header file b1d615f3f102 usb: tegra: fix PHY configuration b03f4b3742a7 usb: tegra: fix USB2 powerdown for Tegra30 and later What's the best fix here: * Wait until the previous patches get into u-boot/master, and u-boot-usb/master picks them up, and then apply this series. * Apply this series to u-boot-tegra/master with your ack? There's little point my rebasing this series on top of u-boot-usb/master, and applying it right now, since that will just cause the same conflicts when u-boot-usb/master gets merged into u-boot/master. Thanks. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 7/8] ums: move all variable declarations to the start of the block
On 05/01/2014 04:51 AM, Marek Vasut wrote: On Wednesday, April 30, 2014 at 11:13:21 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com It's easier to assign values to the variables inside an if statement body if the assignment and declaration are separate. Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Lukasz Majewski l.majew...@samsung.com Signed-off-by: Stephen Warren swar...@nvidia.com --- common/cmd_usb_mass_storage.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) This doesn't apply on u-boot-usb/master, sorry. Is this the first patch in the series which doesn't apply? Did you apply any of the earlier patches? I guess I'll go try to rebase the series and find out myself... This is why we need a uboot-next just like linux-next, and stricter controls on which git repos take patches that touch subsystem code, to avoid cross-repo conflicts:-( ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ums: respect CONFIG_USB_CABLE_CHECK
On 04/30/2014 11:21 PM, Marek Vasut wrote: On Wednesday, April 30, 2014 at 11:10:35 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com Not all boards support usb_cable_connected(). CONFIG_USB_CABLE_CHECK is used elsewhere to indicate whether a board does support that function. Enhance cmd_usb_mass_storage.c to honor that config variable. ... Please look at: [PATCH v5 03/12] usb: dfu: fix boards wo USB cable detection Does this work for you instead ? Yes, it does. Please consider that patch, Tested-by: Stephen Warren swar...@nvidia.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 04/11] kconfig: add basic Kconfig files
On Wed, 2014-04-30 at 12:16 -0700, Simon Glass wrote: Hi Masahiro, On 29 April 2014 21:22, Masahiro Yamada yamad...@jp.panasonic.com wrote: Hi Simon, + +config SPL_BUILD + bool + depends on BUILD_MODE=SPL || BUILD_MODE=TPL What is the TPL term for? Please note that both CONFIG_SPL_BUILD and CONFIG_TPL_BUILD must be defined during the build of TPL image. To sum up in a matrix, the definition of the these macros is like this: CONFIG_SPL_BUILDCONFIG_TPL_BUILD non-SPL build: undefined undefined SPL build defined undefined TPL build defined defined Maybe do you think it looks weird? ( Me too.) But the implementation has been like this since TPL infrastructure was introduced by commit 3aa29de. Defining only CONFIG_TPL_BUILD does not work. OK, thanks for explaining this. It seems wrong to me, but that should be a separate discussion for later and does not affect your series. TPL is an additional SPL (for three-stage boot). CONFIG_SPL_BUILD should be set for both the TPL and for the regular SPL. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 04/11] kconfig: add basic Kconfig files
On Thu, 2014-04-24 at 14:04 +0900, Masahiro Yamada wrote: +config KCONFIG_OBJDIR + string + option env=KCONFIG_OBJDIR + +config BUILD_MODE + string + default SPL if $KCONFIG_OBJDIR=spl/ + default TPL if $KCONFIG_OBJDIR=tpl/ + default Main Why does this need to be a string? +menu General setup + +config SPL_BUILD + bool + depends on BUILD_MODE=SPL || BUILD_MODE=TPL + default y + +config TPL_BUILD + bool + depends on BUILD_MODE=TPL + default y You could get rid of BUILD_MODE and just have: config SPL_BUILD bool default y if $KCONFIG_OBJDIR=spl/ config TPL_BUILD bool default y if $KCONFIG_OBJDIR=tpl/ select SPL_BUILD -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 2/9] sunxi: add sun7i pinmux and gpio support
This patch adds the basic pinmux and gpio support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Ma Haijun mahaij...@gmail.com Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Henrik Nordström hen...@henriknordstrom.net Signed-off-by: Ian Campbell i...@hellion.org.uk Reviewed-by: Tom Rini tr...@ti.com Acked-by: Marek Vasut ma...@denx.de Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - Additional pin definitions v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- arch/arm/cpu/armv7/sunxi/Makefile | 1 + arch/arm/cpu/armv7/sunxi/pinmux.c | 61 ++ arch/arm/include/asm/arch-sunxi/gpio.h | 147 + 3 files changed, 209 insertions(+) create mode 100644 arch/arm/cpu/armv7/sunxi/pinmux.c create mode 100644 arch/arm/include/asm/arch-sunxi/gpio.h diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile index 440d266..529e7ec 100644 --- a/arch/arm/cpu/armv7/sunxi/Makefile +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -9,4 +9,5 @@ # obj-y += timer.o obj-y += clock.o +obj-y += pinmux.o obj-$(CONFIG_SUN7I)+= clock_sun4i.o diff --git a/arch/arm/cpu/armv7/sunxi/pinmux.c b/arch/arm/cpu/armv7/sunxi/pinmux.c new file mode 100644 index 000..1f2843f --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/pinmux.c @@ -0,0 +1,61 @@ +/* + * (C) Copyright 2007-2011 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include asm/arch/gpio.h + +int sunxi_gpio_set_cfgpin(u32 pin, u32 val) +{ + u32 bank = GPIO_BANK(pin); + u32 index = GPIO_CFG_INDEX(pin); + u32 offset = GPIO_CFG_OFFSET(pin); + struct sunxi_gpio *pio = BANK_TO_GPIO(bank); + + clrsetbits_le32(pio-cfg[0] + index, 0xf offset, val offset); + + return 0; +} + +int sunxi_gpio_get_cfgpin(u32 pin) +{ + u32 cfg; + u32 bank = GPIO_BANK(pin); + u32 index = GPIO_CFG_INDEX(pin); + u32 offset = GPIO_CFG_OFFSET(pin); + struct sunxi_gpio *pio = BANK_TO_GPIO(bank); + + cfg = readl(pio-cfg[0] + index); + cfg = offset; + + return cfg 0xf; +} + +int sunxi_gpio_set_drv(u32 pin, u32 val) +{ + u32 bank = GPIO_BANK(pin); + u32 index = GPIO_DRV_INDEX(pin); + u32 offset = GPIO_DRV_OFFSET(pin); + struct sunxi_gpio *pio = BANK_TO_GPIO(bank); + + clrsetbits_le32(pio-drv[0] + index, 0x3 offset, val offset); + + return 0; +} + +int sunxi_gpio_set_pull(u32 pin, u32 val) +{ + u32 bank = GPIO_BANK(pin); + u32 index = GPIO_PULL_INDEX(pin); + u32 offset = GPIO_PULL_OFFSET(pin); + struct sunxi_gpio *pio = BANK_TO_GPIO(bank); + + clrsetbits_le32(pio-pull[0] + index, 0x3 offset, val offset); + + return 0; +} diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h new file mode 100644 index 000..892479c --- /dev/null +++ b/arch/arm/include/asm/arch-sunxi/gpio.h @@ -0,0 +1,147 @@ +/* + * (C) Copyright 2007-2012 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef _SUNXI_GPIO_H +#define _SUNXI_GPIO_H + +#include linux/types.h + +/* + * sunxi has 9 banks of gpio, they are: + * PA0 - PA17 | PB0 - PB23 | PC0 - PC24 + * PD0 - PD27 | PE0 - PE31 | PF0 - PF5 + * PG0 - PG9 | PH0 - PH27 | PI0 - PI12 + */ + +#define SUNXI_GPIO_A 0 +#define SUNXI_GPIO_B 1 +#define SUNXI_GPIO_C 2 +#define SUNXI_GPIO_D 3 +#define SUNXI_GPIO_E 4 +#define SUNXI_GPIO_F 5 +#define SUNXI_GPIO_G 6 +#define SUNXI_GPIO_H 7 +#define SUNXI_GPIO_I 8 +#define SUNXI_GPIO_BANKS 9 + +struct sunxi_gpio { + u32 cfg[4]; + u32 dat; + u32 drv[2]; + u32 pull[2]; +}; + +/* gpio interrupt control */ +struct sunxi_gpio_int { + u32 cfg[3]; + u32 ctl; + u32 sta; + u32 deb;/* interrupt debounce */ +}; + +struct sunxi_gpio_reg { + struct sunxi_gpio gpio_bank[SUNXI_GPIO_BANKS]; + u8 res[0xbc]; + struct sunxi_gpio_int gpio_int; +}; + +#define BANK_TO_GPIO(bank) \ + ((struct sunxi_gpio_reg *)SUNXI_PIO_BASE)-gpio_bank[bank] + +#define GPIO_BANK(pin) ((pin) 5) +#define GPIO_NUM(pin) ((pin) 0x1f) + +#define
[U-Boot] [PATCH v4 0/9] sunxi: initial upstreamining effort
This is my fourth cut at an upstreamable series based upon the https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet. The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. and applies to u-boot v2014.04. Changes in v4: - Resynced with u-boot-sunxi.git d9fe0a1e061e which pulled lots of fixes for Marek's review comments. Global changes in v3: - Rebased onto v2014.04 and resynced with u-boot-sunxi.git c89867dca2e9 - Improved commit messages - Updated lists of contributors - Added some CCs - Lots of cleanup based on review comments. Global changes in v2: - Use SPDX-License-Identifier - Resync with u-boot-sunxi.git - Lot of updates to the individual patches, see the individual commit messages (checkpatch.pl fixes, magic number removal etc). - Pulled the Ethernet stuff before the MMC and non-FEL boot stuff. The MMC stuff (which non-FEL boot needs) still needs some more cleanup, but the reordering means that the initial part of the series could in principal go in. This series can also be found at: git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v4 There is no SMP here, since that relies on the PSCI support from Marc Zyngier which has yet to land in mainline. Marc has recently rebased and a version based on this series can be found at: git://gitorious.org/ijc/u-boot.git sunxi-mainlining-v4-smp I've tried to give corect credit and S-o-b based upon: git log --pretty='%aN' linux-sunxi/sunxi -- [PATHS] | sort -u git log linux-sunxi/sunxi -- [PATHS] | grep -i signed.off.by | sort -u Manual inspection This will tend to over credit, since it will include folks who contributed code which has since been removed as well as those who contributed code which is not included in this patch set, but I think it is better to be conservative and include too many rather than incorrectly exclude people. Doing better than this would be IMHO too hard to be worth it (e.g. git blame would prefer a recent whitespace cleanup to the actual author of the code and prefer someone did code motion over the original author, so it would be a massive manual process). [0] https://github.com/linux-sunxi/u-boot-sunxi.git ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 5/9] sunxi: add support for Cubietruck booting in FEL mode
Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk Reviewed-by: Tom Rini tr...@ti.com Reviewed-by: Marek Vasut ma...@denx.de --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in. v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- board/sunxi/Makefile | 1 + board/sunxi/dram_cubietruck.c | 31 +++ boards.cfg| 1 + 3 files changed, 33 insertions(+) create mode 100644 board/sunxi/dram_cubietruck.c diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile index 559112e..18b1e11 100644 --- a/board/sunxi/Makefile +++ b/board/sunxi/Makefile @@ -9,3 +9,4 @@ # SPDX-License-Identifier: GPL-2.0+ # obj-y += board.o +obj-$(CONFIG_CUBIETRUCK) += dram_cubietruck.o diff --git a/board/sunxi/dram_cubietruck.c b/board/sunxi/dram_cubietruck.c new file mode 100644 index 000..fbcd687 --- /dev/null +++ b/board/sunxi/dram_cubietruck.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + +#include common.h +#include asm/arch/dram.h + +static struct dram_para dram_para = { + .clock = 432, + .type = 3, + .rank_num = 1, + .density = 4096, + .io_width = 8, + .bus_width = 32, + .cas = 9, + .zq = 0x7f, + .odt_en = 0, + .size = 2048, + .tpr0 = 0x42d899b7, + .tpr1 = 0xa090, + .tpr2 = 0x22a00, + .tpr3 = 0x0, + .tpr4 = 0x1, + .tpr5 = 0x0, + .emr1 = 0x4, + .emr2 = 0x10, + .emr3 = 0x0, +}; + +unsigned long sunxi_dram_init(void) +{ + return dramc_init(dram_para); +} diff --git a/boards.cfg b/boards.cfg index b4203f1..31b02df 100644 --- a/boards.cfg +++ b/boards.cfg @@ -371,6 +371,7 @@ Active arm armv7 rmobile renesas lager Active arm armv7 s5pc1xx samsung goni s5p_goni - Mateusz Zalega m.zal...@samsung.com Active arm armv7 s5pc1xx samsung smdkc100 smdkc100 - Minkyu Kang mk7.k...@samsung.com Active arm armv7 socfpga altera socfpga socfpga_cyclone5 - - +Active arm armv7 sunxi - sunxi Cubietruck_FEL sun7i:CUBIETRUCK,SPL_FEL - Active arm armv7 u8500 st-ericsson snowball snowball - Mathieu Poirier mathieu.poir...@linaro.org Active arm armv7 u8500 st-ericsson u8500 u8500_href - - Active arm armv7 vf610 freescale vf610twr vf610twr vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg Alison Wang b18...@freescale.com -- 1.9.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 6/9] sunxi: add gmac Ethernet support
Add support for the GMAC Ethernet controller on Allwinner A20 (sun7i) processors. Enable for the Cubietruck. Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - drop accidentally doubled hunk - use gpio setup functions - moved before mmc patches v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- arch/arm/cpu/armv7/sunxi/board.c | 23 +++ board/sunxi/Makefile | 1 + board/sunxi/gmac.c | 32 boards.cfg | 2 +- include/configs/sunxi-common.h | 17 + include/netdev.h | 1 + 6 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 board/sunxi/gmac.c diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c index b5c0cb7..49c9448 100644 --- a/arch/arm/cpu/armv7/sunxi/board.c +++ b/arch/arm/cpu/armv7/sunxi/board.c @@ -11,6 +11,8 @@ */ #include common.h +#include netdev.h +#include miiphy.h #include serial.h #ifdef CONFIG_SPL_BUILD #include spl.h @@ -86,3 +88,24 @@ void enable_caches(void) dcache_enable(); } #endif + +#ifdef CONFIG_CMD_NET +/* + * Initializes on-chip ethernet controllers. + * to override, implement board_eth_init() + */ +int cpu_eth_init(bd_t *bis) +{ + int rc; + +#ifdef CONFIG_SUNXI_GMAC + rc = sunxi_gmac_initialize(bis); + if (rc 0) { + printf(sunxi: failed to initialize gmac\n); + return rc; + } +#endif + + return 0; +} +#endif diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile index 18b1e11..cbf8f08 100644 --- a/board/sunxi/Makefile +++ b/board/sunxi/Makefile @@ -9,4 +9,5 @@ # SPDX-License-Identifier: GPL-2.0+ # obj-y += board.o +obj-$(CONFIG_SUNXI_GMAC) += gmac.o obj-$(CONFIG_CUBIETRUCK) += dram_cubietruck.o diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c new file mode 100644 index 000..e48328d --- /dev/null +++ b/board/sunxi/gmac.c @@ -0,0 +1,32 @@ +#include common.h +#include netdev.h +#include miiphy.h +#include asm/gpio.h +#include asm/io.h +#include asm/arch/clock.h +#include asm/arch/gpio.h + +int sunxi_gmac_initialize(bd_t *bis) +{ + int pin; + struct sunxi_ccm_reg *const ccm = + (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + + /* Set up clock gating */ + setbits_le32(ccm-ahb_gate1, 0x1 AHB_GATE_OFFSET_GMAC); + + /* Set MII clock */ + setbits_le32(ccm-gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII | + CCM_GMAC_CTRL_GPIT_RGMII); + + /* Configure pin mux settings for GMAC */ + for (pin = SUNXI_GPA(0); pin = SUNXI_GPA(16); pin++) { + /* skip unused pins in RGMII mode */ + if (pin == SUNXI_GPA(9) || pin == SUNXI_GPA(14)) + continue; + sunxi_gpio_set_cfgpin(pin, SUN7I_GPA0_GMAC); + sunxi_gpio_set_drv(pin, 3); + } + + return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); +} diff --git a/boards.cfg b/boards.cfg index 31b02df..b74f8c8 100644 --- a/boards.cfg +++ b/boards.cfg @@ -371,7 +371,7 @@ Active arm armv7 rmobile renesas lager Active arm armv7 s5pc1xx samsung goni s5p_goni - Mateusz Zalega m.zal...@samsung.com Active arm armv7 s5pc1xx samsung smdkc100 smdkc100 - Minkyu Kang mk7.k...@samsung.com Active arm armv7 socfpga altera socfpga socfpga_cyclone5 - - -Active arm armv7 sunxi - sunxi Cubietruck_FEL sun7i:CUBIETRUCK,SPL_FEL - +Active arm armv7 sunxi - sunxi Cubietruck_FEL sun7i:CUBIETRUCK,SPL_FEL,SUNXI_GMAC,RGMII - Active arm
[U-Boot] [PATCH v4 8/9] sunxi: non-FEL SPL boot support for sun7i
Add support for booting from an MMC card. Signed-off-by: Stefan Roese s...@denx.de Signed-off-by: Henrik Nordström hen...@henriknordstrom.net Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - mksunxiboot cleanups - rebase on Kbuild stuff v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- Makefile| 10 +++ arch/arm/cpu/armv7/sunxi/config.mk | 8 ++ arch/arm/cpu/armv7/sunxi/u-boot-spl.lds | 52 boards.cfg | 1 + include/configs/sunxi-common.h | 26 ++ spl/Makefile| 13 +++ tools/.gitignore| 1 + tools/Makefile | 2 + tools/mksunxiboot.c | 142 9 files changed, 255 insertions(+) create mode 100644 arch/arm/cpu/armv7/sunxi/config.mk create mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl.lds create mode 100644 tools/mksunxiboot.c diff --git a/Makefile b/Makefile index c91c10e..379731c 100644 --- a/Makefile +++ b/Makefile @@ -870,6 +870,13 @@ OBJCOPYFLAGS_u-boot.spr = -I binary -O binary --pad-to=$(CONFIG_SPL_PAD_TO) \ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE $(call if_changed,pad_cat) +ifneq ($(CONFIG_SUNXI),) +OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ + --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff +u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE + $(call if_changed,pad_cat) +endif + ifneq ($(CONFIG_TEGRA),) OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE) u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot.bin FORCE @@ -1081,6 +1088,9 @@ spl/u-boot-spl.bin: spl/u-boot-spl spl/u-boot-spl: tools prepare $(Q)$(MAKE) obj=spl -f $(srctree)/spl/Makefile all +spl/sunxi-spl.bin: spl/u-boot-spl + @: + tpl/u-boot-tpl.bin: tools prepare $(Q)$(MAKE) obj=tpl -f $(srctree)/spl/Makefile all CONFIG_TPL_BUILD=y diff --git a/arch/arm/cpu/armv7/sunxi/config.mk b/arch/arm/cpu/armv7/sunxi/config.mk new file mode 100644 index 000..00f5ffc --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/config.mk @@ -0,0 +1,8 @@ +# Build a combined spl + u-boot image +ifdef CONFIG_SPL +ifndef CONFIG_SPL_BUILD +ifndef CONFIG_SPL_FEL +ALL-y += u-boot-sunxi-with-spl.bin +endif +endif +endif diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds new file mode 100644 index 000..5008028 --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds @@ -0,0 +1,52 @@ +/* + * (C) Copyright 2012 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * Based on omap-common/u-boot-spl.lds: + * + * (C) Copyright 2002 + * Gary Jennejohn, DENX Software Engineering, ga...@denx.de + * + * (C) Copyright 2010 + * Texas Instruments, www.ti.com + * Aneesh V ane...@ti.com + * + * SPDX-License-Identifier:GPL-2.0+ + */ +MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\ + LENGTH = CONFIG_SPL_MAX_SIZE } +MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \ + LENGTH = CONFIG_SPL_BSS_MAX_SIZE } + +OUTPUT_FORMAT(elf32-littlearm, elf32-littlearm, elf32-littlearm) +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + .text : + { + __start = .; + arch/arm/cpu/armv7/start.o (.text) + *(.text*) + } .sram + + . = ALIGN(4); + .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } .sram + + . = ALIGN(4); + .data : { *(SORT_BY_ALIGNMENT(.data*)) } .sram + + . = ALIGN(4); + __image_copy_end = .; + _end = .; + + .bss : + { + . = ALIGN(4); + __bss_start = .; + *(.bss*) + . = ALIGN(4); + __bss_end = .; + } .sdram +} diff --git a/boards.cfg b/boards.cfg index b74f8c8..b6e20ae 100644 --- a/boards.cfg +++ b/boards.cfg @@ -371,6 +371,7 @@ Active arm armv7 rmobile renesas lager Active arm armv7 s5pc1xx samsung goni s5p_goni - Mateusz Zalega m.zal...@samsung.com Active arm armv7 s5pc1xx samsung smdkc100 smdkc100 -
[U-Boot] [PATCH v4 9/9] net/designware: Reduce DMA burst length
From: Jens Kuske jensku...@gmail.com The GMAC module in Allwinner sunxi SoCs seems to have problems with burst lengths 8. Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Chen-Yu Tsai w...@csie.org --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: New. cherry-picked from u-boot-sunxi.git tree. --- drivers/net/designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index c45593b..6ece479 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -249,7 +249,7 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis) rx_descs_init(dev); tx_descs_init(dev); - writel(FIXEDBURST | PRIORXTX_41 | BURST_16, dma_p-busmode); + writel(FIXEDBURST | PRIORXTX_41 | BURST_8, dma_p-busmode); writel(readl(dma_p-opmode) | FLUSHTXFIFO | STOREFORWARD, dma_p-opmode); -- 1.9.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 7/9] sunxi: mmc support
This adds support for the MMC controller on the Allwinner A20 (sun7i) processor. Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Wills Wang wills.wang.o...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com Cc: Aaron Maoye leafy.m...@allwinnertech.com Cc: Pantelis Antoniou pa...@antoniou-consulting.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - use proper gpio interfaces, removing awkward casts and some magic numbers. - remove magic numbers - other cleanups v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. mmc: drop debug --- arch/arm/include/asm/arch-sunxi/mmc.h | 124 + board/sunxi/board.c | 72 + drivers/mmc/Makefile | 1 + drivers/mmc/sunxi_mmc.c | 503 ++ include/configs/sunxi-common.h| 11 + 5 files changed, 711 insertions(+) create mode 100644 arch/arm/include/asm/arch-sunxi/mmc.h create mode 100644 drivers/mmc/sunxi_mmc.c diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h new file mode 100644 index 000..53196e3 --- /dev/null +++ b/arch/arm/include/asm/arch-sunxi/mmc.h @@ -0,0 +1,124 @@ +/* + * (C) Copyright 2007-2011 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Aaron leafy.m...@allwinnertech.com + * + * MMC register definition for allwinner sunxi platform. + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#ifndef _SUNXI_MMC_H +#define _SUNXI_MMC_H + +#include linux/types.h + +struct sunxi_mmc { + u32 gctrl; /* 0x00 global control */ + u32 clkcr; /* 0x04 clock control */ + u32 timeout;/* 0x08 time out */ + u32 width; /* 0x0c bus width */ + u32 blksz; /* 0x10 block size */ + u32 bytecnt;/* 0x14 byte count */ + u32 cmd;/* 0x18 command */ + u32 arg;/* 0x1c argument */ + u32 resp0; /* 0x20 response 0 */ + u32 resp1; /* 0x24 response 1 */ + u32 resp2; /* 0x28 response 2 */ + u32 resp3; /* 0x2c response 3 */ + u32 imask; /* 0x30 interrupt mask */ + u32 mint; /* 0x34 masked interrupt status */ + u32 rint; /* 0x38 raw interrupt status */ + u32 status; /* 0x3c status */ + u32 ftrglevel; /* 0x40 FIFO threshold watermark*/ + u32 funcsel;/* 0x44 function select */ + u32 cbcr; /* 0x48 CIU byte count */ + u32 bbcr; /* 0x4c BIU byte count */ + u32 dbgc; /* 0x50 debug enable */ + u32 res0[11]; + u32 dmac; /* 0x80 internal DMA control */ + u32 dlba; /* 0x84 internal DMA descr list base address */ + u32 idst; /* 0x88 internal DMA status */ + u32 idie; /* 0x8c internal DMA interrupt enable */ + u32 chda; /* 0x90 */ + u32 cbda; /* 0x94 */ + u32 res1[26]; + u32 fifo; /* 0x100 FIFO access address */ +}; + +#define SUNXI_MMC_CLK_POWERSAVE(0x1 17) +#define SUNXI_MMC_CLK_ENABLE (0x1 16) +#define SUNXI_MMC_CLK_DIVIDER_MASK (0xff) + +#define SUNXI_MMC_GCTRL_SOFT_RESET (0x1 0) +#define SUNXI_MMC_GCTRL_FIFO_RESET (0x1 1) +#define SUNXI_MMC_GCTRL_DMA_RESET (0x1 2) +#define SUNXI_MMC_GCTRL_RESET (SUNXI_MMC_GCTRL_SOFT_RESET|\ +SUNXI_MMC_GCTRL_FIFO_RESET|\ +SUNXI_MMC_GCTRL_DMA_RESET) +#define SUNXI_MMC_GCTRL_DMA_ENABLE (0x1 5) +#define SUNXI_MMC_GCTRL_ACCESS_BY_AHB (0x1 31) + +#define SUNXI_MMC_CMD_RESP_EXPIRE (0x1 6) +#define SUNXI_MMC_CMD_LONG_RESPONSE(0x1 7) +#define SUNXI_MMC_CMD_CHK_RESPONSE_CRC (0x1 8) +#define SUNXI_MMC_CMD_DATA_EXPIRE (0x1 9) +#define SUNXI_MMC_CMD_WRITE(0x1 10) +#define SUNXI_MMC_CMD_AUTO_STOP(0x1 12) +#define SUNXI_MMC_CMD_WAIT_PRE_OVER(0x1 13) +#define SUNXI_MMC_CMD_SEND_INIT_SEQ(0x1 15) +#define SUNXI_MMC_CMD_UPCLK_ONLY (0x1 21) +#define SUNXI_MMC_CMD_START(0x1 31) + +#define SUNXI_MMC_RINT_RESP_ERROR (0x1 1) +#define SUNXI_MMC_RINT_COMMAND_DONE(0x1 2) +#define SUNXI_MMC_RINT_DATA_OVER (0x1 3) +#define SUNXI_MMC_RINT_TX_DATA_REQUEST
Re: [U-Boot] [PATCH v4 9/9] net/designware: Reduce DMA burst length
On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: From: Jens Kuske jensku...@gmail.com The GMAC module in Allwinner sunxi SoCs seems to have problems with burst lengths 8. Please ignore this last patch, I plan to rework as Alexey suggests in http://article.gmane.org/gmane.comp.hardware.netbook.arm.sunxi/9468 Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [linux-sunxi] Uboot error: address not aligned in v7_dcache_inval_range
On Mon, 2014-04-28 at 22:21 +0200, Marek Vasut wrote: On Monday, April 28, 2014 at 09:55:46 PM, Ian Campbell wrote: So having done all that it doesn't seem that reordering dw_eth_dev is necessary. Reordering dw_eth_dev is necessary. Look: It's certainly desirable, but it's not *necessary*. Anyway, that's just splitting hairs, I'm going to send a patch (on top of the v2 of this series) shortly. Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/2] net/designware: reorder struct dw_eth_dev to pack more efficiently.
The {tx,rx}_mac_descrtable fields are aligned to ARCH_DMA_MINALIGN, which could be 256 or even larger. That means there is a potentially huge hole in the struct before those fields, so move them to the front where they are better packed. Moving them to the front also helps ensure that so long as dw_eth_dev is properly aligned (which it is since net/designware: ensure device private data is DMA aligned.) the {tx,rx}_mac_descrtable will be too, or at least avoids having to worry too much about compiler specifics. Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Alexey Brodkin abrod...@synopsys.com --- drivers/net/designware.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/designware.h b/drivers/net/designware.h index 382b0c7..6d94b3a 100644 --- a/drivers/net/designware.h +++ b/drivers/net/designware.h @@ -215,13 +215,13 @@ struct dmamacdescr { #endif struct dw_eth_dev { + struct dmamacdescr tx_mac_descrtable[CONFIG_TX_DESCR_NUM]; + struct dmamacdescr rx_mac_descrtable[CONFIG_RX_DESCR_NUM]; + u32 interface; u32 tx_currdescnum; u32 rx_currdescnum; - struct dmamacdescr tx_mac_descrtable[CONFIG_TX_DESCR_NUM]; - struct dmamacdescr rx_mac_descrtable[CONFIG_RX_DESCR_NUM]; - char txbuffs[TX_TOTAL_BUFSIZE]; char rxbuffs[RX_TOTAL_BUFSIZE]; -- 1.9.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] NAND: Add Micron MT29F16G identifier
I added same ids, the device was able to be detected, but the nand info, nand erase.chip did not work. Same command works for a Micron 512MBytes nand. I am using mxc_nand driver. What else do we need update? what change you made to the mxc_nand.c and board configuration .h file? -- View this message in context: http://u-boot.10912.n7.nabble.com/PATCH-NAND-Add-Micron-MT29F16G-identifier-tp178044p179128.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] [PATCH] Trivial fix to .gitignore for spl/Makefile
Trivial fix to .gitignore for spl/Makefile According to the gitignore man page: An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. ^^ So the directory exclude /spl/* must come before the exception for spl/Makefile otherwise it has no effect. Signed-off-by: Ralph Siemsen ral...@netwinder.org --- Note: feel free to adjust the commit message to remove the gratuitous ascii art emphasis, etc. Note2: kindly CC: me on any replies --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cba5eac..a6b2d1c 100644 --- a/.gitignore +++ b/.gitignore @@ -47,8 +47,8 @@ /errlog /reloc_off -!/spl/Makefile /spl/* +!/spl/Makefile /tpl/ # -- 1.9.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 3/9] sunxi: add sun7i dram setup support
This patch adds DRAM initialisation support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com Signed-off-by: Stefan Roese s...@denx.de Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - remove redundant braces in mctl_ddr3_reset - remove incorrect call to mctl_ddr3_reset. - add CONFIG_SUN7I to simplify future SUN?I support. - add a comment about the magic numbers from the a/w code dumps - fix a bunch of checkpatch.pl issues v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- arch/arm/cpu/armv7/sunxi/Makefile | 1 + arch/arm/cpu/armv7/sunxi/dram.c| 593 + arch/arm/include/asm/arch-sunxi/dram.h | 179 ++ 3 files changed, 773 insertions(+) create mode 100644 arch/arm/cpu/armv7/sunxi/dram.c create mode 100644 arch/arm/include/asm/arch-sunxi/dram.h diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile index 529e7ec..d81d26c 100644 --- a/arch/arm/cpu/armv7/sunxi/Makefile +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -11,3 +11,4 @@ obj-y += timer.o obj-y += clock.o obj-y += pinmux.o obj-$(CONFIG_SUN7I)+= clock_sun4i.o +obj-$(CONFIG_SUN7I)+= dram.o diff --git a/arch/arm/cpu/armv7/sunxi/dram.c b/arch/arm/cpu/armv7/sunxi/dram.c new file mode 100644 index 000..b43c4b4 --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/dram.c @@ -0,0 +1,593 @@ +/* + * sunxi DRAM controller initialization + * (C) Copyright 2012 Henrik Nordstrom hen...@henriknordstrom.net + * (C) Copyright 2013 Luke Kenneth Casson Leighton l...@lkcl.net + * + * Based on sun4i Linux kernel sources mach-sunxi/pm/standby/dram*.c + * and earlier U-Boot Allwiner A10 SPL work + * + * (C) Copyright 2007-2012 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Berg Xing bergx...@allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +/* + * Unfortunately the only documentation we have on the sun7i DRAM + * controller is Allwinner boot0 + boot1 code, and that code uses + * magic numbers shifts with no explanations. Hence this code is + * rather undocumented and full of magic. + */ + +#include common.h +#include asm/io.h +#include asm/arch/clock.h +#include asm/arch/dram.h +#include asm/arch/timer.h +#include asm/arch/sys_proto.h + +#define CPU_CFG_CHIP_VER(n) ((n) 6) +#define CPU_CFG_CHIP_VER_MASK CPU_CFG_CHIP_VER(0x3) +#define CPU_CFG_CHIP_REV_A 0x0 +#define CPU_CFG_CHIP_REV_C1 0x1 +#define CPU_CFG_CHIP_REV_C2 0x2 +#define CPU_CFG_CHIP_REV_B 0x3 + +/* + * Wait up to 1s for mask to be clear in given reg. + */ +static void await_completion(u32 *reg, u32 mask) +{ + unsigned long tmo = timer_get_us() + 100; + + while (readl(reg) mask) { + if (timer_get_us() tmo) + panic(Timeout initialising DRAM\n); + } +} + +static void mctl_ddr3_reset(void) +{ + struct sunxi_dram_reg *dram = + (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE; + + clrbits_le32(dram-mcr, DRAM_MCR_RESET); + udelay(2); + setbits_le32(dram-mcr, DRAM_MCR_RESET); +} + +static void mctl_set_drive(void) +{ + struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE; + + clrsetbits_le32(dram-mcr, DRAM_MCR_MODE_NORM(0x3) | (0x3 28), + DRAM_MCR_MODE_EN(0x3) | + 0xffc); +} + +static void mctl_itm_disable(void) +{ + struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE; + + clrsetbits_le32(dram-ccr, DRAM_CCR_INIT, DRAM_CCR_ITM_OFF); +} + +static void mctl_itm_enable(void) +{ + struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE; + + clrbits_le32(dram-ccr, DRAM_CCR_ITM_OFF); +} + +static void mctl_enable_dll0(u32 phase) +{ + struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE; + + clrsetbits_le32(dram-dllcr[0], 0x3f 6, + ((phase 16) 0x3f) 6); + clrsetbits_le32(dram-dllcr[0], DRAM_DLLCR_NRESET, DRAM_DLLCR_DISABLE); + udelay(2); + +
[U-Boot] [PATCH v4 1/9] sunxi: add sun7i clocks and timer support.
This patch adds the basic clocks and timer support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Some of the code here is common to multiple sunxi subarchtectures, hence files are named sun4i which is the earliest similar variant. Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - define magic numbers - simplify get_tbclk - correct clock_set_pll1 prototype - add CONFIG_SUN7I to simplify future SUN?I support. - defines for MMC AHB clocks v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- arch/arm/cpu/armv7/sunxi/Makefile | 12 ++ arch/arm/cpu/armv7/sunxi/clock.c | 25 +++ arch/arm/cpu/armv7/sunxi/clock_sun4i.c| 186 +++ arch/arm/cpu/armv7/sunxi/timer.c | 113 arch/arm/include/asm/arch-sunxi/clock.h | 29 +++ arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 256 ++ arch/arm/include/asm/arch-sunxi/sys_proto.h | 16 ++ arch/arm/include/asm/arch-sunxi/timer.h | 88 + 8 files changed, 725 insertions(+) create mode 100644 arch/arm/cpu/armv7/sunxi/Makefile create mode 100644 arch/arm/cpu/armv7/sunxi/clock.c create mode 100644 arch/arm/cpu/armv7/sunxi/clock_sun4i.c create mode 100644 arch/arm/cpu/armv7/sunxi/timer.c create mode 100644 arch/arm/include/asm/arch-sunxi/clock.h create mode 100644 arch/arm/include/asm/arch-sunxi/clock_sun4i.h create mode 100644 arch/arm/include/asm/arch-sunxi/sys_proto.h create mode 100644 arch/arm/include/asm/arch-sunxi/timer.h diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile new file mode 100644 index 000..440d266 --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -0,0 +1,12 @@ +# +# (C) Copyright 2012 Henrik Nordstrom hen...@henriknordstrom.net +# +# Based on some other Makefile +# (C) Copyright 2000-2003 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# +obj-y += timer.o +obj-y += clock.o +obj-$(CONFIG_SUN7I)+= clock_sun4i.o diff --git a/arch/arm/cpu/armv7/sunxi/clock.c b/arch/arm/cpu/armv7/sunxi/clock.c new file mode 100644 index 000..47fb70f --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/clock.c @@ -0,0 +1,25 @@ +/* + * (C) Copyright 2007-2012 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * (C) Copyright 2013 Luke Kenneth Casson Leighton l...@lkcl.net + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include asm/arch/clock.h +#include asm/arch/gpio.h +#include asm/arch/sys_proto.h + +int clock_init(void) +{ +#ifdef CONFIG_SPL_BUILD + clock_init_safe(); +#endif + clock_init_uart(); + + return 0; +} diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c new file mode 100644 index 000..5720201 --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c @@ -0,0 +1,186 @@ +/* + * sun4i, sun5i and sun7i specific clock code + * + * (C) Copyright 2007-2012 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * (C) Copyright 2013 Luke Kenneth Casson Leighton l...@lkcl.net + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include asm/io.h +#include asm/arch/clock.h +#include asm/arch/gpio.h +#include asm/arch/sys_proto.h + +#ifdef CONFIG_SPL_BUILD +void clock_init_safe(void) +{ + struct sunxi_ccm_reg * const ccm = + (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + + /* Set safe defaults until PMU is configured */ + writel(AXI_DIV_1 AXI_DIV_SHIFT | + AHB_DIV_2 AHB_DIV_SHIFT | + APB0_DIV_1 APB0_DIV_SHIFT | + CPU_CLK_SRC_OSC24M CPU_CLK_SRC_SHIFT, + ccm-cpu_ahb_apb0_cfg); + writel(PLL1_CFG_DEFAULT, ccm-pll1_cfg); + sdelay(200); + writel(AXI_DIV_1 AXI_DIV_SHIFT | + AHB_DIV_2 AHB_DIV_SHIFT | + APB0_DIV_1 APB0_DIV_SHIFT | + CPU_CLK_SRC_PLL1
[U-Boot] [PATCH v4 4/9] sunxi: add sun7i cpu, board and start of day support
This patch adds generic board, start of day and basic build system support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Adam Sampson a...@offog.org Signed-off-by: Aleksei Mamlin mamli...@gmail.com Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luc Verhaegen l...@skynet.be Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Patrick Wood patrickhw...@gmail.com Signed-off-by: Stefan Roese s...@denx.de Signed-off-by: Wills Wang wills.wang.o...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. v3: Based on c89867dca2e9 sunxi: clocks: clock_get_pll5 prototype and coding style. v2: Based on u-boot-sunxi.git#sunxi d9aa5dd3d15c sunxi: mmc: checkpatch whitespace fixes with v2014.04-rc2 merged in: - just init dram once - remove clock ramping until power control is implemented - add CONFIG_SUN7I to simplify future SUN?I support. - fix a typo v1: Based on u-boot-sunxi.git#sunxi commit d854c4de2f57 arm: Handle .gnu.hash section in ldscripts vs v2014.01. --- arch/arm/cpu/armv7/Makefile | 2 +- arch/arm/cpu/armv7/sunxi/Makefile | 11 +++ arch/arm/cpu/armv7/sunxi/board.c| 88 + arch/arm/cpu/armv7/sunxi/cpu_info.c | 19 arch/arm/cpu/armv7/sunxi/start.c| 1 + arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds | 77 +++ arch/arm/include/asm/arch-sunxi/cpu.h | 122 arch/arm/include/asm/arch-sunxi/spl.h | 20 board/sunxi/Makefile| 11 +++ board/sunxi/board.c | 57 +++ include/configs/sun7i.h | 24 + include/configs/sunxi-common.h | 141 12 files changed, 572 insertions(+), 1 deletion(-) create mode 100644 arch/arm/cpu/armv7/sunxi/board.c create mode 100644 arch/arm/cpu/armv7/sunxi/cpu_info.c create mode 100644 arch/arm/cpu/armv7/sunxi/start.c create mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds create mode 100644 arch/arm/include/asm/arch-sunxi/cpu.h create mode 100644 arch/arm/include/asm/arch-sunxi/spl.h create mode 100644 board/sunxi/Makefile create mode 100644 board/sunxi/board.c create mode 100644 include/configs/sun7i.h create mode 100644 include/configs/sunxi-common.h diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile index 119ebb3..ddf00f3 100644 --- a/arch/arm/cpu/armv7/Makefile +++ b/arch/arm/cpu/armv7/Makefile @@ -12,7 +12,7 @@ obj-y += cache_v7.o obj-y += cpu.o obj-y += syslib.o -ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY),) +ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI),) ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y) obj-y += lowlevel_init.o endif diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile index d81d26c..a64bfa1 100644 --- a/arch/arm/cpu/armv7/sunxi/Makefile +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -8,7 +8,18 @@ # SPDX-License-Identifier: GPL-2.0+ # obj-y += timer.o +obj-y += board.o obj-y += clock.o obj-y += pinmux.o obj-$(CONFIG_SUN7I)+= clock_sun4i.o + +ifndef CONFIG_SPL_BUILD +obj-y += cpu_info.o +endif + +ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SUN7I)+= dram.o +ifdef CONFIG_SPL_FEL +obj-y += start.o +endif +endif diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c new file mode 100644 index 000..b5c0cb7 --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/board.c @@ -0,0 +1,88 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom hen...@henriknordstrom.net + * + * (C) Copyright 2007-2011 + * Allwinner Technology Co., Ltd. www.allwinnertech.com + * Tom Cubie tangli...@allwinnertech.com + * + * Some init for sunxi platform. + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include serial.h +#ifdef CONFIG_SPL_BUILD +#include spl.h +#endif +#include asm/gpio.h +#include asm/io.h +#include asm/arch/clock.h +#include asm/arch/gpio.h +#include asm/arch/sys_proto.h +#include asm/arch/timer.h + +#ifdef CONFIG_SPL_BUILD +/* Pointer to the global data structure for SPL */ +DECLARE_GLOBAL_DATA_PTR; + +/* The sunxi internal brom will try to loader external bootloader + * from mmc0, nand flash, mmc2. + * Unfortunately we can't
[U-Boot] [PATCH v4.1 9/9] net/designware: Make DMA burst length configurable and reduce by default
The correct value for this setting can vary across SoCs and boards, so make it configurable. Also reduce the default value to 8, which is the same default as used in the Linux driver. Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Alexey Brodkin abrod...@synopsys.com --- v4.1: Replaces neat/designware: Reduce DMA burst length from sunxi mainlining series. --- drivers/net/designware.c | 2 +- drivers/net/designware.h | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index fa816bf..7186e3b 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -249,7 +249,7 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis) rx_descs_init(dev); tx_descs_init(dev); - writel(FIXEDBURST | PRIORXTX_41 | BURST_16, dma_p-busmode); + writel(FIXEDBURST | PRIORXTX_41 | DMA_PBL, dma_p-busmode); writel(readl(dma_p-opmode) | FLUSHTXFIFO | STOREFORWARD, dma_p-opmode); diff --git a/drivers/net/designware.h b/drivers/net/designware.h index 6d94b3a..759085c 100644 --- a/drivers/net/designware.h +++ b/drivers/net/designware.h @@ -77,18 +77,18 @@ struct eth_dma_regs { #define DW_DMA_BASE_OFFSET (0x1000) +/* Default DMA Burst length */ +#ifndef CONFIG_DW_GMAC_DEFAULT_DMA_PBL +#define CONFIG_DW_GMAC_DEFAULT_DMA_PBL 8 +#endif + /* Bus mode register definitions */ #define FIXEDBURST (1 16) #define PRIORXTX_41(3 14) #define PRIORXTX_31(2 14) #define PRIORXTX_21(1 14) #define PRIORXTX_11(0 14) -#define BURST_1(1 8) -#define BURST_2(2 8) -#define BURST_4(4 8) -#define BURST_8(8 8) -#define BURST_16 (16 8) -#define BURST_32 (32 8) +#define DMA_PBL(CONFIG_DW_GMAC_DEFAULT_DMA_PBL8) #define RXHIGHPRIO (1 1) #define DMAMAC_SRST(1 0) -- 1.9.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/2] net/designware: reorder struct dw_eth_dev to pack more efficiently.
On Thursday, May 01, 2014 at 09:01:58 PM, Ian Campbell wrote: The {tx,rx}_mac_descrtable fields are aligned to ARCH_DMA_MINALIGN, which could be 256 or even larger. That means there is a potentially huge hole in the struct before those fields, so move them to the front where they are better packed. Moving them to the front also helps ensure that so long as dw_eth_dev is properly aligned (which it is since net/designware: ensure device private data is DMA aligned.) the {tx,rx}_mac_descrtable will be too, or at least avoids having to worry too much about compiler specifics. Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Alexey Brodkin abrod...@synopsys.com Acked-by: Marek Vasut ma...@denx.de 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 v4 0/9] sunxi: initial upstreamining effort
On Thursday, May 01, 2014 at 08:40:03 PM, Ian Campbell wrote: This is my fourth cut at an upstreamable series based upon the https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet. The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. and applies to u-boot v2014.04. Changes in v4: - Resynced with u-boot-sunxi.git d9fe0a1e061e which pulled lots of fixes for Marek's review comments. It would be really nice if you could list the changes instead of pointing to some random object in some random git repository at to me unknown address. 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] NAND: Add Micron MT29F16G identifier
Hi, Le Wed, 30 Apr 2014 21:30:58 -0700 (PDT), smithknown jimzhan...@yahoo.com a écrit : I added same ids, the device was able to be detected, but the nand info, nand erase.chip did not work. Same command works for a Micron 512MBytes nand. I am using mxc_nand driver. What else do we need update? what change you made to the mxc_nand.c and board configuration .h file? isn't your flash an ONFI one ? This ID is wrong as if will return the same for (at least) MT29F16G and MT29F32G : you need to use ONFI to detect this kind of flashes. Eric ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 4/9] sunxi: add sun7i cpu, board and start of day support
On Thursday, May 01, 2014 at 08:40:47 PM, Ian Campbell wrote: This patch adds generic board, start of day and basic build system support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Adam Sampson a...@offog.org Signed-off-by: Aleksei Mamlin mamli...@gmail.com Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luc Verhaegen l...@skynet.be Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Patrick Wood patrickhw...@gmail.com Signed-off-by: Stefan Roese s...@denx.de Signed-off-by: Wills Wang wills.wang.o...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. Sorry, I give up here. The changelog is useless and I don't want to review the patches anew again. Please fix the changelogs and repost the patches. Thanks 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 v4 1/9] sunxi: add sun7i clocks and timer support.
On Thursday, May 01, 2014 at 08:40:44 PM, Ian Campbell wrote: This patch adds the basic clocks and timer support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Some of the code here is common to multiple sunxi subarchtectures, hence files are named sun4i which is the earliest similar variant. Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. I have no idea what this changelog entry tells me, I will have to review this entire patch anew. [...] +void clock_set_pll1(int hz) +{ + int i = 0; + int axi, ahb, apb0; + struct sunxi_ccm_reg * const ccm = + (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + + /* Find target frequency */ + while (pll1_para[i].freq hz) + i++; You can just do a for (...) cycle here, instead of the unbounded while cycle. Also, I think hz will always be positive, thus int hz - unsigned int hz . [...] 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 v4 0/9] sunxi: initial upstreamining effort
On Thu, 2014-05-01 at 21:24 +0200, Marek Vasut wrote: On Thursday, May 01, 2014 at 08:40:03 PM, Ian Campbell wrote: This is my fourth cut at an upstreamable series based upon the https://github.com/linux-sunxi/u-boot-sunxi.git#sunxi tree. The intention is to present a minimal starting point for upstreaming to which support for other processors, peripherals, boards etc can be added in the future. Therefore this has been stripped right back and currently supports only sun7i processors (AKA Allwinner A20) and the cubietruck board. Supported peripherals are UART, MMC and Ethernet. The code here is from u-boot-sunxi.git#sunxi[0] changeset based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. and applies to u-boot v2014.04. Changes in v4: - Resynced with u-boot-sunxi.git d9fe0a1e061e which pulled lots of fixes for Marek's review comments. It would be really nice if you could list the changes instead of pointing to some random object in some random git repository at to me unknown address. The address was further down this introductory mail, in the footnote referenced by [0] above: https://github.com/linux-sunxi/u-boot-sunxi.git Log log from v3 to v4 is below. You can ignore the A23 and sun6i changes since they don't affect this initial upstreaming series. Ian. commit d9fe0a1e061e2bde6c24a0f7cef4f5023f3bd579 Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:19:02 2014 +0100 sunxi: mksunxiboot: remove unnecessary casts. In particular this removes the possibility that boot_buf is misaligned in gen_check_sum by making the type explicit. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit c81ab9443997bd8ed63f576a2420a77cc5f7d0e7 Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:19:01 2014 +0100 sunxi: mksunxiboot: remove dead code. Requested by Marek during upstream review. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit ded94b565973d6ffa6625196af7b7f69fc1ca909 Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:19:00 2014 +0100 sunxi: mksunxiboot: use stdint.h types Requested by Marek during upstream review. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit 1c814095b5fedbd44310290cfdbb7eb9ec4a96c0 Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:18:59 2014 +0100 sunxi: mmc: move pinmux configuration to board setup. Requested by Marek as part of upstream review. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit 402c300dcb082794a481cce4caebb0d4cb315ee9 Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:18:58 2014 +0100 sunxi: remove unnecessary network config items CONFIG_CMD_SNTP doesn't do anything useful withou CONFIG_CMD_DATE (which sunxi doesn't set, nor does it provide the required rtc_set() function). Also drop some of the more obscure BOOTP options which there doesn't seem to be any need for. Highlighted by Marek during upstream review. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit 543fd1c8d959f2ce35f6c245ba4751bfe14331ee Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:18:57 2014 +0100 sunxi: move gmac glue under board/sunxi The other existing designware glue files are under board/*. Marek requested that it move out of drivers/net as part of upstream review. His suggestion was to move to arch/arm/.../sunxi but I found all the others under board/* Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit 4bad0496d51f98e8691dbfe792201cc6830f5a39 Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:18:56 2014 +0100 sunxi: log failure of sunxi_?mac_initialize. Also propagate errors. Requested by Marek as part of upstream review. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit baab9f178f72239beccdaed013a809ba1f67f32a Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:18:55 2014 +0100 sunxi: correct cpu_eth_init ifdeffery The cpu_eth_init function should be ifdef CONFIG_CMD_NET and the individual driver init functions should use the corresponding CONFIG_FOO. Requested by Marek during upstream review. Signed-off-by: Ian Campbell i...@hellion.org.uk Signed-off-by: Hans de Goede hdego...@redhat.com commit c224b4d19831ddfc4de002b75bc923dda855502c Author: Ian Campbell i...@hellion.org.uk Date: Mon Apr 28 20:18:54 2014 +0100 sunxi: remove unbounded loops from DRAM setup. Introduce a helper
Re: [U-Boot] [PATCH v4 2/9] sunxi: add sun7i pinmux and gpio support
On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: This patch adds the basic pinmux and gpio support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Ma Haijun mahaij...@gmail.com Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Henrik Nordström hen...@henriknordstrom.net Signed-off-by: Ian Campbell i...@hellion.org.uk Reviewed-by: Tom Rini tr...@ti.com Acked-by: Marek Vasut ma...@denx.de Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - clock_get_pll6 moved to clock_sun4i.c. - fixed coding style of comment in read_timer. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 2/9] sunxi: add sun7i pinmux and gpio support
On Thu, 2014-05-01 at 20:50 +0100, Ian Campbell wrote: On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: This patch adds the basic pinmux and gpio support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Ma Haijun mahaij...@gmail.com Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Henrik Nordström hen...@henriknordstrom.net Signed-off-by: Ian Campbell i...@hellion.org.uk Reviewed-by: Tom Rini tr...@ti.com Acked-by: Marek Vasut ma...@denx.de Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - clock_get_pll6 moved to clock_sun4i.c. - fixed coding style of comment in read_timer. Sigh, This is actually for patch 1/9. let me try that again... Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 2/9] sunxi: add sun7i pinmux and gpio support
On Thu, 2014-05-01 at 20:51 +0100, Ian Campbell wrote: On Thu, 2014-05-01 at 20:50 +0100, Ian Campbell wrote: On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: This patch adds the basic pinmux and gpio support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Ma Haijun mahaij...@gmail.com Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Henrik Nordström hen...@henriknordstrom.net Signed-off-by: Ian Campbell i...@hellion.org.uk Reviewed-by: Tom Rini tr...@ti.com Acked-by: Marek Vasut ma...@denx.de Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - clock_get_pll6 moved to clock_sun4i.c. - fixed coding style of comment in read_timer. Sigh, This is actually for patch 1/9. let me try that again... This patch was unchanged in v4. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 1/9] sunxi: add sun7i clocks and timer support.
On Thu, 2014-05-01 at 21:28 +0200, Marek Vasut wrote: On Thursday, May 01, 2014 at 08:40:44 PM, Ian Campbell wrote: This patch adds the basic clocks and timer support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Some of the code here is common to multiple sunxi subarchtectures, hence files are named sun4i which is the earliest similar variant. Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. I have no idea what this changelog entry tells me, I will have to review this entire patch anew. This was mainly for my benefit, so I could track which u-boot-sunxi.git version each commit was most recently sync'd with. This particular patch needed no changes for the rebasing. I'm going to go through the rest now and reply with a proper v3..v4 changelog. If I don't reply to a particular patch it means nothing much changed. [...] +void clock_set_pll1(int hz) +{ + int i = 0; + int axi, ahb, apb0; + struct sunxi_ccm_reg * const ccm = + (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + + /* Find target frequency */ + while (pll1_para[i].freq hz) + i++; You can just do a for (...) cycle here, instead of the unbounded while cycle. it's not unbounded, the array has a sentinal value. Also, I think hz will always be positive, thus int hz - unsigned int hz . Ack. Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/9] sunxi: add sun7i dram setup support
On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: This patch adds DRAM initialisation support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com Signed-off-by: Stefan Roese s...@denx.de Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - removed unbounded loops - support more dram clock speeds. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 1/9] sunxi: add sun7i clocks and timer support.
On Thu, 2014-05-01 at 20:49 +0100, Ian Campbell wrote: On Thu, 2014-05-01 at 21:28 +0200, Marek Vasut wrote: On Thursday, May 01, 2014 at 08:40:44 PM, Ian Campbell wrote: This patch adds the basic clocks and timer support for the Allwinner A20 (sun7i) processor. This code will not been compiled until the build is hooked up in a later patch. It has been split out to keep the patches manageable. Some of the code here is common to multiple sunxi subarchtectures, hence files are named sun4i which is the earliest similar variant. Signed-off-by: Alexandru Gagniuc mr.nuke...@gmail.com Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Emilio López emi...@elopez.com.ar Signed-off-by: Hans de Goede hdego...@redhat.com Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. I have no idea what this changelog entry tells me, I will have to review this entire patch anew. This was mainly for my benefit, so I could track which u-boot-sunxi.git version each commit was most recently sync'd with. This particular patch needed no changes for the rebasing. Correction, in this one: - clock_get_pll6 moved to clock_sun4i.c. - fixed coding style of comment in read_timer. Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 6/9] sunxi: add gmac Ethernet support
On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: Add support for the GMAC Ethernet controller on Allwinner A20 (sun7i) processors. Enable for the Cubietruck. Signed-off-by: Chen-Yu Tsai w...@csie.org Signed-off-by: Jens Kuske jensku...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - Use correct ifdef's in and around cpu_eth_init - Log and propagate errors from sunxi_gmac_initialize - Move glue from drivers/net/sunxi_gmac.c to board/sunxi/gmac.c - Remove SNTP and useless BOOTP config options. Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 7/9] sunxi: mmc support
On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: This adds support for the MMC controller on the Allwinner A20 (sun7i) processor. Signed-off-by: Henrik Nordstrom hen...@henriknordstrom.net Signed-off-by: Luke Leighton l...@lkcl.net Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Wills Wang wills.wang.o...@gmail.com Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Stefan Roese s...@denx.de Cc: Tom Cubie mr.hip...@gmail.com Cc: Aaron Maoye leafy.m...@allwinnertech.com Cc: Pantelis Antoniou pa...@antoniou-consulting.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - Moved pinmux setup from drivers/mmc/sunxi_mmc.c to board/sunxi/board.c - Use setbits_le32 to manipulate the ahb0 gate. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v5 06/12] ums: always initialize mmc before ums_disk_init()
On 04/28/2014 01:13 PM, Mateusz Zalega wrote: In cases when MMC hadn't been initialized before, ie. by the user or other subsystem, it was still uninitialized while UMS media capacity check, leading to broken ums command. UMS has to initialize resources it uses. It's probably better to just switch from find_mmc_device() to get_device(), which does the initialization internally. patch ums: use get_device() not find_mmc_device() does this. http://patchwork.ozlabs.org/patch/344328/ That said, at this point, it's probably simplest to just apply this series, and I'll rebase my series on top of this in a day or two. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 8/9] sunxi: non-FEL SPL boot support for sun7i
On Thu, 2014-05-01 at 19:40 +0100, Ian Campbell wrote: Add support for booting from an MMC card. Signed-off-by: Stefan Roese s...@denx.de Signed-off-by: Henrik Nordström hen...@henriknordstrom.net Signed-off-by: Ian Campbell i...@hellion.org.uk Cc: Tom Cubie mr.hip...@gmail.com --- v4: Based on d9fe0a1e061e sunxi: mksunxiboot: remove unnecessary casts. - fixed in mksunxiboot.c - use stdint.h types - drop unused code - fix the types to avoid casting and potential misalignments ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/8] ums: remove error-checking of MMC device size
On 04/30/2014 03:13 PM, Stephen Warren wrote: From: Stephen Warren swar...@nvidia.com There's no reason to believe that an MMC device will incorrectly report its capacity. Remove error checking of this value from ums_disk_init() to simplify it. Hmm. I guess this check might trigger if you tried to export an SD card slot over UMS, yet there was no SD card present. Still, patch 6/8 in this series resolves this, since at least for MMC devices, get_device() calls mmc_init() internally, and hence returns an error in this case. This is more direct that checking the device size. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] wandboard: add Future Eletronics 7 WVGA LCD extension board
This adds support for the 7 WVGA produced by Future Eletronics and make it dynamically detect if it is connected or not based on the touchscreen controller. Signed-off-by: Otavio Salvador ota...@ossystems.com.br --- board/wandboard/wandboard.c | 184 +--- include/configs/wandboard.h | 36 - 2 files changed, 193 insertions(+), 27 deletions(-) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index f1951dc..f781031 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Freescale Semiconductor, Inc. + * Copyright (C) 2014 O.S. Systems Software LTDA. * * Author: Fabio Estevam fabio.este...@freescale.com * @@ -15,18 +16,19 @@ #include asm/arch/sys_proto.h #include asm/gpio.h #include asm/imx-common/iomux-v3.h +#include asm/imx-common/mxc_i2c.h #include asm/imx-common/boot_mode.h +#include asm/imx-common/video.h #include asm/io.h #include linux/sizes.h #include common.h #include fsl_esdhc.h -#include ipu_pixfmt.h #include mmc.h #include miiphy.h #include netdev.h -#include linux/fb.h #include phy.h #include input.h +#include i2c.h DECLARE_GLOBAL_DATA_PTR; @@ -41,6 +43,10 @@ DECLARE_GLOBAL_DATA_PTR; #define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS) +#define I2C_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ + PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ + PAD_CTL_ODE | PAD_CTL_SRE_FAST) + #define USDHC1_CD_GPIO IMX_GPIO_NR(1, 2) #define USDHC3_CD_GPIO IMX_GPIO_NR(3, 9) #define ETH_PHY_RESET IMX_GPIO_NR(3, 29) @@ -210,50 +216,174 @@ int board_phy_config(struct phy_device *phydev) } #if defined(CONFIG_VIDEO_IPUV3) -static struct fb_videomode const hdmi = { - .name = HDMI, - .refresh= 60, - .xres = 1024, - .yres = 768, - .pixclock = 15385, - .left_margin= 220, - .right_margin = 40, - .upper_margin = 21, - .lower_margin = 7, - .hsync_len = 60, - .vsync_len = 10, - .sync = FB_SYNC_EXT, - .vmode = FB_VMODE_NONINTERLACED +struct i2c_pads_info i2c2_pad_info = { + .scl = { + .i2c_mode = MX6_PAD_KEY_COL3__I2C2_SCL + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gpio_mode = MX6_PAD_KEY_COL3__GPIO4_IO12 + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gp = IMX_GPIO_NR(4, 12) + }, + .sda = { + .i2c_mode = MX6_PAD_KEY_ROW3__I2C2_SDA + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gpio_mode = MX6_PAD_KEY_ROW3__GPIO4_IO13 + | MUX_PAD_CTRL(I2C_PAD_CTRL), + .gp = IMX_GPIO_NR(4, 13) + } }; -int board_video_skip(void) -{ - int ret; +static iomux_v3_cfg_t const fwadapt_7wvga_pads[] = { + MX6_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK, + MX6_PAD_DI0_PIN2__IPU1_DI0_PIN02, /* HSync */ + MX6_PAD_DI0_PIN3__IPU1_DI0_PIN03, /* VSync */ + MX6_PAD_DI0_PIN4__IPU1_DI0_PIN04 + | MUX_PAD_CTRL(PAD_CTL_DSE_120ohm), /* Contrast */ + MX6_PAD_DI0_PIN15__IPU1_DI0_PIN15, /* DISP0_DRDY */ + + MX6_PAD_DISP0_DAT0__IPU1_DISP0_DATA00, + MX6_PAD_DISP0_DAT1__IPU1_DISP0_DATA01, + MX6_PAD_DISP0_DAT2__IPU1_DISP0_DATA02, + MX6_PAD_DISP0_DAT3__IPU1_DISP0_DATA03, + MX6_PAD_DISP0_DAT4__IPU1_DISP0_DATA04, + MX6_PAD_DISP0_DAT5__IPU1_DISP0_DATA05, + MX6_PAD_DISP0_DAT6__IPU1_DISP0_DATA06, + MX6_PAD_DISP0_DAT7__IPU1_DISP0_DATA07, + MX6_PAD_DISP0_DAT8__IPU1_DISP0_DATA08, + MX6_PAD_DISP0_DAT9__IPU1_DISP0_DATA09, + MX6_PAD_DISP0_DAT10__IPU1_DISP0_DATA10, + MX6_PAD_DISP0_DAT11__IPU1_DISP0_DATA11, + MX6_PAD_DISP0_DAT12__IPU1_DISP0_DATA12, + MX6_PAD_DISP0_DAT13__IPU1_DISP0_DATA13, + MX6_PAD_DISP0_DAT14__IPU1_DISP0_DATA14, + MX6_PAD_DISP0_DAT15__IPU1_DISP0_DATA15, + MX6_PAD_DISP0_DAT16__IPU1_DISP0_DATA16, + MX6_PAD_DISP0_DAT17__IPU1_DISP0_DATA17, + + MX6_PAD_SD4_DAT2__GPIO2_IO10 + | MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_BKLEN */ + MX6_PAD_SD4_DAT3__GPIO2_IO11 + | MUX_PAD_CTRL(NO_PAD_CTRL), /* DISP0_VDDEN */ +}; - ret = ipuv3_fb_init(hdmi, 0, IPU_PIX_FMT_RGB24); +static void do_enable_hdmi(struct display_info_t const *dev) +{ + imx_enable_hdmi_phy(); +} - if (ret) { - printf(HDMI cannot be configured: %d\n, ret); - return ret; - } +static int detect_i2c(struct display_info_t const *dev) +{ + return (0 == i2c_set_bus_num(dev-bus)) + (0 == i2c_probe(dev-addr)); +} - imx_enable_hdmi_phy(); +static void enable_fwadapt_7wvga(struct display_info_t const *dev) +{ +