[U-Boot] [PATCH 1/2] imx: mx6q/dl sabre_common: Move MMC ENV offset to 512KB position
Set the CONFIG_ENV_OFFSET from 384KB to 512KB offset, so we will have larger space for u-boot image. When enabling NAND flash support feature, the u-boot image size has exceeded the 384KB, which causes overlay to the environment variables storage. Signed-off-by: Ye.Li b37...@freescale.com --- include/configs/mx6sabre_common.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index c81e9e9..1e10422 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -251,7 +251,7 @@ #define CONFIG_ENV_IS_IN_MMC #if defined(CONFIG_ENV_IS_IN_MMC) -#define CONFIG_ENV_OFFSET (6 * 64 * 1024) +#define CONFIG_ENV_OFFSET (8 * 64 * 1024) #endif #define CONFIG_OF_LIBFDT -- 1.7.4.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] imx: mx6q/dlsabreauto: And NAND flash support
The i.MX6Q/DL sabreauto board has one NAND socket, set the CONFIG_NAND_MXS and relevant NAND configurations to enable the MXS NAND flash driver. Add board level codes to set IOMUX and clock for GPMI-NAND and BCH module. Signed-off-by: Ye.Li b37...@freescale.com --- board/freescale/mx6qsabreauto/mx6qsabreauto.c | 65 + include/configs/mx6qsabreauto.h | 16 ++ 2 files changed, 81 insertions(+), 0 deletions(-) diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 42ae6fa..714a98d 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -46,6 +46,11 @@ DECLARE_GLOBAL_DATA_PTR; PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | \ PAD_CTL_ODE | PAD_CTL_SRE_FAST) +#define GPMI_PAD_CTRL0 (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP) +#define GPMI_PAD_CTRL1 (PAD_CTL_DSE_40ohm | PAD_CTL_SPEED_MED | \ + PAD_CTL_SRE_FAST) +#define GPMI_PAD_CTRL2 (GPMI_PAD_CTRL0 | GPMI_PAD_CTRL1) + #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) int dram_init(void) @@ -200,6 +205,62 @@ int board_mmc_init(bd_t *bis) } #endif +#ifdef CONFIG_NAND_MXS +iomux_v3_cfg_t gpmi_pads[] = { + MX6_PAD_NANDF_CLE__NAND_CLE | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_ALE__NAND_ALE | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_WP_B__NAND_WP_B | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_RB0__NAND_READY_B | MUX_PAD_CTRL(GPMI_PAD_CTRL0), + MX6_PAD_NANDF_CS0__NAND_CE0_B | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_SD4_CMD__NAND_RE_B | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_SD4_CLK__NAND_WE_B | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D0__NAND_DATA00 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D1__NAND_DATA01 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D2__NAND_DATA02 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D3__NAND_DATA03 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D4__NAND_DATA04 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D5__NAND_DATA05 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D6__NAND_DATA06 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_NANDF_D7__NAND_DATA07 | MUX_PAD_CTRL(GPMI_PAD_CTRL2), + MX6_PAD_SD4_DAT0__NAND_DQS | MUX_PAD_CTRL(GPMI_PAD_CTRL1), +}; + +static void setup_gpmi_nand(void) +{ + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + + /* config gpmi nand iomux */ + imx_iomux_v3_setup_multiple_pads(gpmi_pads, ARRAY_SIZE(gpmi_pads)); + + /* gate ENFC_CLK_ROOT clock first,before clk source switch */ + clrbits_le32(mxc_ccm-CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK); + clrbits_le32(mxc_ccm-CCGR4, MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_MASK); + + /* config gpmi and bch clock to 100 MHz */ + clrsetbits_le32(mxc_ccm-cs2cdr, + MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK | + MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK | + MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK, + MXC_CCM_CS2CDR_ENFC_CLK_PODF(0) | + MXC_CCM_CS2CDR_ENFC_CLK_PRED(3) | + MXC_CCM_CS2CDR_ENFC_CLK_SEL(3)); + + /* enable ENFC_CLK_ROOT clock */ + setbits_le32(mxc_ccm-CCGR2, MXC_CCM_CCGR2_IOMUX_IPT_CLK_IO_MASK); + + /* enable gpmi and bch clock gating */ + setbits_le32(mxc_ccm-CCGR4, +MXC_CCM_CCGR4_RAWNAND_U_BCH_INPUT_APB_MASK | +MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_BCH_MASK | +MXC_CCM_CCGR4_RAWNAND_U_GPMI_BCH_INPUT_GPMI_IO_MASK | +MXC_CCM_CCGR4_RAWNAND_U_GPMI_INPUT_APB_MASK | +MXC_CCM_CCGR4_PL301_MX6QPER1_BCH_OFFSET); + + /* enable apbh clock gating */ + setbits_le32(mxc_ccm-CCGR0, MXC_CCM_CCGR0_APBHDMA_MASK); +} +#endif + int mx6_rgmii_rework(struct phy_device *phydev) { unsigned short val; @@ -336,6 +397,10 @@ int board_early_init_f(void) #ifdef CONFIG_VIDEO_IPUV3 setup_display(); #endif + +#ifdef CONFIG_NAND_MXS + setup_gpmi_nand(); +#endif return 0; } diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h index 235dd6d..3f1c88e 100644 --- a/include/configs/mx6qsabreauto.h +++ b/include/configs/mx6qsabreauto.h @@ -48,4 +48,20 @@ #define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 10 +/* NAND flash command */ +#define CONFIG_CMD_NAND +#define CONFIG_CMD_NAND_TRIMFFS + +/* NAND stuff */ +#define CONFIG_NAND_MXS +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_SYS_NAND_BASE 0x4000 +#define CONFIG_SYS_NAND_5_ADDR_CYCLE +#define CONFIG_SYS_NAND_ONFI_DETECTION + +/* DMA stuff, needed for GPMI/MXS NAND support */ +#define CONFIG_APBH_DMA +#define
Re: [U-Boot] [PATCH] powerpc: remove orphaned boards mcc200 and prs200
Hi Nikita, Thanks for cleaning up! On Fri, 7 Nov 2014 14:17:18 +0200 Nikita Kiryanov nik...@compulab.co.il wrote: diff --git a/doc/README.scrapyard b/doc/README.scrapyard index bd4dd3c..bfaabeb 100644 --- a/doc/README.scrapyard +++ b/doc/README.scrapyard @@ -15,6 +15,8 @@ BoardArchCPUCommit Removed Last known m TOP5200 powerpc mpc5200- - Reinhard Meyer reinhard.me...@emk-elektronik.de TOP860powerpc mpc860 - - Reinhard Meyer reinhard.me...@emk-elektronik.de TOP9000 arm at91sam9xeXXX - - Reinhard Meyer reinhard.me...@emk-elektronik.de +PRS200powerpc mpc5200- 2014-11-05 +MCC200powerpc mpc5200- 2014-11-05 TQM8272 powerpc mpc8260f06f9a1 2014-10-27 Wolfgang Denk w...@denx.de TQM8260 powerpc mpc8260ccc1950 2014-10-27 Wolfgang Denk w...@denx.de IDS8247 powerpc mpc82606afb357 2014-10-27 Heiko Schocher h...@denx.de I think we are supposed to fill blank fields that have been added by former commits (in this case, Commit/Removed fields of TOP*) and then add new lines at the top of them. (i.e. eventually this list is sorted in reverse chronological order.) At the moment, nobody knows when PRS200/MCC200 will be removed (= when this patch will be applied). Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4 v4] arm: socfpga: dts: Add Cadence QSPI DT node to socfpga.dtsi
On Fri 2014-11-07 18:26:05, Stefan Roese wrote: Hi Simon, On 07.11.2014 18:21, Simon Glass wrote: + qspi: spi@ff705000 { + compatible = cadence,qspi; + #address-cells = 1; + #size-cells = 0; + reg = 0xff705000 0x1000, + 0xffa0 0x1000; + interrupts = 0 151 4; + clocks = qspi_clk; + ext-decoder = 0; /* external decoder */ + num-chipselect = 4; + fifo-depth = 128; + bus-num = 2; + status = disabled; + }; + Is this the same binding as Linux? Can you please bring in the binding document too? Some of these feel like they should have a manufacture, prefix. Yes, its from Linux. But not from kernel.org but from the Altera Rocketboards.org version (v3.16). So the bindings might change if this driver would be pushed to mainline Linux. I guess it would be good to submit the binding to Linux for review, so that we don't end up with two incompatible bindings... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v7] net/phy: Add support for CS4315/CS4340 PHY
Add support for Cortina CS4315/CS4340 10G PHY. - This driver loads CS43xx firmware from NOR/NAND/SPI/SD device to initialize Cortina PHY. - Cortina PHY has non-standard offset of PHY ID registers, thus we define own get_phy_id() to override default get_phy_id(). - To define macro CONFIG_PHY_CORTINA will enable this driver. Signed-off-by: Shengzhou Liu shengzhou@freescale.com --- v7: reorder it in alphabetical order in Makefile v6: polish it in phy.c and phy.h in alphabetical order v5: fix unclaimed variable in case of nand boot. v4: add support for loading cortina phy ucode from NAND/SPI/SD v3: move devad as '0' in cortina.c instead of in phy.c v2: no change. drivers/net/phy/Makefile | 1 + drivers/net/phy/cortina.c | 333 ++ drivers/net/phy/phy.c | 3 + include/cortina.h | 75 +++ include/phy.h | 2 + 5 files changed, 414 insertions(+) create mode 100644 drivers/net/phy/cortina.c create mode 100644 include/cortina.h diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 9556536..f46bf00 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_PHYLIB) += phy.o obj-$(CONFIG_PHYLIB_10G) += generic_10g.o obj-$(CONFIG_PHY_ATHEROS) += atheros.o obj-$(CONFIG_PHY_BROADCOM) += broadcom.o +obj-$(CONFIG_PHY_CORTINA) += cortina.o obj-$(CONFIG_PHY_DAVICOM) += davicom.o obj-$(CONFIG_PHY_ET1011C) += et1011c.o obj-$(CONFIG_PHY_LXT) += lxt.o diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c new file mode 100644 index 000..254f056 --- /dev/null +++ b/drivers/net/phy/cortina.c @@ -0,0 +1,333 @@ +/* + * Cortina CS4315/CS4340 10G PHY drivers + * + * SPDX-License-Identifier: GPL-2.0+ + * + * Copyright 2014 Freescale Semiconductor, Inc. + * + */ + +#include config.h +#include common.h +#include malloc.h +#include linux/ctype.h +#include linux/string.h +#include linux/err.h +#include phy.h +#include cortina.h +#ifdef CONFIG_SYS_CORTINA_FW_IN_NAND +#include nand.h +#elif defined(CONFIG_SYS_CORTINA_FW_IN_SPIFLASH) +#include spi_flash.h +#elif defined(CONFIG_SYS_CORTINA_FW_IN_MMC) +#include mmc.h +#endif + +#ifndef CONFIG_PHYLIB_10G +#error The Cortina PHY needs 10G support +#endif + +struct cortina_reg_config cortina_reg_cfg[] = { + /* CS4315_enable_sr_mode */ + {VILLA_GLOBAL_MSEQCLKCTRL, 0x8004}, + {VILLA_MSEQ_OPTIONS, 0xf}, + {VILLA_MSEQ_PC, 0x0}, + {VILLA_MSEQ_BANKSELECT,0x4}, + {VILLA_LINE_SDS_COMMON_SRX0_RX_CPA, 0x55}, + {VILLA_LINE_SDS_COMMON_SRX0_RX_LOOP_FILTER, 0x30}, + {VILLA_DSP_SDS_SERDES_SRX_DFE0_SELECT, 0x1}, + {VILLA_DSP_SDS_DSP_COEF_DFE0_SELECT, 0x2}, + {VILLA_LINE_SDS_COMMON_SRX0_RX_CPB, 0x2003}, + {VILLA_DSP_SDS_SERDES_SRX_FFE_DELAY_CTRL, 0xF047}, + {VILLA_MSEQ_ENABLE_MSB, 0x}, + {VILLA_MSEQ_SPARE21_LSB, 0x6}, + {VILLA_MSEQ_RESET_COUNT_LSB, 0x0}, + {VILLA_MSEQ_SPARE12_MSB, 0x}, + /* +* to invert the receiver path, uncomment the next line +* write (VILLA_MSEQ_SPARE12_MSB, 0x4000) +* +* SPARE2_LSB is used to configure the device while in sr mode to +* enable power savings and to use the optical module LOS signal. +* in power savings mode, the internal prbs checker can not be used. +* if the optical module LOS signal is used as an input to the micro +* code, then the micro code will wait until the optical module +* LOS = 0 before turning on the adaptive equalizer. +* Setting SPARE2_LSB bit 0 to 1 places the devie in power savings mode +* while setting bit 0 to 0 disables power savings mode. +* Setting SPARE2_LSB bit 2 to 0 configures the device to use the +* optical module LOS signal while setting bit 2 to 1 configures the +* device so that it will ignore the optical module LOS SPARE2_LSB = 0 +*/ + + /* enable power savings, ignore optical module LOS */ + {VILLA_MSEQ_SPARE2_LSB, 0x5}, + + {VILLA_MSEQ_SPARE7_LSB, 0x1e}, + {VILLA_MSEQ_BANKSELECT, 0x4}, + {VILLA_MSEQ_SPARE9_LSB, 0x2}, + {VILLA_MSEQ_SPARE3_LSB, 0x0F53}, + {VILLA_MSEQ_SPARE3_MSB, 0x2006}, + {VILLA_MSEQ_SPARE8_LSB, 0x3FF7}, + {VILLA_MSEQ_SPARE8_MSB, 0x0A46}, + {VILLA_MSEQ_COEF8_FFE0_LSB, 0xD500}, + {VILLA_MSEQ_COEF8_FFE1_LSB, 0x0200}, + {VILLA_MSEQ_COEF8_FFE2_LSB, 0xBA00}, + {VILLA_MSEQ_COEF8_FFE3_LSB, 0x0100}, + {VILLA_MSEQ_COEF8_FFE4_LSB, 0x0300}, + {VILLA_MSEQ_COEF8_FFE5_LSB, 0x0300}, + {VILLA_MSEQ_COEF8_DFE0_LSB, 0x0700}, + {VILLA_MSEQ_COEF8_DFE0N_LSB, 0x0E00}, + {VILLA_MSEQ_COEF8_DFE1_LSB, 0x0B00}, + {VILLA_DSP_SDS_DSP_COEF_LARGE_LEAK, 0x2}, + {VILLA_DSP_SDS_SERDES_SRX_DAC_ENABLEB_LSB, 0xD000}, + {VILLA_MSEQ_POWER_DOWN_LSB, 0x}, + {VILLA_MSEQ_POWER_DOWN_MSB, 0x0}, + {VILLA_MSEQ_CAL_RX_SLICER, 0x80}, +
Re: [U-Boot] [PATCH v7] net/phy: Add support for CS4315/CS4340 PHY
-Original Message- From: Shengzhou Liu [mailto:shengzhou@freescale.com] Sent: Monday, November 10, 2014 6:32 PM To: u-boot@lists.denx.de; Sun York-R58495; joe.hershber...@gmail.com Cc: Liu Shengzhou-B36685 Subject: [PATCH v7] net/phy: Add support for CS4315/CS4340 PHY The link of previous version: http://patchwork.ozlabs.org/patch/350162/ Joe, York please review and ACK this version. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] imx: mx6q/dlsabreauto: And NAND flash support
On Mon, Nov 10, 2014 at 6:29 AM, Ye.Li b37...@freescale.com wrote: +#ifdef CONFIG_NAND_MXS +iomux_v3_cfg_t gpmi_pads[] = { This can be made 'static'. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] loadb problem. Hangs on START_CHAR
Upon further investigation, it seems like the board DOES receive the 0x01 START_CHAR. An RS232 sniffer shows that the 0x01 is being sent, and the board answers 'S'. It does not show on the console though. I will need to go deeper into the code to see why it fails. Both CKermit and TeraTerm makes several tries, but nothing is transferred. -- View this message in context: http://u-boot.10912.n7.nabble.com/loadb-problem-Hangs-on-START-CHAR-tp195144p195379.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] loadb problem. Hangs on START_CHAR
Dear bomellberg, In message 1415622808801-195379.p...@n7.nabble.com you wrote: Upon further investigation, it seems like the board DOES receive the 0x01 START_CHAR. An RS232 sniffer shows that the 0x01 is being sent, and the board answers 'S'. It does not show on the console though. I will need to go deeper into the code to see why it fails. Both CKermit and TeraTerm makes several tries, but nothing is transferred. I just tested loadb on a MPC5200 system running current top of tree against C-Kermit 8.0.211, 10 Apr 2004, for Linux; it works without any problems here. Which sort of hardware are you using? 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 the code and the comments disagree, then both are probably wrong.- Norm Schryer ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] loadb problem. Hangs on START_CHAR
Dear Wolfgang, Which sort of hardware are you using? I am using an NXP LPC4337 cpu with external SDRAM and SPIFI flash. No ethernet. My config files are based upon code for the Embedded Artists LPC4357 demo board (ea-lpc4357.h) See my first post. Thanks, /Bo -- View this message in context: http://u-boot.10912.n7.nabble.com/loadb-problem-Hangs-on-START-CHAR-tp195144p195381.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 v4] sun6i: Add basic axp221 driver
From: Oliver Schinagl oli...@schinagl.nl The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Hans de Goede hdego...@redhat.com -- Changes in v2: -Rebase Changes in v3: -Add support for all dldo and aldo-s -Add Kconfig option to select building AXP221 and to select voltage of dldo and aldo-s Changes in v4: -Add axp221_setbits helper function -Use symbolic names for enabled bits in CTRL1 - CTRL3 registers --- board/sunxi/board.c| 26 +++ drivers/power/Kconfig | 47 + drivers/power/Makefile | 1 + drivers/power/axp221.c | 186 + include/axp221.h | 50 + 5 files changed, 310 insertions(+) create mode 100644 drivers/power/axp221.c create mode 100644 include/axp221.h diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 03890c8..e6ec5b8 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -19,6 +19,9 @@ #ifdef CONFIG_AXP209_POWER #include axp209.h #endif +#ifdef CONFIG_AXP221_POWER +#include axp221.h +#endif #include asm/arch/clock.h #include asm/arch/cpu.h #include asm/arch/dram.h @@ -169,6 +172,29 @@ void sunxi_board_init(void) power_failed |= axp209_set_ldo3(2800); power_failed |= axp209_set_ldo4(2800); #endif +#ifdef CONFIG_AXP221_POWER + power_failed = axp221_init(); + power_failed |= axp221_set_dcdc1(3000); + power_failed |= axp221_set_dcdc2(1200); + power_failed |= axp221_set_dcdc3(1200); + power_failed |= axp221_set_dcdc4(1200); + power_failed |= axp221_set_dcdc5(1500); +#if CONFIG_AXP221_DLDO1_VOLT != -1 + power_failed |= axp221_set_dldo1(CONFIG_AXP221_DLDO1_VOLT); +#endif +#if CONFIG_AXP221_DLDO4_VOLT != -1 + power_failed |= axp221_set_dldo4(CONFIG_AXP221_DLDO4_VOLT); +#endif +#if CONFIG_AXP221_ALDO1_VOLT != -1 + power_failed |= axp221_set_aldo1(CONFIG_AXP221_ALDO1_VOLT); +#endif +#if CONFIG_AXP221_ALDO2_VOLT != -1 + power_failed |= axp221_set_aldo2(CONFIG_AXP221_ALDO2_VOLT); +#endif +#if CONFIG_AXP221_ALDO3_VOLT != -1 + power_failed |= axp221_set_aldo3(CONFIG_AXP221_ALDO3_VOLT); +#endif +#endif printf(DRAM:); ramsize = sunxi_dram_init(); diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index e69de29..1ec7c0e 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -0,0 +1,47 @@ +config AXP221_POWER + boolean axp221 pmic support + depends on MACH_SUN6I + default y + ---help--- + Say y here to enable support for the axp221 pmic found on most sun6i + (A31) boards. + +config AXP221_DLDO1_VOLT + int axp221 dldo1 voltage + depends on AXP221_POWER + default -1 + ---help--- + Set the voltage (mV) to program the axp221 dldo1 at, set to -1 to + disable dldo1. + +config AXP221_DLDO4_VOLT + int axp221 dldo4 voltage + depends on AXP221_POWER + default -1 + ---help--- + Set the voltage (mV) to program the axp221 dldo4 at, set to -1 to + disable dldo4. + +config AXP221_ALDO1_VOLT + int axp221 aldo1 voltage + depends on AXP221_POWER + default -1 + ---help--- + Set the voltage (mV) to program the axp221 aldo1 at, set to -1 to + disable aldo1. + +config AXP221_ALDO2_VOLT + int axp221 aldo2 voltage + depends on AXP221_POWER + default -1 + ---help--- + Set the voltage (mV) to program the axp221 aldo2 at, set to -1 to + disable aldo2. + +config AXP221_ALDO3_VOLT + int axp221 aldo3 voltage + depends on AXP221_POWER + default -1 + ---help--- + Set the voltage (mV) to program the axp221 aldo3 at, set to -1 to + disable aldo3. diff --git a/drivers/power/Makefile b/drivers/power/Makefile index dc64e4d..04bd996 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_AXP152_POWER) += axp152.o obj-$(CONFIG_AXP209_POWER) += axp209.o +obj-$(CONFIG_AXP221_POWER) += axp221.o obj-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o obj-$(CONFIG_FTPMU010_POWER) += ftpmu010.o obj-$(CONFIG_TPS6586X_POWER) += tps6586x.o diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c new file mode 100644 index 000..941193a --- /dev/null +++ b/drivers/power/axp221.c @@ -0,0 +1,186 @@ +/* + * (C) Copyright 2013 Oliver Schinagl oli...@schinagl.nl + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include errno.h +#include asm/arch/p2wi.h +#include axp221.h + +static u8 axp221_mvolt_to_cfg(int mvolt, int min, int max, int div) +{ + if (mvolt min) + mvolt = min; + else if (mvolt max) + mvolt = max; + + return (mvolt - min) / div; +} + +static int axp221_setbits(u8 reg, u8 bits) +{ + int ret; + u8 val; + + ret = p2wi_read(reg, val); + if (ret) + return ret; + + val |=
Re: [U-Boot] ARM: PSCI 0.1 vs 0.2
On 10/11/14 12:51, Jan Kiszka wrote: Hi Marc, what is the motivation to expose a PSCI 0.1 interface in U-boot, instead of 0.2? Support for preexisting users of 0.1? The kernel seems to be happy with both, and I'm now wondering if we should actually add the legacy version to Jailhouse as well (I hope we can avoid this). The initial rational was simple: at the time this code was written, the 0.2 spec still in review, and nobody was implementing it. Supporting 0.1 was the only viable use-case. Still studying the logic: Is it possible to provide both interfaces, and would it make sense? Supporting both is very easy. Just output the 0.2 function numbers that actually make sense for 0.1 and have both compatible strings. Thanks, M. -- Jazz is not dead. It just smells funny... ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM: flush_dcache_all for PSCI
On 10/11/14 12:57, Jan Kiszka wrote: Hi all, I'm trying to get Marc's CPU hotplug-anabling patch [1] for sunxi working on a B-Pi. After the first discussion it became clear that we need something like flush_dcache_all in the PSCI monitor (I don't think we need an icache flush, do we?). Does anyone have a clever suggestion No, I-cache can be left alone. how to reuse the existing code for that? Or do we really need to re-implement everything, in the worst case in assembly? Why don't you turn the u-boot code into a set of macros, included by both the core u-boot code and the PSCI code? Thanks, M. -- Jazz is not dead. It just smells funny... ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4] sun6i: Add basic axp221 driver
On Mon, 2014-11-10 at 14:11 +0100, Hans de Goede wrote: From: Oliver Schinagl oli...@schinagl.nl The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Hans de Goede hdego...@redhat.com Acked-by: Ian Campbell ian.campb...@citrix.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] ARM: PSCI 0.1 vs 0.2
Hi Marc, what is the motivation to expose a PSCI 0.1 interface in U-boot, instead of 0.2? Support for preexisting users of 0.1? The kernel seems to be happy with both, and I'm now wondering if we should actually add the legacy version to Jailhouse as well (I hope we can avoid this). Still studying the logic: Is it possible to provide both interfaces, and would it make sense? Jan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] ARM: flush_dcache_all for PSCI
Hi all, I'm trying to get Marc's CPU hotplug-anabling patch [1] for sunxi working on a B-Pi. After the first discussion it became clear that we need something like flush_dcache_all in the PSCI monitor (I don't think we need an icache flush, do we?). Does anyone have a clever suggestion how to reuse the existing code for that? Or do we really need to re-implement everything, in the worst case in assembly? Thanks! Jan [1] https://git.kernel.org/cgit/linux/kernel/git/maz/u-boot.git/commit/?h=wip/psciid=45379c0f9cf812f0f62722f4015ec907fa5dc144 -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM: PSCI 0.1 vs 0.2
On 2014-11-10 14:08, Marc Zyngier wrote: On 10/11/14 12:51, Jan Kiszka wrote: Hi Marc, what is the motivation to expose a PSCI 0.1 interface in U-boot, instead of 0.2? Support for preexisting users of 0.1? The kernel seems to be happy with both, and I'm now wondering if we should actually add the legacy version to Jailhouse as well (I hope we can avoid this). The initial rational was simple: at the time this code was written, the 0.2 spec still in review, and nobody was implementing it. Supporting 0.1 was the only viable use-case. Still studying the logic: Is it possible to provide both interfaces, and would it make sense? Supporting both is very easy. Just output the 0.2 function numbers that actually make sense for 0.1 and have both compatible strings. Ah, cool - parameters and return values of, say, CPU_ON/OFF are compatible across both versions? Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4] sun6i: Add basic axp221 driver
Hi, On 11/10/2014 02:20 PM, Ian Campbell wrote: On Mon, 2014-11-10 at 14:11 +0100, Hans de Goede wrote: From: Oliver Schinagl oli...@schinagl.nl The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Hans de Goede hdego...@redhat.com Acked-by: Ian Campbell ian.campb...@citrix.com Thanks, I've taken the liberty to change this to: Acked-by: Ian Campbell i...@hellion.org.uk And pushed the entire series to u-boot-sunxi/next I'm somewhat tempted to send a PR with this to Tom, is there anything pending which we should get in first ? Regards, Hans ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC
Signed-off-by: Christian Gmeiner christian.gmei...@gmail.com --- board/bachmann/ot1200/ot1200.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c index 45d761f..2ed8cf7 100644 --- a/board/bachmann/ot1200/ot1200.c +++ b/board/bachmann/ot1200/ot1200.c @@ -155,9 +155,10 @@ int board_mmc_getcd(struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; int ret; - if (cfg-esdhc_base == USDHC3_BASE_ADDR) - ret = 1; - else { + if (cfg-esdhc_base == USDHC3_BASE_ADDR) { + gpio_direction_input(IMX_GPIO_NR(4, 5)); + ret = gpio_get_value(IMX_GPIO_NR(4, 5)); + } else { gpio_direction_input(IMX_GPIO_NR(1, 4)); ret = !gpio_get_value(IMX_GPIO_NR(1, 4)); } -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM: PSCI 0.1 vs 0.2
On 2014-11-10 14:29, bhupesh.sha...@freescale.com wrote: Hi, -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Jan Kiszka Sent: Monday, November 10, 2014 6:56 PM To: Marc Zyngier Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] ARM: PSCI 0.1 vs 0.2 On 2014-11-10 14:08, Marc Zyngier wrote: On 10/11/14 12:51, Jan Kiszka wrote: Hi Marc, what is the motivation to expose a PSCI 0.1 interface in U-boot, instead of 0.2? Support for preexisting users of 0.1? The kernel seems to be happy with both, and I'm now wondering if we should actually add the legacy version to Jailhouse as well (I hope we can avoid this). The initial rational was simple: at the time this code was written, the 0.2 spec still in review, and nobody was implementing it. Supporting 0.1 was the only viable use-case. Still studying the logic: Is it possible to provide both interfaces, and would it make sense? Supporting both is very easy. Just output the 0.2 function numbers that actually make sense for 0.1 and have both compatible strings. Ah, cool - parameters and return values of, say, CPU_ON/OFF are compatible across both versions? Jan -- We did send out some ARMv8 PSCI v0.2 u-boot patches, which can be seen here: http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/194210 Nice. I guess that could be reused for ARMv7 as well, at least conceptually. You are using C for some PSCI functions, specifically for cache flushing? Need to dig deeper... Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ot1200: add support for EHCI
U-Boot 2014.10-17457-g0b23780-dirty (Nov 10 2014 - 11:41:04) CPU: Freescale i.MX6D rev1.2 at 792 MHz Reset cause: WDOG Board: ot1200 I2C: ready DRAM: 1 GiB MMC: FSL_SDHC: 0, FSL_SDHC: 1 SF: Detected M25P16 with page size 256 Bytes, erase size 64 KiB, total 2 MiB In:serial Out: serial Err: serial Net: using phy at 0 FEC [PRIME] Hit any key to stop autoboot: 0 = usb start (Re)start USB... USB0: Port not available. USB1: USB EHCI 1.00 scanning bus 1 for devices... 4 USB Device(s) found = usb tree USB device tree: 1 Hub (480 Mb/s, 0mA) | u-boot EHCI Host Controller | +-2 Hub (480 Mb/s, 2mA) | +-3 Mass Storage (480 Mb/s, 80mA) |USBest Technology USB Mass Storage Device 00028B | +-4 Vendor specific (480 Mb/s, 2mA) = Signed-off-by: Christian Gmeiner christian.gmei...@gmail.com --- include/configs/ot1200.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/configs/ot1200.h b/include/configs/ot1200.h index d7696bd..9512b1e 100644 --- a/include/configs/ot1200.h +++ b/include/configs/ot1200.h @@ -83,6 +83,13 @@ #define CONFIG_GENERIC_MMC #define CONFIG_BOUNCE_BUFFER +/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 + #ifdef CONFIG_MX6Q #define CONFIG_CMD_SATA #endif -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC
ignore... -- Christian Gmeiner, MSc https://soundcloud.com/christian-gmeiner 2014-11-10 14:34 GMT+01:00 Christian Gmeiner christian.gmei...@gmail.com: Signed-off-by: Christian Gmeiner christian.gmei...@gmail.com --- board/bachmann/ot1200/ot1200.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c index 45d761f..2ed8cf7 100644 --- a/board/bachmann/ot1200/ot1200.c +++ b/board/bachmann/ot1200/ot1200.c @@ -155,9 +155,10 @@ int board_mmc_getcd(struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc-priv; int ret; - if (cfg-esdhc_base == USDHC3_BASE_ADDR) - ret = 1; - else { + if (cfg-esdhc_base == USDHC3_BASE_ADDR) { + gpio_direction_input(IMX_GPIO_NR(4, 5)); + ret = gpio_get_value(IMX_GPIO_NR(4, 5)); + } else { gpio_direction_input(IMX_GPIO_NR(1, 4)); ret = !gpio_get_value(IMX_GPIO_NR(1, 4)); } -- 1.9.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM: PSCI 0.1 vs 0.2
On 10/11/14 13:25, Jan Kiszka wrote: On 2014-11-10 14:08, Marc Zyngier wrote: On 10/11/14 12:51, Jan Kiszka wrote: Hi Marc, what is the motivation to expose a PSCI 0.1 interface in U-boot, instead of 0.2? Support for preexisting users of 0.1? The kernel seems to be happy with both, and I'm now wondering if we should actually add the legacy version to Jailhouse as well (I hope we can avoid this). The initial rational was simple: at the time this code was written, the 0.2 spec still in review, and nobody was implementing it. Supporting 0.1 was the only viable use-case. Still studying the logic: Is it possible to provide both interfaces, and would it make sense? Supporting both is very easy. Just output the 0.2 function numbers that actually make sense for 0.1 and have both compatible strings. Ah, cool - parameters and return values of, say, CPU_ON/OFF are compatible across both versions? That was the idea of the spec (broadly compatible across revisions...). Thanks, M. -- Jazz is not dead. It just smells funny... ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] ARM: PSCI 0.1 vs 0.2
Hi, -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Jan Kiszka Sent: Monday, November 10, 2014 6:56 PM To: Marc Zyngier Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] ARM: PSCI 0.1 vs 0.2 On 2014-11-10 14:08, Marc Zyngier wrote: On 10/11/14 12:51, Jan Kiszka wrote: Hi Marc, what is the motivation to expose a PSCI 0.1 interface in U-boot, instead of 0.2? Support for preexisting users of 0.1? The kernel seems to be happy with both, and I'm now wondering if we should actually add the legacy version to Jailhouse as well (I hope we can avoid this). The initial rational was simple: at the time this code was written, the 0.2 spec still in review, and nobody was implementing it. Supporting 0.1 was the only viable use-case. Still studying the logic: Is it possible to provide both interfaces, and would it make sense? Supporting both is very easy. Just output the 0.2 function numbers that actually make sense for 0.1 and have both compatible strings. Ah, cool - parameters and return values of, say, CPU_ON/OFF are compatible across both versions? Jan -- We did send out some ARMv8 PSCI v0.2 u-boot patches, which can be seen here: http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/194210 Regards, Bhupesh ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4] sun6i: Add basic axp221 driver
On Mon, 2014-11-10 at 14:33 +0100, Hans de Goede wrote: Hi, On 11/10/2014 02:20 PM, Ian Campbell wrote: On Mon, 2014-11-10 at 14:11 +0100, Hans de Goede wrote: From: Oliver Schinagl oli...@schinagl.nl The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Hans de Goede hdego...@redhat.com Acked-by: Ian Campbell ian.campb...@citrix.com Thanks, I've taken the liberty to change this to: Acked-by: Ian Campbell i...@hellion.org.uk Right, thanks. Wrong set of finger macros loaded... And pushed the entire series to u-boot-sunxi/next I'm somewhat tempted to send a PR with this to Tom, is there anything pending which we should get in first ? I seem to have http://patchwork.ozlabs.org/patch/403231/ delegated to me, but didn't you fix that already? Ian. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] imx: mx6q/dl sabre_common: Move MMC ENV offset to 512KB position
On Mon, Nov 10, 2014 at 6:29 AM, Ye.Li b37...@freescale.com wrote: Set the CONFIG_ENV_OFFSET from 384KB to 512KB offset, so we will have larger space for u-boot image. When enabling NAND flash support feature, the u-boot image size has exceeded the 384KB, which causes overlay to the environment variables storage. Signed-off-by: Ye.Li b37...@freescale.com Acked-by: Fabio Estevam fabio.este...@freescale.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4] sun6i: Add basic axp221 driver
Hi, On 11/10/2014 03:13 PM, Ian Campbell wrote: On Mon, 2014-11-10 at 14:33 +0100, Hans de Goede wrote: Hi, On 11/10/2014 02:20 PM, Ian Campbell wrote: On Mon, 2014-11-10 at 14:11 +0100, Hans de Goede wrote: From: Oliver Schinagl oli...@schinagl.nl The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl oli...@schinagl.nl Signed-off-by: Hans de Goede hdego...@redhat.com Acked-by: Ian Campbell ian.campb...@citrix.com Thanks, I've taken the liberty to change this to: Acked-by: Ian Campbell i...@hellion.org.uk Right, thanks. Wrong set of finger macros loaded... And pushed the entire series to u-boot-sunxi/next I'm somewhat tempted to send a PR with this to Tom, is there anything pending which we should get in first ? I seem to have http://patchwork.ozlabs.org/patch/403231/ delegated to me, but didn't you fix that already? Yes that is already fixed in master, I've moved this to accepted. Regards, Hans ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] porting u-boot, few final questions
Hi again. I just have a few things left to complete the port and hoping someone can help me out. 1. How come setenv is not working in the board file? I tried setenv in different locations of board_early_init_f(), board_init(), board_late_init() and checkboard(), but it's not working. Did something change? 2. Can we run a non fdt kernel with new U-Boot? I'm not there yet, but just wondering for testing. 3. I don't want to detract from the other two questions, which are more important at this time, but nothing in board_late_init() seems to be working for me. I do have BOARD_LATE_INIT defined in the config header file. Even a printf at the top is not working. Thanks for your time. -- View this message in context: http://u-boot.10912.n7.nabble.com/porting-u-boot-MMU-question-tp194761p195399.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] porting u-boot, few final questions
On Mon, Nov 10, 2014 at 1:14 PM, DaveKucharczyk david.kucharc...@gmail.com wrote: Hi again. I just have a few things left to complete the port and hoping someone can help me out. 1. How come setenv is not working in the board file? I tried setenv in different locations of board_early_init_f(), board_init(), board_late_init() and checkboard(), but it's not working. Did something change? Haven't tried it, but if this does not work, then it is a bug that needs to be fixed. Do you have access to a mx53 qsb board? Does it work there? On mx6 we have several boards calling setenv from the board files. 2. Can we run a non fdt kernel with new U-Boot? I'm not there yet, but just wondering for testing. Yes, take a look at include/configs/mx53loco.h: we have the variable boot_fdt, just set it: setenv boot_fdt no to boot a non-dt kernel. 3. I don't want to detract from the other two questions, which are more important at this time, but nothing in board_late_init() seems to be working for me. I do have BOARD_LATE_INIT defined in the config header file. Even a printf at the top is not working. Does this problem also happen on mx53 qsb? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 3/3] exynos: Increase command line buffer size (CONFIG_SYS_CBSIZE)
On 9 November 2014 03:44, Ian Campbell i...@hellion.org.uk wrote: From: Ian Campbell ian.campb...@citrix.com I was running into this limit with a not overly long PXE append line. Since the PXE code wants to print the resulting command line increase CONFIG_SYS_PBSIZE too. Signed-off-by: Ian Campbell ian.campb...@citrix.com Acked-by: Simon Glass s...@chromium.org ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] porting u-boot, few final questions
Dear Fabio Estevam, In message CAOMZO5AiJtDt_CZrO6gzU=jipp_2-etpigfck7zhfhnnzxp...@mail.gmail.com you wrote: 1. How come setenv is not working in the board file? I tried setenv in different locations of board_early_init_f(), board_init(), board_late_init() and checkboard(), but it's not working. Did something change? Haven't tried it, but if this does not work, then it is a bug that needs to be fixed. Do you have access to a mx53 qsb board? Does it work there? Suffix _f trditionally means running from flash, i. e. this is before relocation to RAM. Here we have usually only a read-ony data segment, no BSS at all, and only limted stack. All complicated stuff like setenv is only supposed to be available after relocation. On mx6 we have several boards calling setenv from the board files. Actual behaviour is hardware-dependent, but it's better not to make any such guesses. Actually it is usually a very bad idea to mandatorily modify the envrionment in code. This is almost always a design error. 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 Living on Earth may be expensive, but it includes an annual free trip around the Sun. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 3/3] exynos: Increase command line buffer size (CONFIG_SYS_CBSIZE)
On Sun, Nov 9, 2014 at 8:44 AM, Ian Campbell i...@hellion.org.uk wrote: /* Miscellaneous configurable options */ -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ -#define CONFIG_SYS_PBSIZE 384 /* Print Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ +#define CONFIG_SYS_PBSIZE 1024/* Print Buffer Size */ #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ What if we add a default definition like this: #define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ #define CONFIG_SYS_PBSIZE 1024/* Print Buffer Size */ ,then if CONFIG_SYS_CBSIZE and CONFIG_SYS_PBSIZE are not defined in the board file, we just use the default? I had the same issue sometime ago and I am wondering if this could be a better way to handle it. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4 v4] arm: socfpga: dts: Add Cadence QSPI DT node to socfpga.dtsi
+CC: Graham Moore On 11/10/2014 04:47 AM, Pavel Machek wrote: On Fri 2014-11-07 18:26:05, Stefan Roese wrote: Hi Simon, On 07.11.2014 18:21, Simon Glass wrote: + qspi: spi@ff705000 { + compatible = cadence,qspi; + #address-cells = 1; + #size-cells = 0; + reg = 0xff705000 0x1000, + 0xffa0 0x1000; + interrupts = 0 151 4; + clocks = qspi_clk; + ext-decoder = 0; /* external decoder */ + num-chipselect = 4; + fifo-depth = 128; + bus-num = 2; + status = disabled; + }; + Is this the same binding as Linux? Can you please bring in the binding document too? Some of these feel like they should have a manufacture, prefix. Yes, its from Linux. But not from kernel.org but from the Altera Rocketboards.org version (v3.16). So the bindings might change if this driver would be pushed to mainline Linux. I guess it would be good to submit the binding to Linux for review, so that we don't end up with two incompatible bindings... Graham has already submitted an RFC, but have not gotten any feedback yet. http://marc.info/?l=linux-kernelm=141417787314186w=2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] verified boot of beaglebone black
Hi, On 9 November 2014 17:13, Srinivasan S srinivasa...@tataelxsi.co.in wrote: Hi Simon, Hi Simon, As you suggested earlier am using u-boot-2014.07 Am using ~/ti-sdk-am335x-evm-07.00.00.00/bin/create-sdcard.sh for creating the partitions, After creating the partitions I tried implementing step 7. Put U-Boot and the kernel onto the board step 8. Try it, by the following steps, And when I tried to boot I am facing the below error for which am not able to get the uboot prompt U-Boot SPL 2013.10-g78d8ebd (Mar 30 2014 - 20:46:34) reading args spl: error reading image args, err - -1 reading u-boot.img reading u-boot.img No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d file.dtb initcall sequence 808511ec failed at call 80833f84 ### ERROR ### Please RESET the board ### I think you may have missed something here. The instructions should tell you to use u-boot-dtb.img which has a device tree attached. Also please can you read about 'top posting' - you should avoid doing this on the U-Boot mailing list. Put your response after any part of the message that you are responding to. Steps followed by me 1. As tmp directory was unavailable while mounting /dev/sdc1, so I created tmp directory while mounting /dev/sdc1 executed the commands as below sudo mount /dev/sdc1 /mnt/tmp sudo cp ~/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2014.07/b/am335x_boneblack_vboot/u-boot.img /mnt/tmp/u-boot.img sleep 1 sudo umount /dev/sdc1 sudo mount /dev/sdc2 /mnt/tmp sudo cp ~/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/work/image.fit /mnt/tmp/boot/image.fit sleep 1 sudo umount /dev/sdc2 2. I have even tried copying MLO u-boot.img of as below, but still the same error where unable to get uboot prompt sudo cp ~/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2014.07/b/am335x_boneblack_vboot/MLO /media/boot/ sudo cp ~/ti-sdk-am335x-evm-07.00.00.00/board-support/u-boot-2014.07/b/am335x_boneblack_vboot/u-boot.img /media/boot/ appusony@appusony-laptop:~/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/work$ ls am335x-boneblack.dtb am335x-boneblack-pubkey.dtb Image image.fit Image.lzo keys sign.its u-boot-dtb.img appusony@appusony-laptop:~/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/work$ sudo image.fit /media/rootfs/boot/ Please do the needful in resolving the above issue as this is the last steps Many Thanks in Advance again, Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] porting u-boot, few final questions
On Mon, Nov 10, 2014 at 1:47 PM, Wolfgang Denk w...@denx.de wrote: Dear Fabio Estevam, In message CAOMZO5AiJtDt_CZrO6gzU=jipp_2-etpigfck7zhfhnnzxp...@mail.gmail.com you wrote: 1. How come setenv is not working in the board file? I tried setenv in different locations of board_early_init_f(), board_init(), board_late_init() and checkboard(), but it's not working. Did something change? Haven't tried it, but if this does not work, then it is a bug that needs to be fixed. Do you have access to a mx53 qsb board? Does it work there? Suffix _f trditionally means running from flash, i. e. this is before relocation to RAM. Here we have usually only a read-ony data segment, no BSS at all, and only limted stack. All complicated stuff like setenv is only supposed to be available after relocation. Just tested on real hardware and the below change works: --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -404,6 +404,12 @@ int board_late_init(void) return 0; } +int misc_init_r(void) +{ + setenv(myvar, 123456); + return 0; +} + int checkboard(void) { puts(Board: MX53 LOCO\n); diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index a74508c..8f692d7 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -29,6 +29,7 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT +#define CONFIG_MISC_INIT_R #define CONFIG_MXC_GPIO #define CONFIG_REVISION_TAG On mx6 we have several boards calling setenv from the board files. Actual behaviour is hardware-dependent, but it's better not to make any such guesses. Yes, but not sure how a mx6 can differ from a mx5 in getting setenv to work. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx28evk: README: Revision C is also supported
Adjust the text to mention that rev C of the board is also supported. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- board/freescale/mx28evk/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/freescale/mx28evk/README b/board/freescale/mx28evk/README index 958ebc6..f9d6324 100644 --- a/board/freescale/mx28evk/README +++ b/board/freescale/mx28evk/README @@ -1,7 +1,7 @@ FREESCALE MX28EVK == -Supported hardware: only MX28EVK rev D is supported in U-boot. +Supported hardware: MX28EVK rev C and D are supported in U-boot. Files of the MX28EVK port -- -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: OMAP5: DRA7xx: Enable 8-bit eMMC access on the dra7xx_evm
Tested on a Vayu EVM Rev.E2 with DRA752 ES1.1 Signed-off-by: Lubomir Popov l-po...@ti.com --- include/configs/dra7xx_evm.h |1 + 1 file changed, 1 insertion(+) diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 2eaabde..174a711 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -50,6 +50,7 @@ #define CONFIG_EFI_PARTITION #define CONFIG_PARTITION_UUIDS #define CONFIG_CMD_PART +#define CONFIG_HSMMC2_8BIT /* CPSW Ethernet */ #define CONFIG_CMD_NET /* 'bootp' and 'tftp' */ -- 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] powerpc: remove orphaned boards mcc200 and prs200
Hi Masahiro, On 11/10/2014 10:33 AM, Masahiro Yamada wrote: Hi Nikita, Thanks for cleaning up! On Fri, 7 Nov 2014 14:17:18 +0200 Nikita Kiryanov nik...@compulab.co.il wrote: diff --git a/doc/README.scrapyard b/doc/README.scrapyard index bd4dd3c..bfaabeb 100644 --- a/doc/README.scrapyard +++ b/doc/README.scrapyard @@ -15,6 +15,8 @@ BoardArchCPUCommit Removed Last known m TOP5200powerpc mpc5200- - Reinhard Meyer reinhard.me...@emk-elektronik.de TOP860 powerpc mpc860 - - Reinhard Meyer reinhard.me...@emk-elektronik.de TOP9000arm at91sam9xeXXX - - Reinhard Meyer reinhard.me...@emk-elektronik.de +PRS200 powerpc mpc5200- 2014-11-05 +MCC200 powerpc mpc5200- 2014-11-05 TQM8272 powerpc mpc8260f06f9a1 2014-10-27 Wolfgang Denk w...@denx.de TQM8260 powerpc mpc8260ccc1950 2014-10-27 Wolfgang Denk w...@denx.de IDS8247 powerpc mpc82606afb357 2014-10-27 Heiko Schocher h...@denx.de I think we are supposed to fill blank fields that have been added by former commits (in this case, Commit/Removed fields of TOP*) git log on the scrapyard file shows me that the commit IDs were always filled in using a dedicated patch. Was there a decision to change this M.O.? and then add new lines at the top of them. (i.e. eventually this list is sorted in reverse chronological order.) OK At the moment, nobody knows when PRS200/MCC200 will be removed (= when this patch will be applied). I'll remove the date then.. Best Regards Masahiro Yamada -- Regards, Nikita Kiryanov ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: OMAP5: DRA7xx: Fix misleading comments in mux_data.h
The comments on the QSPI pad assignments erronously swapped the qspi1_d0 and qspi1_d1 functionality and could cause confusion. QSPI1_D[0] is in fact muxed on pad U1 (gpmc_a16), and QSPI1_D[1] - on pad P3 (gpmc_a17). Fixing comments. Signed-off-by: Lubomir Popov l-po...@ti.com --- board/ti/dra7xx/mux_data.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/ti/dra7xx/mux_data.h b/board/ti/dra7xx/mux_data.h index 7276014..4824077 100644 --- a/board/ti/dra7xx/mux_data.h +++ b/board/ti/dra7xx/mux_data.h @@ -130,8 +130,8 @@ const struct pad_conf_entry core_padconf_array_essential[] = { {GPMC_A13, (IEN | PDIS | M1)}, /* QSPI1_RTCLK */ {GPMC_A14, (IEN | PDIS | M1)}, /* QSPI1_D[3] */ {GPMC_A15, (IEN | PDIS | M1)}, /* QSPI1_D[2] */ - {GPMC_A16, (IEN | PDIS | M1)}, /* QSPI1_D[1] */ - {GPMC_A17, (IEN | PDIS | M1)}, /* QSPI1_D[0] */ + {GPMC_A16, (IEN | PDIS | M1)}, /* QSPI1_D[0] */ + {GPMC_A17, (IEN | PDIS | M1)}, /* QSPI1_D[1] */ {GPMC_A18, (M1)}, /* QSPI1_SCLK */ {GPMC_A3, (IEN | PDIS | M1)}, /* QSPI1_CS2 */ {GPMC_A4, (IEN | PDIS | M1)}, /* QSPI1_CS3 */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] porting u-boot, few final questions
Hi gents, On 11/10/2014 06:04 PM, Fabio Estevam wrote: On Mon, Nov 10, 2014 at 1:47 PM, Wolfgang Denk w...@denx.de wrote: Dear Fabio Estevam, In message CAOMZO5AiJtDt_CZrO6gzU=jipp_2-etpigfck7zhfhnnzxp...@mail.gmail.com you wrote: 1. How come setenv is not working in the board file? I tried setenv in different locations of board_early_init_f(), board_init(), board_late_init() and checkboard(), but it's not working. Did something change? Haven't tried it, but if this does not work, then it is a bug that needs to be fixed. Do you have access to a mx53 qsb board? Does it work there? Suffix _f trditionally means running from flash, i. e. this is before relocation to RAM. Here we have usually only a read-ony data segment, no BSS at all, and only limted stack. All complicated stuff like setenv is only supposed to be available after relocation. Just tested on real hardware and the below change works: --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -404,6 +404,12 @@ int board_late_init(void) return 0; } +int misc_init_r(void) +{ + setenv(myvar, 123456); + return 0; +} + int checkboard(void) { puts(Board: MX53 LOCO\n); diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index a74508c..8f692d7 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -29,6 +29,7 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT +#define CONFIG_MISC_INIT_R #define CONFIG_MXC_GPIO #define CONFIG_REVISION_TAG On mx6 we have several boards calling setenv from the board files. Actual behaviour is hardware-dependent, but it's better not to make any such guesses. Yes, but not sure how a mx6 can differ from a mx5 in getting setenv to work. Please correct me if I'm wrong, but setting env-vars shouldn't work before the environment is initialized. This initialization happens when the initr_env() is called according the order in init_sequence_r[]. @Dave - the easiest way to verify when your code (which tries to work with the env-vars) is executed and when the actual environment is initialized, is to enable debugging in lib/initcall.c:initcall_run_list(), see the pointers of the called functions and check them in the System.map. The env is initialized in the call tree below initr_env(), so your code should use the env after that. Regards, Nikolay ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] mpc85xx: inhibit bman portals by default
Not all portals might be managed and therefore visible. Set the isdr register so that the corresponding isr register won't be set. This is needed for deepsleep. Signed-off-by: Jeffrey Ladouceur jeffrey.ladouc...@freescale.com --- The following dependent patches should be applied first: http://patchwork.ozlabs.org/patch/403532 http://patchwork.ozlabs.org/patch/403533 http://patchwork.ozlabs.org/patch/403540 http://patchwork.ozlabs.org/patch/403534 http://patchwork.ozlabs.org/patch/403535 http://patchwork.ozlabs.org/patch/403538 http://patchwork.ozlabs.org/patch/403536 http://patchwork.ozlabs.org/patch/403539 Changes in v3: - Update subject title to be consistent Changes in v2: - Removed P1023RDS as it is no longer supported. arch/powerpc/cpu/mpc85xx/portals.c | 41 +++ include/configs/B4860QDS.h |8 +++ include/configs/P1023RDB.h |8 +++ include/configs/P2041RDB.h |8 +++ include/configs/T102xQDS.h |8 +++ include/configs/T102xRDB.h |8 +++ include/configs/T1040QDS.h |8 +++ include/configs/T104xRDB.h |8 +++ include/configs/T208xQDS.h |8 +++ include/configs/T208xRDB.h |8 +++ include/configs/T4240EMU.h |8 +++ include/configs/T4240QDS.h |8 +++ include/configs/T4240RDB.h |8 +++ include/configs/corenet_ds.h|8 +++ include/configs/km/kmp204x-common.h |8 +++ 15 files changed, 153 insertions(+) diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c index 98815f8..4c2ee98 100644 --- a/arch/powerpc/cpu/mpc85xx/portals.c +++ b/arch/powerpc/cpu/mpc85xx/portals.c @@ -14,6 +14,44 @@ #include asm/fsl_portals.h #include asm/fsl_liodn.h +#define MAX_PORTALS (CONFIG_SYS_BMAN_CINH_SIZE / CONFIG_SYS_BMAN_SP_CINH_SIZE) +void inhibit_bman_portals(void) +{ + void __iomem *addr = (void *)CONFIG_SYS_BMAN_CINH_BASE + + CONFIG_SYS_BMAN_SWP_ISDR_REG; + uint32_t val; + int portal_count = 0; + + /* Dynamically determine number of portals */ + do { + val = in_be32(addr); + if (val) { + printf(ERROR: should be zero at 0x%p\n, addr); + goto done; + } + out_be32(addr, -1); + val = in_be32(addr); + if (!val) { + /* end of portals */ + if (!portal_count) + printf(ERROR: No portals\n); + goto done; + } + portal_count++; + addr += CONFIG_SYS_BMAN_SP_CINH_SIZE; + if (portal_count = MAX_PORTALS) + goto done; + } while (1); + +done: + +#ifdef DEBUG + printf(BMan portal counted %u, defined is %u\n, + portal_count, CONFIG_SYS_BMAN_NUM_PORTALS); +#endif + return; +} + void setup_portals(void) { ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR; @@ -38,6 +76,9 @@ void setup_portals(void) out_be32(qman-qcsp_bare, (u32)(CONFIG_SYS_QMAN_MEM_PHYS 32)); #endif out_be32(qman-qcsp_bar, (u32)CONFIG_SYS_QMAN_MEM_PHYS); + + /* Change default state of BMan ISDR portals to all 1s */ + inhibit_bman_portals(); } /* Update portal containter to match LAW setup of portal in phy map */ diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h index dc1a9bc..31f1d3f 100644 --- a/include/configs/B4860QDS.h +++ b/include/configs/B4860QDS.h @@ -641,6 +641,14 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_SYS_BMAN_MEM_PHYS CONFIG_SYS_BMAN_MEM_BASE #endif #define CONFIG_SYS_BMAN_MEM_SIZE 0x0200 +#define CONFIG_SYS_BMAN_SP_CENA_SIZE 0x4000 +#define CONFIG_SYS_BMAN_SP_CINH_SIZE 0x1000 +#define CONFIG_SYS_BMAN_CENA_BASE CONFIG_SYS_BMAN_MEM_BASE +#define CONFIG_SYS_BMAN_CENA_SIZE (CONFIG_SYS_BMAN_MEM_SIZE 1) +#define CONFIG_SYS_BMAN_CINH_BASE (CONFIG_SYS_BMAN_MEM_BASE + \ + CONFIG_SYS_BMAN_CENA_SIZE) +#define CONFIG_SYS_BMAN_CINH_SIZE (CONFIG_SYS_BMAN_MEM_SIZE 1) +#define CONFIG_SYS_BMAN_SWP_ISDR_REG 0xE08 #define CONFIG_SYS_QMAN_NUM_PORTALS25 #define CONFIG_SYS_QMAN_MEM_BASE 0xf600 #ifdef CONFIG_PHYS_64BIT diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h index ba3da06..107db72 100644 --- a/include/configs/P1023RDB.h +++ b/include/configs/P1023RDB.h @@ -347,6 +347,14 @@ extern unsigned long get_clock_freq(void); #define CONFIG_SYS_BMAN_MEM_BASE 0xff20 #define CONFIG_SYS_BMAN_MEM_PHYS CONFIG_SYS_BMAN_MEM_BASE #define CONFIG_SYS_BMAN_MEM_SIZE 0x0020 +#define CONFIG_SYS_BMAN_SP_CENA_SIZE0x4000 +#define CONFIG_SYS_BMAN_SP_CINH_SIZE0x1000 +#define CONFIG_SYS_BMAN_CENA_BASE
Re: [U-Boot] [PATCH] powerpc: remove orphaned boards mcc200 and prs200
Hello Nikita, 2014-11-11 1:24 GMT+09:00 Nikita Kiryanov nik...@compulab.co.il: I think we are supposed to fill blank fields that have been added by former commits (in this case, Commit/Removed fields of TOP*) git log on the scrapyard file shows me that the commit IDs were always filled in using a dedicated patch. Was there a decision to change this M.O.? I think we used to insert blank columns and add new lines at the same time. For example, commit 3569571db27589f9b3d92b5ab2c59a50dac9387f commit 79c5c08d7c560aef2d5706501557b7907c2829bb although it looks like we sometimes play it by ear. If you want to split it into two patches, that's OK, of course. -- Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: OMAP5: DRA7xx: Fix misleading comments in mux_data.h
On Mon, Nov 10, 2014 at 06:34:10PM +0200, Lubomir Popov wrote: The comments on the QSPI pad assignments erronously swapped the qspi1_d0 and qspi1_d1 functionality and could cause confusion. QSPI1_D[0] is in fact muxed on pad U1 (gpmc_a16), and QSPI1_D[1] - on pad P3 (gpmc_a17). Fixing comments. Signed-off-by: Lubomir Popov l-po...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] spl: MMC U-Boot image load from raw partition
On Sat, Nov 08, 2014 at 11:19:23PM +0100, Albert ARIBAUD wrote: Hello Paul, On Sat, 8 Nov 2014 23:14:54 +0100, Paul Kocialkowski cont...@paulk.fr wrote: This is a first attempt at adding support for U-Boot image load from raw partitions. It does not support OS boot as I cannot test it on my current setup. This is going to be useful for the Optimus Black port (please do not consider this as dead code because no board is using it right now, there will be one soon)! Well... Why don't you just post these two patches a little later, as part of the upcoming series which will add support for the Optimus Black? So to me the dead code thing is starting to get a lot more ambiguous since with Kconfig we'll need need every single possible choice enabled in some defconfig, just some way to turn it on, on a possibly relevant board. In this case, any OMAP3+ board would be a fine place to try this out, IFF it's done as a Kconfig choice. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] MMC SD fs boot partition config coding style and proper description
On Sat, Nov 08, 2014 at 11:14:55PM +0100, Paul Kocialkowski wrote: CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION ought to be called CONFIG_SYS_MMCSD_FS_BOOT_PARTITION to keep it consistent with other config options such as: CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR. In addition, it is not related to raw mode booting but to fs mode instead. Signed-off-by: Paul Kocialkowski cont...@paulk.fr Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ARM: OMAP5: DRA7xx: Enable 8-bit eMMC access on the dra7xx_evm
On Mon, Nov 10, 2014 at 06:14:18PM +0200, Lubomir Popov wrote: Tested on a Vayu EVM Rev.E2 with DRA752 ES1.1 Signed-off-by: Lubomir Popov l-po...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] spl: MMC U-Boot image load from raw partition
On Sat, Nov 08, 2014 at 11:14:56PM +0100, Paul Kocialkowski wrote: Raw images of U-Boot can be stored inside MMC partitions, so it makes sense to read the partition table, looking for a partition number instead of using a fixed sector address. Signed-off-by: Paul Kocialkowski cont...@paulk.fr Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 2/3] twl4030: device-index-specific MMC power initializations, common ramp-up delay
On Sat, Nov 08, 2014 at 08:55:46PM +0100, Paul Kocialkowski wrote: Not every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in omap_hsmmc will enable both VMMC1 and VMMC2, in doubt. Signed-off-by: Paul Kocialkowski cont...@paulk.fr Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/3] omap_hsmmc: Board-specific TWL4030 MMC power initializations
On Sat, Nov 08, 2014 at 08:55:47PM +0100, Paul Kocialkowski wrote: Boards using the TWL4030 regulator may not all use the LDOs the same way (e.g. MMC2 power can be controlled by another LDO than VMMC2). This delegates TWL4030 MMC power initializations to board-specific functions, that may still call twl4030_power_mmc_init for the default behavior. Signed-off-by: Paul Kocialkowski cont...@paulk.fr Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 3/3] omap_hsmmc: Board-specific TWL4030 MMC power initializations
On Sat, Nov 08, 2014 at 10:29:24PM +0100, Paul Kocialkowski wrote: Le samedi 08 novembre 2014 à 20:55 +0100, Paul Kocialkowski a écrit : Boards using the TWL4030 regulator may not all use the LDOs the same way (e.g. MMC2 power can be controlled by another LDO than VMMC2). This delegates TWL4030 MMC power initializations to board-specific functions, that may still call twl4030_power_mmc_init for the default behavior. Signed-off-by: Paul Kocialkowski cont...@paulk.fr --- board/comelit/dig297/dig297.c | 5 + board/compulab/cm_t35/cm_t35.c | 7 +++ board/corscience/tricorder/tricorder.c | 7 +++ board/isee/igep00x0/igep00x0.c | 7 +++ board/logicpd/omap3som/omap3logic.c| 7 +++ board/logicpd/zoom1/zoom1.c| 5 + board/matrix_vision/mvblx/mvblx.c | 6 ++ board/nokia/rx51/rx51.c| 6 ++ board/overo/overo.c| 7 +++ board/pandora/pandora.c| 5 + board/technexion/tao3530/tao3530.c | 7 +++ board/ti/beagle/beagle.c | 7 +++ board/ti/evm/evm.c | 7 +++ board/ti/sdp3430/sdp.c | 5 + board/timll/devkit8000/devkit8000.c| 7 +++ drivers/mmc/omap_hsmmc.c | 7 +-- 16 files changed, 96 insertions(+), 6 deletions(-) diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c index 2b826df..9d4c41b 100644 --- a/board/comelit/dig297/dig297.c +++ b/board/comelit/dig297/dig297.c @@ -133,6 +133,11 @@ int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1); } + +void board_mmc_power_init(void) +{ I just figured, in the context of the SPL, board_mmc_init will be called from omap3/board.c instead of the board file, so perhaps it would be worth adding, in board_mmc_power_init: #ifdef CONFIG_SPL_BUILD and then checking spl_boot_device to only enable the relevant LDO. If we get to this point we can do the same thing we do for board_mmc_init which is have one in say arch/arm/cpu/armv7/omap-common/boot-common.c that checks spl_boot_device() -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v4 1/3] mmc: Board-specific MMC power initializations
On Sat, Nov 08, 2014 at 08:55:45PM +0100, Paul Kocialkowski wrote: Some devices may use non-standard combinations of regulators to power MMC: this allows these devices to provide a board-specific MMC power init function to set everything up in their own way. Signed-off-by: Paul Kocialkowski cont...@paulk.fr Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 02/11] arm: omap5: tps659038: rename regulator defines
On Thu, Nov 06, 2014 at 08:28:43AM -0600, Felipe Balbi wrote: Those regulators don't have any coupling with what they supply, so remove the suffixes in order to not confuse anybody. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 01/11] arm: omap5: don't enable misc_init_r by default
On Thu, Nov 06, 2014 at 08:28:42AM -0600, Felipe Balbi wrote: Out of all OMAP5-like boards, only one of them needs CONFIG_MISC_INIT_R, so it's best to enable that for that particular board only, instead of enabling for all boards unconditionally. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] broadcom: add seven boards
On Sat, Nov 08, 2014 at 09:25:06AM +0100, Albert ARIBAUD wrote: Hello Steve, On Fri, 7 Nov 2014 18:13:18 -0800, Steve Rae s...@broadcom.com wrote: - 5 based on cygnus, 2 based on 28155 - updates to support board families better - add functions so CONFIG_ARMV7_NONSEC can be enabled on Cygnus boards Signed-off-by: Steve Rae s...@broadcom.com --- Could you just add board names or at least prefixes in the commit message or better yet, in the commit summary / subject? This will allow people who look for board info based on (start of) name to find this commit more easily. At least in the full commit summary list them all and in the summary something along the lines of ARM: bcm: Enable some Cygnus and 28155 family boards or so. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 03/11] arm: dra7xx: prcm: add missing registers
On Thu, Nov 06, 2014 at 08:28:44AM -0600, Felipe Balbi wrote: some boards might want to use USB1 for host, without fiddling those registers it'll be impossible. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 04/11] usb: phy: omap_usb_phy: fix build breakage
On Thu, Nov 06, 2014 at 08:28:45AM -0600, Felipe Balbi wrote: there's no such function usb3_phy_power(), it's likely that author meant to call, usb_phy_power() instead, but that's already called properly from xhci-omap.c. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/11] arm: omap-common: emif: allow to map memory without interleaving
On Thu, Nov 06, 2014 at 08:28:46AM -0600, Felipe Balbi wrote: If we want to have two sections, one on each EMIF, without interleaving, current code wouldn't enable emif2. Fix that problem. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 07/11] arm: omap5: make hw_init_data weak
On Thu, Nov 06, 2014 at 08:28:48AM -0600, Felipe Balbi wrote: this way we can let boards overwrite based on what they need. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 10/11] arm: omap: add support for am57xx devices
On Thu, Nov 06, 2014 at 08:28:51AM -0600, Felipe Balbi wrote: just add a few ifdefs around because this device is very similar to dra7xxx. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 06/11] configs: omap5_common : Boot rootfs from sd card by default
On Thu, Nov 06, 2014 at 08:28:47AM -0600, Felipe Balbi wrote: From: Franklin S Cooper Jr fcoo...@ti.com * Since the emmc isn't always programed trying to load the fs from the emmc causes boot failures/kernel panic. * The current bootcmd is set to: bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; \ setenv mmcroot /dev/mmcblk0p2 rw; run mmcboot; My guess is the env variables should be set so that sd card boot (dt,kernel,fs) is the default and then fallback to emmc if it fails (no sd card detected) The current bootcmd attempts to set mmcroot to the sd card rootfs but that code doesn't run due to mmcboot being ran early on. Signed-off-by: Franklin Cooper Jr. fcoo...@ti.com Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 09/11] arm: omap_common: expose tps659038 and dra7xx_dplls
On Thu, Nov 06, 2014 at 08:28:50AM -0600, Felipe Balbi wrote: expose those two definitions so they can be used by another board which we're adding in upcoming patches. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 08/11] arm: omap5: sdram: mark emif_get_ext_phy_ctrl_const_regs __weak
On Thu, Nov 06, 2014 at 08:28:49AM -0600, Felipe Balbi wrote: this will allow for boards to overwrite those in case memory setup is different. Signed-off-by: Felipe Balbi ba...@ti.com Reviewed-by: Tom Rini tr...@ti.com -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 11/11] beagle_x15: add board support for Beagle x15
On Thu, Nov 06, 2014 at 08:44:27AM -0600, Felipe Balbi wrote: BeagleBoard-X15 is the next generation Open Source Hardware BeagleBoard based on TI's AM5728 SoC featuring dual core 1.5GHZ A15 processor. The platform features 2GB DDR3L (w/dual 32bit busses), eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), separate LCD port, video In port, 4GB eMMC, uSD, Analog audio in/out, dual 1G Ethernet. For more information, refer to: http://www.elinux.org/Beagleboard:BeagleBoard-X15 Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Nishanth Menon n...@ti.com [snip] +static const struct emif_regs beagle_x15_ddr3_532mhz_emif_regs = { + .sdram_config_init = 0x61851B32, /* dont know what to do about this */ + .sdram_config = 0x61851B32, + .sdram_config2 = 0x, + .ref_ctrl = 0x1035, + .sdram_tim1 = 0xCEEF266B, + .sdram_tim2 = 0x328F7FDA, + .sdram_tim3 = 0x027F88A8, + .read_idle_ctrl = 0x00050001, /* not sure where in gel file */ + .zq_config = 0x0007190B, + .temp_alert_config = 0x, + .emif_ddr_phy_ctlr_1_init = 0x0E24400A, /* not sure what to do about this */ + .emif_ddr_phy_ctlr_1= 0x0E24400A, /* based on non hw level enabled */ + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, /* not sure wherein gel file */ + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, + .emif_ddr_ext_phy_ctrl_3 = 0x00780078, + .emif_ddr_ext_phy_ctrl_4 = 0x007c007c, + .emif_ddr_ext_phy_ctrl_5 = 0x007b007b, + .emif_rd_wr_lvl_rmp_win = 0x, + .emif_rd_wr_lvl_rmp_ctl = 0x, /* based on non hw level enabled */ + .emif_rd_wr_lvl_ctl = 0x, /* not sure where based in gel file */ + .emif_rd_wr_exec_thresh = 0x0305 Lets either get the timing info right or comment that we expect to need to tweak these values again later based on production HW or something. +static const u32 beagle_x15_ddr3_ext_phy_ctrl_const_regs[] = { + 0x00800080, // 6 + + + 0x00360036, // 7 + 0x00340034, // 8 + 0x00360036, // 9 + 0x00350035, // 10 + 0x00350035, // 11 + + 0x01ff01ff, // 12 // isn't allowed and what're you counting? :) [snip] +#define CONFIG_SYS_SDRAM_BASE0x8000 Shouldn't be needed, should be set by a common header already. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 1/4] x86: Do CPU identification in the early phase
Hi Bin, On 9 November 2014 07:18, Bin Meng bmeng...@gmail.com wrote: The CPU identification happens in x86_cpu_init_f() and corresponding fields are saved in the global data for later use. Signed-off-by: Bin Meng bmeng...@gmail.com --- Changes for v2: - Update the patch per review comments from Simon Glass - cpu_vendor_name() and fill_processor_name() are not static now arch/x86/cpu/cpu.c | 277 +++-- arch/x86/include/asm/cpu.h | 168 +- arch/x86/include/asm/global_data.h | 5 + 3 files changed, 402 insertions(+), 48 deletions(-) Applied to u-boot-x86/master, thanks! Note I had to clean up style problems in these patches. I decided to do this instead of asking for a respin since I didn't check it for version 1. $ patman -nm -c4 Cleaned 4 patches 8 errors, 8 warnings, 2 checks for 0001-x86-Do-CPU-identification-in-the-early-phase.patch: error: arch/x86/cpu/cpu.c,57: code indent should use tabs where possible warning: arch/x86/cpu/cpu.c,57: please, no spaces at the start of a line error: arch/x86/cpu/cpu.c,58: code indent should use tabs where possible warning: arch/x86/cpu/cpu.c,58: please, no spaces at the start of a line error: arch/x86/cpu/cpu.c,59: code indent should use tabs where possible warning: arch/x86/cpu/cpu.c,59: please, no spaces at the start of a line error: arch/x86/cpu/cpu.c,60: code indent should use tabs where possible warning: arch/x86/cpu/cpu.c,60: please, no spaces at the start of a line warning: arch/x86/cpu/cpu.c,84: static const char * array should probably be static const char * const error: arch/x86/cpu/cpu.c,213: space prohibited before that close parenthesis ')' warning: arch/x86/cpu/cpu.c,245: braces {} are not necessary for any arm of this statement warning: arch/x86/cpu/cpu.c,255: braces {} are not necessary for single statement blocks error: arch/x86/cpu/cpu.c,269: else should follow close brace '}' error: arch/x86/cpu/cpu.c,275: space required before the open parenthesis '(' error: arch/x86/cpu/cpu.c,490: that open brace { should be on the previous line check: arch/x86/cpu/cpu.c,491: Alignment should match open parenthesis warning: arch/x86/cpu/cpu.c,527: line over 80 characters check: arch/x86/cpu/cpu.c,528: Alignment should match open parenthesis 0 errors, 0 warnings, 2 checks for 0002-x86-Do-TSC-MSR-calibration-only-for-known-supported-.patch: check: arch/x86/lib/tsc_timer.c,62: Alignment should match open parenthesis check: arch/x86/lib/tsc_timer.c,105: Alignment should match open parenthesis 0 errors, 1 warnings, 0 checks for 0003-x86-Add-quick-TSC-calibration-via-PIT.patch: warning: arch/x86/lib/tsc_timer.c,162: line over 80 characters Please can you make sure you submit them with patman so that these problems are checked? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 2/4] x86: Do TSC MSR calibration only for known/supported CPUs
Hi Bin, On 9 November 2014 07:19, Bin Meng bmeng...@gmail.com wrote: Using MSR_PLATFORM_INFO (0xCE) to calibrate TSR will cause #GP on processors which do not have this MSR. Instead only doing the MSR calibration for known/supported CPUs. Signed-off-by: Bin Meng bmeng...@gmail.com Acked-by: Simon Glass s...@chromium.org Tested-by: Simon Glass s...@chromium.org --- arch/x86/lib/tsc_timer.c | 116 --- 1 file changed, 109 insertions(+), 7 deletions(-) Applied to u-boot-x86/master, thanks! (Please see note below) diff --git a/arch/x86/lib/tsc_timer.c b/arch/x86/lib/tsc_timer.c index 8b38702..fafbbfc 100644 --- a/arch/x86/lib/tsc_timer.c +++ b/arch/x86/lib/tsc_timer.c @@ -1,6 +1,9 @@ /* * Copyright (c) 2012 The Chromium OS Authors. * + * TSC calibration codes are adapted from Linux kernel + * arch/x86/kernel/tsc_msr.c and arch/x86/kernel/tsc.c + * * SPDX-License-Identifier:GPL-2.0+ */ @@ -12,8 +15,108 @@ #include asm/msr.h #include asm/u-boot-x86.h +/* CPU reference clock frequency: in KHz */ +#define FREQ_8383200 +#define FREQ_100 99840 +#define FREQ_133 133200 +#define FREQ_166 166400 + +#define MAX_NUM_FREQS 8 + DECLARE_GLOBAL_DATA_PTR; +/* + * According to Intel 64 and IA-32 System Programming Guide, + * if MSR_PERF_STAT[31] is set, the maximum resolved bus ratio can be + * read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40]. + * Unfortunately some Intel Atom SoCs aren't quite compliant to this, + * so we need manually differentiate SoC families. This is what the + * field msr_plat does. + */ +struct freq_desc { + u8 x86_family; /* CPU family */ + u8 x86_model; /* model */ + u8 msr_plat;/* 1: use MSR_PLATFORM_INFO, 0: MSR_IA32_PERF_STATUS */ + u32 freqs[MAX_NUM_FREQS]; +}; + +static struct freq_desc freq_desc_tables[] = { + /* PNW */ + { 6, 0x27, 0, { 0, 0, 0, 0, 0, FREQ_100, 0, FREQ_83 } }, + /* CLV+ */ + { 6, 0x35, 0, { 0, FREQ_133, 0, 0, 0, FREQ_100, 0, FREQ_83 } }, + /* TNG */ + { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } }, + /* VLV2 */ + { 6, 0x37, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } }, + /* ANN */ + { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } }, +}; + +static int match_cpu(u8 family, u8 model) +{ + int i; + + for (i = 0; i ARRAY_SIZE(freq_desc_tables); i++) { + if ((family == freq_desc_tables[i].x86_family) + (model == freq_desc_tables[i].x86_model)) + return i; + } + + return -1; +} + +/* Map CPU reference clock freq ID(0-7) to CPU reference clock freq(KHz) */ +#define id_to_freq(cpu_index, freq_id) \ + (freq_desc_tables[cpu_index].freqs[freq_id]) + +/* + * Do MSR calibration only for known/supported CPUs. + * + * Returns the calibration value or 0 if MSR calibration failed. + */ +static unsigned long try_msr_calibrate_tsc(void) +{ + u32 lo, hi, ratio, freq_id, freq; + unsigned long res; + int cpu_index; + + cpu_index = match_cpu(gd-arch.x86, gd-arch.x86_model); + if (cpu_index 0) + return 0; + + if (freq_desc_tables[cpu_index].msr_plat) { + rdmsr(MSR_PLATFORM_INFO, lo, hi); + ratio = (lo 8) 0x1f; + } else { + rdmsr(MSR_IA32_PERF_STATUS, lo, hi); + ratio = (hi 8) 0x1f; + } + debug(Maximum core-clock to bus-clock ratio: 0x%x\n, ratio); + + if (!ratio) + goto fail; + + /* Get FSB FREQ ID */ + rdmsr(MSR_FSB_FREQ, lo, hi); + freq_id = lo 0x7; + freq = id_to_freq(cpu_index, freq_id); + debug(Resolved frequency ID: %u, frequency: %u KHz\n, + freq_id, freq); + if (!freq) + goto fail; + + /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */ + res = freq * ratio / 1000; + debug(TSC runs at %lu MHz\n, res); + + return res; + +fail: + debug(Fast TSC calibration using MSR failed\n); + return 0; +} + void timer_set_base(u64 base) { gd-arch.tsc_base = base; @@ -34,17 +137,16 @@ u64 __attribute__((no_instrument_function)) get_ticks(void) return now_tick - gd-arch.tsc_base; } -#define PLATFORM_INFO_MSR 0xce - /* Get the speed of the TSC timer in MHz */ unsigned __attribute__((no_instrument_function)) long get_tbclk_mhz(void) { - u32 ratio; - u64 platform_info = native_read_msr(PLATFORM_INFO_MSR); + unsigned long fast_calibrate; + + fast_calibrate = try_msr_calibrate_tsc(); + if (!fast_calibrate) + panic(TSC frequency is ZERO); - /* 100MHz times Max Non Turbo
Re: [U-Boot] [PATCH v2 3/4] x86: Add quick TSC calibration via PIT
On 9 November 2014 07:19, Bin Meng bmeng...@gmail.com wrote: Use the same way that Linux does for quick TSC calibration via PIT when calibration via MSR fails. Signed-off-by: Bin Meng bmeng...@gmail.com Acked-by: Simon Glass s...@chromium.org Applied to u-boot-x86/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 4/4] x86: Save TSC frequency in the global data
On 9 November 2014 07:19, Bin Meng bmeng...@gmail.com wrote: Return the saved TSC frequency in get_tbclk_mhz(). Signed-off-by: Bin Meng bmeng...@gmail.com Acked-by: Simon Glass s...@chromium.org Tested-by: Simon Glass s...@chromium.org Applied to u-boot-x86/master, thanks! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 14/39] x86: Use the standard arch_cpu_init() function
Hi, On 8 November 2014 12:40, Simon Glass s...@chromium.org wrote: On 7 November 2014 02:49, Bin Meng bmeng...@gmail.com wrote: On Fri, Nov 7, 2014 at 4:20 AM, Simon Glass s...@chromium.org wrote: Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one for this purpose. Also remove a useless/misleading comment. Signed-off-by: Simon Glass s...@chromium.org --- arch/x86/cpu/coreboot/coreboot.c | 5 + arch/x86/cpu/cpu.c| 1 - arch/x86/include/asm/u-boot-x86.h | 1 + common/board_f.c | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index e24f13a..b640f35 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -20,10 +20,7 @@ DECLARE_GLOBAL_DATA_PTR; -/* - * Miscellaneous platform dependent initializations - */ -int cpu_init_f(void) +int arch_cpu_init(void) { int ret = get_coreboot_info(lib_sysinfo); if (ret != 0) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 2e25253..d6ba246 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -130,7 +130,6 @@ int x86_cpu_init_f(void) return 0; } -int cpu_init_f(void) __attribute__((weak, alias(x86_cpu_init_f))); int x86_cpu_init_r(void) { diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 89618c7..fdb8a6c 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -9,6 +9,7 @@ #define _U_BOOT_I386_H_1 /* cpu/.../cpu.c */ +int arch_cpu_init(void); int x86_cpu_init_r(void); int cpu_init_r(void); int x86_cpu_init_f(void); diff --git a/common/board_f.c b/common/board_f.c index df02ca5..f81f70d 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -819,7 +819,6 @@ static init_fnc_t init_sequence_f[] = { #endif arch_cpu_init, /* basic arch cpu dependent setup */ #ifdef CONFIG_X86 - cpu_init_f, /* TODO(s...@chromium.org): remove */ # ifdef CONFIG_OF_CONTROL find_fdt, /* TODO(s...@chromium.org): remove */ # endif -- Reviewed-by: Bin Meng bmeng...@gmail.com Applied to u-boot-x86. Unfortunately this conflicts with your patch Bin, in that cpu_init_f() is actually still needed. I tweaked this to call cpu_init_f() from arch_cpu_init() and that seems to work. We'll have to deal with any problems with an additional patch. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
From: Fabio Estevam fabio.este...@freescale.com Since kernel 3.15 there are two dtb's for the imx53-qsb board: imx53-qsb.dtb - For the boards with DA9053 PMIC imx53-qsrb.dtb - For the boards with MC34708 PMIC Change the 'fdt_file' dynamically, so that the correct dtb can be used depending on the board variant. Signed-off-by: Fabio Estevam fabio.este...@freescale.com --- board/freescale/mx53loco/mx53loco.c | 4 include/configs/mx53loco.h | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c index b32a97f..7569ded 100644 --- a/board/freescale/mx53loco/mx53loco.c +++ b/board/freescale/mx53loco/mx53loco.c @@ -242,6 +242,8 @@ static int power_init(void) if (!p) return -ENODEV; + setenv(fdt_file, imx53-qsb.dtb); + /* Set VDDA to 1.25V */ val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V; ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val); @@ -283,6 +285,8 @@ static int power_init(void) if (!p) return -ENODEV; + setenv(fdt_file, imx53-qsrb.dtb); + /* Set VDDGP to 1.25V for 1GHz on SW1 */ pmic_reg_read(p, REG_SW_0, val); val = (val ~SWx_VOLT_MASK_MC34708) | SWx_1_250V_MC34708; diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h index a74508c..10fb1f4 100644 --- a/include/configs/mx53loco.h +++ b/include/configs/mx53loco.h @@ -107,7 +107,6 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ script=boot.scr\0 \ image=zImage\0 \ - fdt_file=imx53-qsb.dtb\0 \ fdt_addr=0x7100\0 \ boot_fdt=try\0 \ ip_dyn=yes\0 \ -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 11/11] beagle_x15: add board support for Beagle x15
Hi, On Mon, Nov 10, 2014 at 01:47:48PM -0500, Tom Rini wrote: On Thu, Nov 06, 2014 at 08:44:27AM -0600, Felipe Balbi wrote: BeagleBoard-X15 is the next generation Open Source Hardware BeagleBoard based on TI's AM5728 SoC featuring dual core 1.5GHZ A15 processor. The platform features 2GB DDR3L (w/dual 32bit busses), eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), separate LCD port, video In port, 4GB eMMC, uSD, Analog audio in/out, dual 1G Ethernet. For more information, refer to: http://www.elinux.org/Beagleboard:BeagleBoard-X15 Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Nishanth Menon n...@ti.com [snip] +static const struct emif_regs beagle_x15_ddr3_532mhz_emif_regs = { + .sdram_config_init = 0x61851B32, /* dont know what to do about this */ + .sdram_config = 0x61851B32, + .sdram_config2 = 0x, + .ref_ctrl = 0x1035, + .sdram_tim1 = 0xCEEF266B, + .sdram_tim2 = 0x328F7FDA, + .sdram_tim3 = 0x027F88A8, + .read_idle_ctrl = 0x00050001, /* not sure where in gel file */ + .zq_config = 0x0007190B, + .temp_alert_config = 0x, + .emif_ddr_phy_ctlr_1_init = 0x0E24400A, /* not sure what to do about this */ + .emif_ddr_phy_ctlr_1= 0x0E24400A, /* based on non hw level enabled */ + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, /* not sure wherein gel file */ + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, + .emif_ddr_ext_phy_ctrl_3 = 0x00780078, + .emif_ddr_ext_phy_ctrl_4 = 0x007c007c, + .emif_ddr_ext_phy_ctrl_5 = 0x007b007b, + .emif_rd_wr_lvl_rmp_win = 0x, + .emif_rd_wr_lvl_rmp_ctl = 0x, /* based on non hw level enabled */ + .emif_rd_wr_lvl_ctl = 0x, /* not sure where based in gel file */ + .emif_rd_wr_exec_thresh = 0x0305 Lets either get the timing info right or comment that we expect to need to tweak these values again later based on production HW or something. alright, I'll fix that. Apparently we have final timings now which I got over the weekend, I'll try those out. +static const u32 beagle_x15_ddr3_ext_phy_ctrl_const_regs[] = { + 0x00800080, // 6 + + + 0x00360036, // 7 + 0x00340034, // 8 + 0x00360036, // 9 + 0x00350035, // 10 + 0x00350035, // 11 + + 0x01ff01ff, // 12 // isn't allowed and what're you counting? :) heh, forgot to drop those. Now dropped. [snip] +#define CONFIG_SYS_SDRAM_BASE 0x8000 Shouldn't be needed, should be set by a common header already. dropped. -- balbi signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
On Mon, Nov 10, 2014 at 5:38 PM, Fabio Estevam feste...@gmail.com wrote: From: Fabio Estevam fabio.este...@freescale.com Since kernel 3.15 there are two dtb's for the imx53-qsb board: imx53-qsb.dtb - For the boards with DA9053 PMIC imx53-qsrb.dtb - For the boards with MC34708 PMIC Change the 'fdt_file' dynamically, so that the correct dtb can be used depending on the board variant. Signed-off-by: Fabio Estevam fabio.este...@freescale.com Acked-by: Otavio Salvador ota...@ossystems.com.br -- 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
[U-Boot] [PATCH v3 11/11] beagle_x15: add board support for Beagle x15
BeagleBoard-X15 is the next generation Open Source Hardware BeagleBoard based on TI's AM5728 SoC featuring dual core 1.5GHZ A15 processor. The platform features 2GB DDR3L (w/dual 32bit busses), eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), separate LCD port, video In port, 4GB eMMC, uSD, Analog audio in/out, dual 1G Ethernet. For more information, refer to: http://www.elinux.org/Beagleboard:BeagleBoard-X15 Signed-off-by: Felipe Balbi ba...@ti.com Signed-off-by: Nishanth Menon n...@ti.com --- Changes since v2: - new DDR timings for EMIF2 - removed some pointless comments - dropped CONFIG_SYS_SDRAM_BASE define Changes since v1: - new commit log arch/arm/cpu/armv7/omap5/Kconfig | 4 + board/ti/beagle_x15/Kconfig | 12 ++ board/ti/beagle_x15/Makefile | 8 + board/ti/beagle_x15/board.c | 395 ++ board/ti/beagle_x15/mux_data.h| 55 ++ configs/beagle_x15_defconfig | 5 + include/configs/beagle_x15.h | 88 + include/configs/ti_omap5_common.h | 2 + 8 files changed, 569 insertions(+) create mode 100644 board/ti/beagle_x15/Kconfig create mode 100644 board/ti/beagle_x15/Makefile create mode 100644 board/ti/beagle_x15/board.c create mode 100644 board/ti/beagle_x15/mux_data.h create mode 100644 configs/beagle_x15_defconfig create mode 100644 include/configs/beagle_x15.h diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig index 129982c..aca862d 100644 --- a/arch/arm/cpu/armv7/omap5/Kconfig +++ b/arch/arm/cpu/armv7/omap5/Kconfig @@ -12,6 +12,9 @@ config TARGET_OMAP5_UEVM config TARGET_DRA7XX_EVM bool TI DRA7XX +config TARGET_BEAGLE_X15 + bool BeagleBoard X15 + endchoice config SYS_SOC @@ -20,5 +23,6 @@ config SYS_SOC source board/compulab/cm_t54/Kconfig source board/ti/omap5_uevm/Kconfig source board/ti/dra7xx/Kconfig +source board/ti/beagle_x15/Kconfig endif diff --git a/board/ti/beagle_x15/Kconfig b/board/ti/beagle_x15/Kconfig new file mode 100644 index 000..a305ff1 --- /dev/null +++ b/board/ti/beagle_x15/Kconfig @@ -0,0 +1,12 @@ +if TARGET_BEAGLE_X15 + +config SYS_BOARD + default beagle_x15 + +config SYS_VENDOR + default ti + +config SYS_CONFIG_NAME + default beagle_x15 + +endif diff --git a/board/ti/beagle_x15/Makefile b/board/ti/beagle_x15/Makefile new file mode 100644 index 000..5cd6873 --- /dev/null +++ b/board/ti/beagle_x15/Makefile @@ -0,0 +1,8 @@ +# +# (C) Copyright 2014 +# Texas Instruments, www.ti.com +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := board.o diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c new file mode 100644 index 000..db96e34 --- /dev/null +++ b/board/ti/beagle_x15/board.c @@ -0,0 +1,395 @@ +/* + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com + * + * Author: Felipe Balbi ba...@ti.com + * + * Based on board/ti/dra7xx/evm.c + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include common.h +#include palmas.h +#include sata.h +#include usb.h +#include asm/omap_common.h +#include asm/emif.h +#include asm/arch/clock.h +#include asm/arch/sys_proto.h +#include asm/arch/mmc_host_def.h +#include asm/arch/sata.h +#include asm/arch/gpio.h +#include environment.h + +#include mux_data.h + +#ifdef CONFIG_DRIVER_TI_CPSW +#include cpsw.h +#endif + +DECLARE_GLOBAL_DATA_PTR; + +const struct omap_sysinfo sysinfo = { + Board: BeagleBoard x15\n +}; + +static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = { + .dmm_lisa_map_3 = 0x80740300, + .is_ma_present = 0x1 +}; + +void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) +{ + *dmm_lisa_regs = beagle_x15_lisa_regs; +} + +static const struct emif_regs beagle_x15_emif1_ddr3_532mhz_emif_regs = { + .sdram_config_init = 0x61851b32, + .sdram_config = 0x61851b32, + .sdram_config2 = 0x, + .ref_ctrl = 0x1035, + .sdram_tim1 = 0xceef266b, + .sdram_tim2 = 0x328f7fda, + .sdram_tim3 = 0x027f88a8, + .read_idle_ctrl = 0x00050001, + .zq_config = 0x0007190b, + .temp_alert_config = 0x, + .emif_ddr_phy_ctlr_1_init = 0x0e24400a, + .emif_ddr_phy_ctlr_1= 0x0e24400a, + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, + .emif_ddr_ext_phy_ctrl_3 = 0x00780078, + .emif_ddr_ext_phy_ctrl_4 = 0x007c007c, + .emif_ddr_ext_phy_ctrl_5 = 0x007b007b, + .emif_rd_wr_lvl_rmp_win = 0x, + .emif_rd_wr_lvl_rmp_ctl = 0x, + .emif_rd_wr_lvl_ctl = 0x, + .emif_rd_wr_exec_thresh = 0x0305 +}; + +static const u32 beagle_x15_emif1_ddr3_ext_phy_ctrl_const_regs[] = { + 0x00800080, + 0x00360036, + 0x00340034, + 0x00360036, + 0x00350035, +
Re: [U-Boot] [PATCH v3 1/3] usb:ehci-mx6 add board_usb_phy_mode function
On Monday, November 10, 2014 at 02:01:50 AM, Peng Fan wrote: [...] + in usb_phy_mode, query a PHY for it's mode. And righter after usb_phy_enable in ehci-mx6.c. - type = usb_phy_enable(index, ehci) ? USB_INIT_DEVICE : USB_INIT_HOST; + usb_phy_enable(index, ehci); + type = usb_phy_mode(index); usb_phy_enable return 0 but not return val USBPHY_CTRL_OTG_ID. There is no status bit for query enabled or not, so just return 0. In board file: int board_usb_phy_mode(int port) { if (port == 1) return USB_INIT_HOST; else return usb_phy_mode(port); } I think this is better way then previous patch, but i did not find where to put the usb_phy_mode prototype type, since board file will use it. Looks OK otherwise. Sent out v4 patch, please review. Thanks! Will do as time permits. Sorry for possible delays. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v7 1/6] sandbox: Use md5sum and fatwrite to enable testing of fs commands
Enable md5sum to check the MD5 of the read and written files to check their contents for validity. Use map_sysmem() to map buffer in a sandbox environment. Signed-off-by: Suriyan Ramasami suriya...@gmail.com Acked-by: Simon Glass s...@chromium.org --- Changes in v7: * No changes common/cmd_md5sum.c | 12 ++-- include/configs/sandbox.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/cmd_md5sum.c b/common/cmd_md5sum.c index 3ac8cc4..d22ace5 100644 --- a/common/cmd_md5sum.c +++ b/common/cmd_md5sum.c @@ -11,6 +11,7 @@ #include common.h #include command.h #include u-boot/md5.h +#include asm/io.h /* * Store the resulting sum to an address or variable @@ -79,6 +80,7 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int verify = 0; int ac; char * const *av; + void *buf; if (argc 3) return CMD_RET_USAGE; @@ -96,7 +98,9 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) addr = simple_strtoul(*av++, NULL, 16); len = simple_strtoul(*av++, NULL, 16); - md5_wd((unsigned char *) addr, len, output, CHUNKSZ_MD5); + buf = map_sysmem(addr, len); + md5_wd(buf, len, output, CHUNKSZ_MD5); + unmap_sysmem(buf); if (!verify) { printf(md5 for %08lx ... %08lx == , addr, addr + len - 1); @@ -135,6 +139,7 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) unsigned long addr, len; unsigned int i; u8 output[16]; + void *buf; if (argc 3) return CMD_RET_USAGE; @@ -142,7 +147,10 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) addr = simple_strtoul(argv[1], NULL, 16); len = simple_strtoul(argv[2], NULL, 16); - md5_wd((unsigned char *) addr, len, output, CHUNKSZ_MD5); + buf = map_sysmem(addr, len); + md5_wd(buf, len, output, CHUNKSZ_MD5); + unmap_sysmem(buf); + printf(md5 for %08lx ... %08lx == , addr, addr + len - 1); for (i = 0; i 16; i++) printf(%02x, output[i]); diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index ee4b244..2b03841 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -48,6 +48,7 @@ #define CONFIG_ANDROID_BOOT_IMAGE #define CONFIG_FS_FAT +#define CONFIG_FAT_WRITE #define CONFIG_FS_EXT4 #define CONFIG_EXT4_WRITE #define CONFIG_CMD_FAT @@ -57,6 +58,7 @@ #define CONFIG_DOS_PARTITION #define CONFIG_HOST_MAX_DEVICES 4 #define CONFIG_CMD_FS_GENERIC +#define CONFIG_CMD_MD5SUM #define CONFIG_SYS_VSNPRINTF -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v7 2/6] fat: prepare for API change for files greater than 2GB
Change the internal fat functions to use loff_t for offsets. Signed-off-by: Suriyan Ramasami suriya...@gmail.com --- Changes in v7: * Split it so that its bisectable. common/cmd_fat.c | 9 ++-- common/env_fat.c | 4 +- fs/fat/fat.c | 133 +++-- fs/fat/fat_write.c | 61 +--- fs/fat/file.c | 4 +- include/fat.h | 13 +++--- 6 files changed, 128 insertions(+), 96 deletions(-) diff --git a/common/cmd_fat.c b/common/cmd_fat.c index 633fbf1..c00fb28 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -100,7 +100,8 @@ U_BOOT_CMD( static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - long size; + loff_t size; + int ret; unsigned long addr; unsigned long count; block_dev_desc_t *dev_desc = NULL; @@ -127,15 +128,15 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, count = simple_strtoul(argv[5], NULL, 16); buf = map_sysmem(addr, count); - size = file_fat_write(argv[4], buf, count); + ret = file_fat_write(argv[4], buf, 0, count, size); unmap_sysmem(buf); - if (size == -1) { + if (ret 0) { printf(\n** Unable to write \%s\ from %s %d:%d **\n, argv[4], argv[1], dev, part); return 1; } - printf(%ld bytes written\n, size); + printf(%llu bytes written\n, size); return 0; } diff --git a/common/env_fat.c b/common/env_fat.c index 8db0160..9a6ce63 100644 --- a/common/env_fat.c +++ b/common/env_fat.c @@ -41,6 +41,7 @@ int saveenv(void) disk_partition_t info; int dev, part; int err; + loff_t size; err = env_export(env_new); if (err) @@ -59,7 +60,8 @@ int saveenv(void) return 1; } - err = file_fat_write(FAT_ENV_FILE, (void *)env_new, sizeof(env_t)); + err = file_fat_write(FAT_ENV_FILE, (void *)env_new, sizeof(env_t), +size); if (err == -1) { printf(\n** Unable to write \%s\ from %s%d:%d **\n, FAT_ENV_FILE, FAT_ENV_INTERFACE, dev, part); diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 561921f..29d0825 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -317,32 +317,33 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size) /* * Read at most 'maxsize' bytes from 'pos' in the file associated with 'dentptr' * into 'buffer'. - * Return the number of bytes read or -1 on fatal errors. + * Update the number of bytes read in *gotsize or return -1 on fatal errors. */ __u8 get_contents_vfatname_block[MAX_CLUSTSIZE] __aligned(ARCH_DMA_MINALIGN); -static long -get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos, -__u8 *buffer, unsigned long maxsize) +static int +get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos, +__u8 *buffer, loff_t maxsize, loff_t *gotsize) { - unsigned long filesize = FAT2CPU32(dentptr-size), gotsize = 0; + loff_t filesize = FAT2CPU32(dentptr-size); unsigned int bytesperclust = mydata-clust_size * mydata-sect_size; __u32 curclust = START(dentptr); __u32 endclust, newclust; - unsigned long actsize; + loff_t actsize; - debug(Filesize: %ld bytes\n, filesize); + *gotsize = 0; + debug(Filesize: %llu bytes\n, filesize); if (pos = filesize) { - debug(Read position past EOF: %lu\n, pos); - return gotsize; + debug(Read position past EOF: %llu\n, pos); + return 0; } if (maxsize 0 filesize pos + maxsize) filesize = pos + maxsize; - debug(%ld bytes\n, filesize); + debug(%llu bytes\n, filesize); actsize = bytesperclust; @@ -352,7 +353,7 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos, if (CHECK_CLUST(curclust, mydata-fatsize)) { debug(curclust: 0x%x\n, curclust); debug(Invalid FAT entry\n); - return gotsize; + return 0; } actsize += bytesperclust; } @@ -373,16 +374,16 @@ get_contents(fsdata *mydata, dir_entry *dentptr, unsigned long pos, filesize -= actsize; actsize -= pos; memcpy(buffer, get_contents_vfatname_block + pos, actsize); - gotsize += actsize; + *gotsize += actsize; if (!filesize) - return gotsize; + return 0; buffer += actsize; curclust = get_fatent(mydata, curclust); if (CHECK_CLUST(curclust, mydata-fatsize)) { debug(curclust: 0x%x\n, curclust);
[U-Boot] [PATCH v7 3/6] ext4: prepare for API change for files greater than 2GB
Change the internal ext4 functions to use loff_t for offsets. Signed-off-by: Suriyan Ramasami suriya...@gmail.com --- Changes in v7: * Split it so that its bisectable. common/cmd_ext4.c | 61 +++ fs/ext4/ext4_common.c | 24 ++-- fs/ext4/ext4_common.h | 4 ++-- fs/ext4/ext4_write.c | 32 +++ fs/ext4/ext4fs.c | 43 +++- include/ext4fs.h | 8 --- 6 files changed, 88 insertions(+), 84 deletions(-) diff --git a/common/cmd_ext4.c b/common/cmd_ext4.c index ecfc6d3..19423d1 100644 --- a/common/cmd_ext4.c +++ b/common/cmd_ext4.c @@ -61,61 +61,16 @@ int do_ext4_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) #if defined(CONFIG_CMD_EXT4_WRITE) int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc, - char *const argv[]) + char *const argv[]) { - const char *filename = /; - int dev, part; - unsigned long ram_address; - unsigned long file_size; - disk_partition_t info; - block_dev_desc_t *dev_desc; - - if (argc 6) - return cmd_usage(cmdtp); - - part = get_device_and_partition(argv[1], argv[2], dev_desc, info, 1); - if (part 0) - return 1; - - dev = dev_desc-dev; - - /* get the filename */ - filename = argv[4]; - - /* get the address in hexadecimal format (string to int) */ - ram_address = simple_strtoul(argv[3], NULL, 16); - - /* get the filesize in hexadecimal format */ - file_size = simple_strtoul(argv[5], NULL, 16); - - /* set the device as block device */ - ext4fs_set_blk_dev(dev_desc, info); - - /* mount the filesystem */ - if (!ext4fs_mount(info.size)) { - printf(Bad ext4 partition %s %d:%d\n, argv[1], dev, part); - goto fail; - } - - /* start write */ - if (ext4fs_write(filename, (unsigned char *)ram_address, file_size)) { - printf(** Error ext4fs_write() **\n); - goto fail; - } - ext4fs_close(); - - return 0; - -fail: - ext4fs_close(); - - return 1; + return do_save(cmdtp, flag, argc, argv, FS_TYPE_EXT); } -U_BOOT_CMD(ext4write, 6, 1, do_ext4_write, - create a file in the root directory, - interface dev[:part] addr absolute filename path [sizebytes]\n - - create a file in / directory); +U_BOOT_CMD(ext4write, 7, 1, do_ext4_write, + create a file in the root directory, + interface dev[:part] addr absolute filename path\n + [sizebytes] [file offset]\n + - create a file in / directory); #endif @@ -132,7 +87,7 @@ U_BOOT_CMD(ext4ls, 4, 1, do_ext4_ls, interface dev[:part] [directory]\n - list files from 'dev' on 'interface' in a 'directory'); -U_BOOT_CMD(ext4load, 6, 0, do_ext4_load, +U_BOOT_CMD(ext4load, 7, 0, do_ext4_load, load binary file from a Ext4 filesystem, interface [dev[:part] [addr [filename [bytes [pos]\n - load binary file 'filename' from 'dev' on 'interface'\n diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 33d69c9..3b8df3f 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -1891,6 +1891,7 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name, { unsigned int fpos = 0; int status; + loff_t actread; struct ext2fs_node *diro = (struct ext2fs_node *) dir; #ifdef DEBUG @@ -1908,8 +1909,8 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name, status = ext4fs_read_file(diro, fpos, sizeof(struct ext2_dirent), - (char *) dirent); - if (status 1) + (char *)dirent, actread); + if (status 0) return 0; if (dirent.namelen != 0) { @@ -1920,8 +1921,9 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name, status = ext4fs_read_file(diro, fpos + sizeof(struct ext2_dirent), - dirent.namelen, filename); - if (status 1) + dirent.namelen, filename, + actread); + if (status 0) return 0; fdiro = zalloc(sizeof(struct ext2fs_node)); @@ -2003,8 +2005,8 @@ int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name, printf( ? ); break; } -
[U-Boot] [PATCH v7 4/6] sandbox: prepare for API change for files greater than 2GB
Change the internal ext4 functions to use loff_t for offsets. Signed-off-by: Suriyan Ramasami suriya...@gmail.com --- Changes in v7: * Split it so that its bisectable. arch/sandbox/cpu/os.c| 13 arch/sandbox/cpu/state.c | 8 ++--- common/board_f.c | 8 ++--- fs/sandbox/sandboxfs.c | 78 ++-- include/os.h | 5 ++-- include/sandboxfs.h | 6 ++-- 6 files changed, 77 insertions(+), 41 deletions(-) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 1c4aa3f..31c9344 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -385,7 +385,7 @@ const char *os_dirent_get_typename(enum os_dirent_t type) return os_dirent_typename[OS_FILET_UNKNOWN]; } -ssize_t os_get_filesize(const char *fname) +int os_get_filesize(const char *fname, loff_t *size) { struct stat buf; int ret; @@ -393,7 +393,8 @@ ssize_t os_get_filesize(const char *fname) ret = stat(fname, buf); if (ret) return ret; - return buf.st_size; + *size = buf.st_size; + return 0; } void os_putc(int ch) @@ -427,11 +428,11 @@ int os_read_ram_buf(const char *fname) { struct sandbox_state *state = state_get_current(); int fd, ret; - int size; + loff_t size; - size = os_get_filesize(fname); - if (size 0) - return -ENOENT; + ret = os_get_filesize(fname, size); + if (ret 0) + return ret; if (size != state-ram_size) return -ENOSPC; fd = open(fname, O_RDONLY); diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 59adad6..ba73b7e 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -49,14 +49,14 @@ static int state_ensure_space(int extra_size) static int state_read_file(struct sandbox_state *state, const char *fname) { - int size; + loff_t size; int ret; int fd; - size = os_get_filesize(fname); - if (size 0) { + ret = os_get_filesize(fname, size); + if (ret 0) { printf(Cannot find sandbox state file '%s'\n, fname); - return -ENOENT; + return ret; } state-state_fdt = os_malloc(size); if (!state-state_fdt) { diff --git a/common/board_f.c b/common/board_f.c index e6aa298..a89e455 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -291,7 +291,7 @@ static int read_fdt_from_file(void) struct sandbox_state *state = state_get_current(); const char *fname = state-fdt_fname; void *blob; - ssize_t size; + loff_t size; int err; int fd; @@ -304,10 +304,10 @@ static int read_fdt_from_file(void) return -EINVAL; } - size = os_get_filesize(fname); - if (size 0) { + err = os_get_filesize(fname, size); + if (err 0) { printf(Failed to file FDT file '%s'\n, fname); - return -ENOENT; + return err; } fd = os_open(fname, OS_O_RDONLY); if (fd 0) { diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c index ba6402c..312caec 100644 --- a/fs/sandbox/sandboxfs.c +++ b/fs/sandbox/sandboxfs.c @@ -13,10 +13,10 @@ int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) return 0; } -long sandbox_fs_read_at(const char *filename, unsigned long pos, -void *buffer, unsigned long maxsize) +int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer, + loff_t maxsize, loff_t *actread) { - ssize_t size; + loff_t size; int fd, ret; fd = os_open(filename, OS_O_RDONLY); @@ -27,16 +27,31 @@ long sandbox_fs_read_at(const char *filename, unsigned long pos, os_close(fd); return ret; } - if (!maxsize) - maxsize = os_get_filesize(filename); + if (!maxsize) { + ret = os_get_filesize(filename, size); + if (ret) { + os_close(fd); + return ret; + } + + maxsize = size; + } + size = os_read(fd, buffer, maxsize); os_close(fd); - return size; + if (size 0) { + ret = -1; + } else { + ret = 0; + *actread = size; + } + + return ret; } -long sandbox_fs_write_at(const char *filename, unsigned long pos, -void *buffer, unsigned long towrite) +int sandbox_fs_write_at(const char *filename, loff_t pos, void *buffer, + loff_t towrite, loff_t *actwrite) { ssize_t size; int fd, ret; @@ -52,7 +67,14 @@ long sandbox_fs_write_at(const char *filename, unsigned long pos, size = os_write(fd, buffer, towrite); os_close(fd); -
[U-Boot] [PATCH v7 5/6] fs: API changes to enable extra parameter to return size of type loff_t
The sandbox/ext4/fat/generic fs commands do not gracefully deal with file greater than 2GB. Negative values are returned in such cases. To handle this, the fs functions have been modified to take an additional parameter of type * loff_t which is then populated. The return value of the fs fucntions are used only for error conditions. Signed-off-by: Suriyan Ramasami suriya...@gmail.com --- Changes in v7: * Simon - API change in separate patch common/cmd_fs.c| 17 +++ fs/ext4/ext4fs.c | 22 --- fs/fat/fat.c | 20 - fs/fs.c| 77 ++ fs/sandbox/sandboxfs.c | 29 +++ include/ext4fs.h | 5 ++-- include/fat.h | 5 ++-- include/fs.h | 41 --- include/sandboxfs.h| 8 -- 9 files changed, 121 insertions(+), 103 deletions(-) diff --git a/common/cmd_fs.c b/common/cmd_fs.c index 6754340..0d9da11 100644 --- a/common/cmd_fs.c +++ b/common/cmd_fs.c @@ -51,6 +51,23 @@ U_BOOT_CMD( If 'pos' is 0 or omitted, the file is read from the start. ) +static int do_save_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + return do_save(cmdtp, flag, argc, argv, FS_TYPE_ANY); +} + +U_BOOT_CMD( + save, 7, 0, do_save_wrapper, + save file to a filesystem, + interface dev[:part] addr filename bytes [pos]\n + - Save binary file 'filename' to partition 'part' on device\n + type 'interface' instance 'dev' from addr 'addr' in memory.\n + 'bytes' gives the size to save in bytes and is mandatory.\n + 'pos' gives the file byte position to start writing to.\n + If 'pos' is 0 or omitted, the file is written from the start. +) + static int do_ls_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index dcb4151..ae1c47d 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -184,16 +184,9 @@ int ext4fs_exists(const char *filename) return ret == 0; } -int ext4fs_size(const char *filename) +int ext4fs_size(const char *filename, loff_t *size) { - loff_t size; - int ret; - - ret = ext4fs_open(filename, size); - if (ret) - return ret; - else - return size; + return ext4fs_open(filename, size); } int ext4fs_read(char *buf, loff_t len, loff_t *actread) @@ -217,10 +210,10 @@ int ext4fs_probe(block_dev_desc_t *fs_dev_desc, return 0; } -int ext4_read_file(const char *filename, void *buf, int offset, int len) +int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len, + loff_t *len_read) { loff_t file_len; - loff_t len_read; int ret; if (offset != 0) { @@ -237,10 +230,7 @@ int ext4_read_file(const char *filename, void *buf, int offset, int len) if (len == 0) len = file_len; - ret = ext4fs_read(buf, len, len_read); + ret = ext4fs_read(buf, len, len_read); - if (ret) - return ret; - else - return len_read; + return ret; } diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 29d0825..993b1f2 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1248,16 +1248,9 @@ int fat_exists(const char *filename) return ret == 0; } -int fat_size(const char *filename) +int fat_size(const char *filename, loff_t *size) { -loff_t size; -int ret; - - ret = do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1, size); - if (ret) - return ret; - else - return size; + return do_fat_read_at(filename, 0, NULL, 0, LS_NO, 1, size); } int file_fat_read_at(const char *filename, loff_t pos, void *buffer, @@ -1280,18 +1273,17 @@ int ret; return actread; } -int fat_read_file(const char *filename, void *buf, int offset, int len) +int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len, + loff_t *actread) { int ret; - loff_t actread; - ret = file_fat_read_at(filename, offset, buf, len, actread); + ret = file_fat_read_at(filename, offset, buf, len, actread); if (ret) { printf(** Unable to read file %s **\n, filename); - return ret; } - return actread; + return ret; } void fat_close(void) diff --git a/fs/fs.c b/fs/fs.c index dd680f3..0f5a1f4 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -46,19 +46,21 @@ static inline int fs_exists_unsupported(const char *filename) return 0; } -static inline int fs_size_unsupported(const char *filename) +static inline int fs_size_unsupported(const char *filename, loff_t *size) { return -1; } static inline int fs_read_unsupported(const char *filename,
[U-Boot] [PATCH v7 6/6] sandbox: script for testing sandbox/ext4/fat/fs commands
Test size/read/write commands in a sandbox environment. Signed-off-by: Suriyan Ramasami suriya...@gmail.com --- Changes in v7: * Simon - take care of fat/vfat in mkfs - fs/nonfs test code repeats, put it in function test/fs/fs-test.sh | 561 + 1 file changed, 561 insertions(+) create mode 100755 test/fs/fs-test.sh diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh new file mode 100755 index 000..a4fb055 --- /dev/null +++ b/test/fs/fs-test.sh @@ -0,0 +1,561 @@ +#!/bin/bash +# +# (C) Copyright 2014 Suriyan Ramasami +# +# SPDX-License-Identifier:GPL-2.0+ +# + +# Invoke this test script from U-Boot base directory as ./test/fs/fs-test.sh +# It currently tests the fs/sb and native commands for ext4 and fat partitions +# Expected results are as follows: +# EXT4 tests: +# fs-test.sb.ext4.out: Summary: PASS: 17 FAIL: 2 +# fs-test.ext4.out: Summary: PASS: 11 FAIL: 8 +# fs-test.fs.ext4.out: Summary: PASS: 11 FAIL: 8 +# FAT tests: +# fs-test.sb.fat.out: Summary: PASS: 17 FAIL: 2 +# fs-test.fat.out: Summary: PASS: 19 FAIL: 0 +# fs-test.fs.fat.out: Summary: PASS: 19 FAIL: 0 +# Total Summary: TOTAL PASS: 94 TOTAL FAIL: 20 + +# pre-requisite binaries list. +PREREQ_BINS=md5sum mkfs mount umount dd fallocate mkdir + +# All generated output files from this test will be in $OUT_DIR +# Hence everything is sandboxed. +OUT_DIR=sandbox/test/fs + +# Location of generated sandbox u-boot +UBOOT=./sandbox/u-boot + +# Our mount directory will be in the sandbox +MOUNT_DIR=${OUT_DIR}/mnt + +# The file system image we create will have the $IMG prefix. +IMG=${OUT_DIR}/3GB + +# $SMALL_FILE is the name of the 1MB file in the file system image +SMALL_FILE=1MB.file + +# $BIG_FILE is the name of the 2.5GB file in the file system image +BIG_FILE=2.5GB.file + +# $MD5_FILE will have the expected md5s when we do the test +# They shall have a suffix which represents their file system (ext4/fat) +MD5_FILE=${OUT_DIR}/md5s.list + +# $OUT shall be the prefix of the test output. Their suffix will be .out +OUT=${OUT_DIR}/fs-test + +# Full Path of the 1 MB file that shall be created in the fs image. +MB1=${MOUNT_DIR}/${SMALL_FILE} +GB2p5=${MOUNT_DIR}/${BIG_FILE} + +# +# * Functions start here * +# + +# Check if the prereq binaries exist, or exit +function check_prereq() { + for prereq in $PREREQ_BINS; do + if [ ! -x `which $prereq` ]; then + echo Missing $prereq binary. Exiting! + exit + fi + done + + # We use /dev/urandom to create files. Check if it exists. + if [ ! -c /dev/urandom ]; then + echo Missing character special /dev/urandom. Exiting! + exit + fi +} + +# If 1st param is clean, then clean out the generated files and exit +function check_clean() { + if [ $1 = clean ]; then + rm -rf $OUT_DIR + echo Cleaned up generated files. Exiting + exit + fi +} + +# Generate sandbox U-Boot - gleaned from /test/dm/test-dm.sh +function compile_sandbox() { + unset CROSS_COMPILE + NUM_CPUS=$(cat /proc/cpuinfo |grep -c processor) + make O=sandbox sandbox_config + make O=sandbox -s -j${NUM_CPUS} + + # Check if U-Boot exists + if [ ! -x $UBOOT ]; then + echo $UBOOT does not exist or is not executable + echo Build error? + echo Please run this script as ./test/fs/`basename $0` + exit + fi +} + +# Clean out all generated files other than the file system images +# We save time by not deleting and recreating the file system images +function prepare_env() { + rm -f ${MD5_FILE}.* ${OUT}.* + mkdir ${OUT_DIR} +} + +# 1st parameter is the name of the image file to be created +# 2nd parameter is the filesystem - fat ext4 etc +# -F cant be used with fat as it means something else. +function create_image() { + # Create image if not already present - saves time, while debugging + if [ $2 = ext4 ]; then + MKFS_OPTION=-F + else + MKFS_OPTION= + fi + if [ ! -f $1 ]; then + fallocate -l 3G $1 /dev/null + mkfs -t $2 $MKFS_OPTION $1 /dev/null + if [ $? -ne 0 -a $2 = fat ]; then + # If we fail and we did fat, try vfat. + mkfs -t vfat $MKFS_OPTION $1 /dev/null + fi + fi +} + +# 1st parameter is the FS type: fat/ext4 +# 2nd parameter is the name of small file +# Returns filename which can be used for fat or ext4 for writing +function fname_for_write() { + case $1 in + ext4) + # ext4 needs absolute path name of file + echo /${2}.w + ;; + + *) + echo ${2}.w + ;; + esac
Re: [U-Boot] porting u-boot, few final questions
Update: my board_late_init() function wasn’t working because I defined BOARD_LATE_INIT instead of CONFIG_BOARD_LATE_INIT. Doh! Since arch/arm/lib/board.c file is being removed, and when CONFIG_SYS_GENERIC_BOARD is defined, we are now using… common/board_f.c (for pre-relocation init) common/board_r.c (for post-relocation init) So my board file sequence is (in order of calling sequence according to the above two files)… 1. board_early_init_f() – needed to setup my uart, otherwise early output is missed 2. checkboard() – print board info - still in flash 3. board_init() – says chipselects should be setup here – we are running from RAM now 4. initr_env() is called here 5. board_late_init() - Nikolay, appears you are correct, initr_env must be called first in order to use setenv. That’s why setenv didn’t work in board_early_init_f or checkboard or board_init. Fabio, your change worked when I use setenv in misc_init_r and helped me debug some issues. Thanks guys. Is there a doc or a good read that explains which init functions are necessary for what? Or which ones should be used for “proper” design? I’m sure I’ll be back with more questions real soon. :) -- View this message in context: http://u-boot.10912.n7.nabble.com/porting-u-boot-MMU-question-tp194761p195451.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,2/6] sandbox: init cli for -c
On Wed, Oct 29, 2014 at 11:21:38PM +0100, Rabin Vincent wrote: sandbox crashes if a variable is set in the -c command, because hush's top_vars is not allocated. Call cli_init() from sandbox to ensure this is done before we execute the -c command. $ ./u-boot -c 'a=1' ... Segmentation fault (core dumped) Signed-off-by: Rabin Vincent ra...@rab.in Acked-by: Simon Glass s...@chromium.org) Tested-by: Simon Glass s...@chromium.org) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] power_spi.c: Rewrite pmic_reg function
On Sat, Oct 25, 2014 at 07:38:31AM -0400, Tom Rini wrote: The pmic_spi_free function isn't ever used, and as the frameworks stand today, cannot be, so remove it. Integrate the probe function into pmic_reg as it's not really a probe today. Finally, add an err label for the common failure cases. Cc: Lukasz Majewski l.majew...@samsung.com Cc: Przemyslaw Marczak p.marc...@samsung.com Cc: Stefano Babic sba...@denx.de Signed-off-by: Tom Rini tr...@ti.com Acked-by: Stefano Babic sba...@denx.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] image-fdt: boot_get_fdt() return value when no DTB exists
On Wed, Oct 22, 2014 at 05:17:49PM +0300, Noam Camus wrote: From: Noam Camus no...@ezchip.com I believe that when no DTB is around we should return 1. This why I fixed such scenarious to not return zero anymore. Else kernel might get NULL pointer to DTB which doesn't exists. Signed-off-by: Noam Camus no...@ezchip.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 3/6] hush: return consistent codes from run_command()
On Wed, Oct 29, 2014 at 11:21:39PM +0100, Rabin Vincent wrote: Attempting to run: - an empty string - a string with just spaces returns different error codes, 1 for the empty string and 0 for the string with just spaces. Make both of them return 0 for consistency. Signed-off-by: Rabin Vincent ra...@rab.in Acked-by: Simon Glass s...@chromium.org) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 1/6] dlmalloc: ensure gd is set for early alloc
On Wed, Oct 29, 2014 at 11:21:37PM +0100, Rabin Vincent wrote: Attempting to run the sandbox leads to a segfault, because some dynamic libraries (outside of u-boot) attempt to use malloc() to allocate memory before u-boot's gd variable is initialized. Check for gd not being NULL in the SYS_MALLOC_F_LEN handling, so that malloc() doesn't crash when called at this point. $ gdb -q --args ./u-boot (gdb) r Program received signal SIGSEGV, Segmentation fault. 0x00412b9b in malloc (bytes=bytes@entry=37) at common/dlmalloc.c:2184 2184 if (!(gd-flags GD_FLG_RELOC)) { (gdb) p gd $1 = (gd_t *) 0x0 (gdb) bt #0 0x00412b9b in malloc (bytes=bytes@entry=37) at common/dlmalloc.c:2184 #1 0x775bf8e1 in set_binding_values (domainname=0x711f4f12 libgpg-error, dirnamep=0x7fffe168, codesetp=0x0) at bindtextdom.c:228 #2 0x775bfb4c in set_binding_values (codesetp=0x0, dirnamep=0x7fffe168, domainname=optimized out) at bindtextdom.c:350 #3 __bindtextdomain (domainname=optimized out, dirname=0x711f4f00 /usr/share/locale) at bindtextdom.c:348 #4 0x711eca17 in ?? () from /lib/x86_64-linux-gnu/libgpg-error.so.0 #5 0x77dea9fa in call_init (l=optimized out, argc=argc@entry=1, argv=argv@entry=0x7fffe208, env=env@entry=0x7fffe218) at dl-init.c:78 #6 0x77deaae3 in call_init (env=0x7fffe218, argv=0x7fffe208, argc=1, l=optimized out) at dl-init.c:36 #7 _dl_init (main_map=0x77ffe1a8, argc=1, argv=0x7fffe208, env=0x7fffe218) at dl-init.c:126 #8 0x77ddd1ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 Signed-off-by: Rabin Vincent ra...@rab.in Acked-by: Simon Glass s...@chromium.org Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 2/6] kbuild: improve multi-objs dependency and cleanups
On Thu, Oct 30, 2014 at 11:06:10AM +0900, Masahiro Yamada wrote: Since Linux 3.18-rc1, Kbuild is able to handle multi-objs dependency correctly, which also allows us futher cleanups of some makefiles. This commit imports those commits: [1] commit c8589d1e9e01 by Masahiro Yamada kbuild: handle multi-objs dependency appropriately [2] commit 97e3226e6e98 by Masahiro Yamada kbuild: handle the dependency of multi-objs hostprogs appropriately [3] commit 022af62d0190 by Masahiro Yamada kbuild: refactor script/kconfig/Makefile [4] commit 221ecca6cafe by Masahiro Yamada kbuild: remove redundant clean-files from scripts/kconfig/Makefile Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,4/6] hush: fix segfault on syntax error
On Wed, Oct 29, 2014 at 11:21:40PM +0100, Rabin Vincent wrote: Hush segfaults if it sees a syntax error while attempting to parse a command: $ ./u-boot -c ' ... syntax error Segmentation fault (core dumped) This is due to a NULL pointer dereference of in_str-p in static_peek(). The problem is that the exit condition for the loop in parse_stream_outer() checks for rcode not being -1, but rcode is only ever 0 or 1. Signed-off-by: Rabin Vincent ra...@rab.in Acked-by: Simon Glass s...@chromium.org) Tested-by: Simon Glass s...@chromium.org) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 5/6] hush: make run_command() return an error on parsing failure
On Wed, Oct 29, 2014 at 11:21:41PM +0100, Rabin Vincent wrote: run_command() returns success even if the command had a syntax error; correct this behaviour. Signed-off-by: Rabin Vincent ra...@rab.in Acked-by: Simon Glass s...@chromium.org) Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] kbuild: remove clobber target
On Thu, Oct 30, 2014 at 10:58:32AM +0900, Masahiro Yamada wrote: Now we stick to Linux Kernel's build system, so squash clobber to clean target. Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 1/6] kbuild: bug fixes and cleanups of Makefile.host
On Thu, Oct 30, 2014 at 11:06:09AM +0900, Masahiro Yamada wrote: This commit imports updates of scripts/Makefile.host from Linux 3.18-rc1. Imported commits are: [1] commit d8d9efe22709 by Masahiro Yamada kbuild: fix a typo in scripts/Makefile.host [2] commit edb950c17de0 by Masahiro Yamada kbuild: fix a bug of C++ host program handling [3] commit 62e2210798ed by Masahiro Yamada kbuild: drop shared library support from Makefile.host [4] commit 663935593915 by Masahiro Yamada kbuild: clean up scripts/Makefile.host [5] commit 1791ff7179f6 by Masahiro Yamada kbuild: clean-up and bug fix of scripts/Makefile.host Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] tools/env: Fix environment size and CRC on 64-bit hosts
On Wed, Nov 05, 2014 at 12:30:18AM +0100, Dominic Sacré wrote: On architectures where 'long' is 64 bit, the u-boot environment as seen by the fw_env tools was missing 4 bytes. This patch fixes getenvsize(), and thus also ensures that the environment's CRC32 checksum is calculated correctly. Signed-off-by: Dominic Sacré dominic.sa...@gmx.de Cc: Wolfgang Denk w...@denx.de Cc: Tom Rini tr...@ti.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 4/6] kconfig: sync kconfig files with Linux 3.18-rc1
On Thu, Oct 30, 2014 at 11:06:12AM +0900, Masahiro Yamada wrote: This commit imports Kconfig updates from Linux 3.18-rc1. 'kvmconfig' and 'tinyconfig' help message have been commented out since they are unavailable at least now; in the future perhaps we can implement 'tinyconfig' to disable most of CONFIG_CMD_* to create a very small U-Boot image. [1] commit 3aaefce10351 by Josh Triplett x86, platform, kconfig: move kvmconfig functionality to a helper [2] commit 0da1d4a0b951 by Josh Triplett x86: Add make tinyconfig to configure the tiniest possible kernel [3] commit c40724d3f381 by Brian Norris kconfig: lxdialog: fix spelling [4] commit 7285996aa000 by Brian Norris kconfig: nconfig: fix multi-byte UTF handling Signed-off-by: Josh Triplett j...@joshtriplett.org Signed-off-by: Brian Norris computersforpe...@gmail.com Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2] doc: fix documentation of out-of-tree build
On Thu, Nov 06, 2014 at 02:39:05PM +0200, Timo Ketola wrote: Correct environment variable for output directory is KBUILD_OUTPUT. Signed-off-by: Timo Ketola t...@exertus.fi Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 5/6] kbuild: sync misc scripts with Linux 3.18-rc1
On Thu, Oct 30, 2014 at 11:06:13AM +0900, Masahiro Yamada wrote: This commit imports some updates in misc scripts from Linux 3.18-rc1. [1] commit cbb4d3e6510b99522719c5ef0 by Horia Geanta scripts/kernel-doc: handle object-like macros [2] commit 164f0d2efaaef83 by Michal Marek kbuild: Fix handling of backslashes in *.cmd files [3] commit 270a00963cd367214e by Randy Dunlap scripts/kernel-doc: recognize __meminit [4] commit a4954fd7724c0f55361eb5 by Masahiro Yamada kbuild: remove obj-n and lib-n handling [5] commit 5b2389b45d1a9c12b9f by Masahiro Yamada kbuild: simplify build, clean, modbuiltin shorthands Signed-off-by: Horia Geanta horia.gea...@freescale.com Signed-off-by: Michal Marek mma...@suse.cz Signed-off-by: Randy Dunlap rdun...@infradead.org Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 3/6] kbuild: sync top Makefile with Linux 3.18-rc1
On Thu, Oct 30, 2014 at 11:06:11AM +0900, Masahiro Yamada wrote: Since Linux 3.15, relative path feature and related fixes, cleanups have been merged to the top Makefile. The relative path feature looks stable enough, so let's import it to U-Boot along with various cleanups. Commits imported from Linux (some need adjustment) are: [1] commit 7e1c04779efd by Michal Marek kbuild: Use relative path for $(objtree) [2] commit 890676c65d69 by Michal Marek kbuild: Use relative path when building in the source tree [3] commit 9da0763bdd82 by Michal Marek kbuild: Use relative path when building in a subdir of the source tree [4] commit c2e28dc975ea by Michal Marek kbuild: Print the name of the build directory [5] commit 066b7ed95580 by Michal Marek kbuild: Do not print the build directory with make -s [6] commit 3f1d9a6cec01 by Michal Marek kbuild: make -s should be used with kernelrelease/kernelversion/image_name [7] commit 7ff525712acf by Masahiro Yamada kbuild: fake the Entering directory ... message more simply [8] commit 745a254322c8 by Masahiro Yamada kbuild: use $(Q) for sub-make target [9] commit aa55c8e2f7a3 by Masahiro Yamada kbuild: handle C=... and M=... after entering into build directory [10] commit ab7474ea5361 by Borislav Petkov Kbuild: Ignore GREP_OPTIONS env variable To use relative path feature, tools/Makefile and scripts/Makefile.autoconf must be tweaked. Signed-off-by: Michal Marek mma...@suse.cz Signed-off-by: Borislav Petkov b...@suse.de Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] MAINTAINERS: CFI flash maintainership only includes the CFI related files
On Fri, Oct 31, 2014 at 01:57:42PM +0100, Stefan Roese wrote: All the other files in drivers/mtd/* are not really CFI related. So lets only include the files that are CFI specific. Signed-off-by: Stefan Roese s...@denx.de Cc: Heiko Schocher h...@denx.de Cc: Scott Wood scottw...@freescale.com Cc: Masahiro Yamada yamad...@jp.panasonic.com Cc: Jagan Teki jagannadh.t...@gmail.com Acked-by: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com Acked-by: Heiko Schocher h...@denx.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,1/9] cppcheck cleanup: fix nullPointer errors
On Thu, Nov 06, 2014 at 02:02:57PM +0100, Wolfgang Denk wrote: There are a number of places where U-Boot intentionally and legally accesses physical address 0x, for example when installing exception vectors on systems where these are located in low memory. Add cppcheck-suppress nullPointer comments to silence cppcheck where this is intentional and legal. Signed-off-by: Wolfgang Denk w...@denx.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,4/9] drivers/net/uli526x.c: fix syntax error
On Thu, Nov 06, 2014 at 02:03:00PM +0100, Wolfgang Denk wrote: Fix error detected by cppcheck: [drivers/net/uli526x.c:551]: (error) printf format string requires 3 parameters but only 2 are given. Signed-off-by: Wolfgang Denk w...@denx.de Cc: Roy Zang tie-fei.z...@freescale.com Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 9/9] board/esd/common/auto_update.c: fix Uninitialized variable
On Thu, Nov 06, 2014 at 02:03:05PM +0100, Wolfgang Denk wrote: cppcheck reports: [board/esd/common/auto_update.c:458]: (error) Uninitialized variable: cnt The variable is not really used anywhere, so remove it. Signed-off-by: Wolfgang Denk w...@denx.de Cc: Matthias Fuchs matthias.fu...@esd-electronics.com Acked-by: Matthias Fuchs matthias.fu...@esd.eu Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,2/9] board/cogent/lcd.c: fix syntax error
On Thu, Nov 06, 2014 at 02:02:58PM +0100, Wolfgang Denk wrote: Fix error detected by cppcheck: [board/cogent/lcd.c:237]: (error) Invalid number of character (() when these macros are defined: 'CONFIG_SHOW_ACTIVITY;CONFIG_STATUS_LED'. Signed-off-by: Wolfgang Denk w...@denx.de Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot