Re: [U-Boot] [PATCHv2 3/4] env_nand.c: clarify log messages when env reading fails
Scott, On Fri, Feb 22, 2013 at 07:59:41PM -0600, Scott Wood wrote: > On Thu, Feb 21, 2013 at 06:21:55PM +0100, Phil Sutter wrote: > > The single message is misleading, since there is no equivalent success > > note when reading the other copy succeeds. Instead, warn if one of the > > redundant copies could not be loaded and emphasise on the error when > > reading both fails. > > > > Signed-off-by: Phil Sutter > > --- > > common/env_nand.c | 12 > > 1 files changed, 8 insertions(+), 4 deletions(-) > > Applied to u-boot-nand-flash. > > > - if (readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *) tmp_env2)) > > - puts("No Valid Redundant Environment Area found\n"); > > + if (read1_fail && read2_fail) > > + puts("*** Error - No Valid Environment Area found\n"); > > + else if (read1_fail || read2_fail) > > + puts("*** Warning - some problems detected " > > +"reading environment; recovered successfully\n"); > > > > crc1_ok = crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc; > > crc2_ok = crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc; > > We should also give a message if one of the CRCs is bad, though that's > an existing problem. Yes, that would be nice. While writing this, I also had the idea of introducing some macros for unified message output, like so: | #define __print(level, ...) { | printf("*** %s - ", level); | printf(__VA_ARGS__); | printf("\n"); | } | #define perror(...) __print("Error", __VA_ARGS__) | #define pwarn(...) __print("Warning", __VA_ARGS__) | ... What do you think? That would require diligently touching a lot of source files, of course. Best wishes, Phil Sutter Software Engineer -- Viprinet - Never be offline again! Viprinet auf der CeBIT 2013 - 5.-9. März: Besuchen Sie uns in Halle 13, Stand D27! Alle gezeigten Produkte im Livebetrieb, zahlreiche Beispielapplikationen. Gerne schicken wir Ihnen kostenlose Eintrittskarten. http://www.viprinet.com/de/cebit-2013 Viprinet at CeBIT 2013, March 5 to 9 in Hannover, Germany. Come and visit us at Hall 13, Booth D27! All exhibits shown live, many sample applications. We’ll be happy to send you free admission tickets. http://www.viprinet.com/en/cebit-2013 Viprinet Europe GmbH Mainzer Str. 43 55411 Bingen am Rhein Germany Phone/Zentrale: +49 6721 49030-0 Direct line/Durchwahl:+49 6721 49030-134 Fax: +49 6721 49030-109 phil.sut...@viprinet.com http://www.viprinet.com Registered office/Sitz der Gesellschaft: Bingen am Rhein, Germany Commercial register/Handelsregister: Amtsgericht Mainz HRB44090 CEO/Geschäftsführer: Simon Kissel ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] powerpc/b4: Fix the wrong register offset of B4 PCIE module
B4420/B4860 PCIE can not work because of the wrong definition of the PCIE register offset in the file: arch/powerpc/include/asm/immap_85xx.h Add the judgement of B4420/B4860 to make the register offset to: #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0x20 Signed-off-by: Liu Gang --- arch/powerpc/include/asm/immap_85xx.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/include/asm/immap_85xx.h b/arch/powerpc/include/asm/immap_85xx.h index 4eb3f79..1c8d1ac 100644 --- a/arch/powerpc/include/asm/immap_85xx.h +++ b/arch/powerpc/include/asm/immap_85xx.h @@ -2914,7 +2914,8 @@ struct ccsr_pman { #define CONFIG_SYS_MPC85xx_IFC_OFFSET 0x124000 #define CONFIG_SYS_MPC85xx_GPIO_OFFSET 0x13 #define CONFIG_SYS_FSL_CORENET_RMAN_OFFSET 0x1e -#ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 +#if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && !defined(CONFIG_PPC_B4860)\ + && !defined(CONFIG_PPC_B4420) #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET0x24 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET0x25 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET0x26 -- 1.7.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2 V2] EXYNOS5: Snow: Add a configuration file
Hi Minkyu Kang, Thank you for comments. On Mon, Feb 25, 2013 at 9:49 AM, Minkyu Kang wrote: > > Dear Rajeshwari, > > On 21/02/13 15:43, Rajeshwari Shinde wrote: > > This patch adds the configuration file for Snow Board and > > defines the same in boards.cfg. > > > > Signed-off-by: Rajeshwari Shinde > > --- > > Changes in V2: > > - Added Maintainer > > MAINTAINERS|4 > > boards.cfg |1 + > > include/configs/snow.h | 33 + > > 3 files changed, 38 insertions(+), 0 deletions(-) > > create mode 100644 include/configs/snow.h > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 45e2dd4..5fc5b4d 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -736,6 +736,10 @@ Chander Kashyap > > SMDKV310ARM ARMV7 (EXYNOS4210 SoC) > > SMDK5250ARM ARMV7 (EXYNOS5250 SoC) > > > > +Rajeshwari Shinde > > Please keep this list to alphabetically. > your name should be moved to "S" section. I am sorry but I did not find any alphabetical order in MAINTAINERS, had placed it there because all exynos based board are mentioned there. > > > + > > + snowARM ARMV7 (EXYNOS5250 SoC) > > + > > Lukasz Majewski > > > > trats ARM ARMV7 (EXYNOS4210 SoC) > > diff --git a/boards.cfg b/boards.cfg > > index b1319aa..54357eb 100644 > > --- a/boards.cfg > > +++ b/boards.cfg > > @@ -286,6 +286,7 @@ s5p_goni arm armv7 > > gonisamsung > > smdkc100 arm armv7 smdkc100 > > samsungs5pc1xx > > origenarm armv7 origen > >samsungexynos > > s5pc210_universalarm armv7 universal_c210 > > samsungexynos > > +snow arm armv7 smdk5250 > > samsungexynos > > smdk5250 arm armv7 smdk5250 > > samsungexynos > > smdkv310 arm armv7 smdkv310 > > samsungexynos > > tratsarm armv7 trats > > samsungexynos > > diff --git a/include/configs/snow.h b/include/configs/snow.h > > new file mode 100644 > > index 000..b8460fd > > --- /dev/null > > +++ b/include/configs/snow.h > > @@ -0,0 +1,33 @@ > > +/* > > + * Copyright (C) 2013 Samsung Electronics > > + * > > + * Configuration settings for the SAMSUNG EXYNOS5 Snow board. > > + * > > + * See file CREDITS for list of people who contributed to this > > + * project. > > + * > > + * This program is free software; you can redistribute it and/or > > + * modify it under the terms of the GNU General Public License as > > + * published by the Free Software Foundation; either version 2 of > > + * the License, or (at your option) any later version. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with this program; if not, write to the Free Software > > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > > + * MA 02111-1307 USA > > + */ > > + > > +#ifndef __CONFIG_SNOW_H > > +#define __CONFIG_SNOW_H > > + > > +#include > > + > > +#undef CONFIG_DEFAULT_DEVICE_TREE > > +#define CONFIG_DEFAULT_DEVICE_TREE exynos5250-snow > > + > > +#endif /* __CONFIG_SNOW_H */ > > > > Thanks, > Minkyu Kang. > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot -- Regards, Rajeshwari Shinde ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2 V2] EXYNOS5: Snow: Add a configuration file
On 25/02/13 19:35, Rajeshwari Birje wrote: > Hi Minkyu Kang, > > Thank you for comments. > > On Mon, Feb 25, 2013 at 9:49 AM, Minkyu Kang wrote: >> >> Dear Rajeshwari, >> >> On 21/02/13 15:43, Rajeshwari Shinde wrote: >>> This patch adds the configuration file for Snow Board and >>> defines the same in boards.cfg. >>> >>> Signed-off-by: Rajeshwari Shinde >>> --- >>> Changes in V2: >>> - Added Maintainer >>> MAINTAINERS|4 >>> boards.cfg |1 + >>> include/configs/snow.h | 33 + >>> 3 files changed, 38 insertions(+), 0 deletions(-) >>> create mode 100644 include/configs/snow.h >>> >>> diff --git a/MAINTAINERS b/MAINTAINERS >>> index 45e2dd4..5fc5b4d 100644 >>> --- a/MAINTAINERS >>> +++ b/MAINTAINERS >>> @@ -736,6 +736,10 @@ Chander Kashyap >>> SMDKV310ARM ARMV7 (EXYNOS4210 SoC) >>> SMDK5250ARM ARMV7 (EXYNOS5250 SoC) >>> >>> +Rajeshwari Shinde >> >> Please keep this list to alphabetically. >> your name should be moved to "S" section. > I am sorry but I did not find any alphabetical order in MAINTAINERS, > had placed it there because all exynos based board are mentioned > there. >> sorted by last name. (Kang -> Kashyap -> Koschorrek...) Lukasz's position is wrong also. "Rajeshwari Shinde" should be positioned next to "Bo Shen". Thanks. Minkyu Kang. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/8 v11] Add TMU support for Exynos5250 based SMDK5250
This patch series adds support for TMU driver using device tree for Exynos5250 based SMDK5250 board. Changes since v10: - Patch-1: Renamed asm/arch/exynos-tmu.h to asm/arch/tmu.h. - Patch-2: None. - Patch-3: None. - Patch-4: None. - Patch-5: None. - Patch-6: None. - Patch-7: None. - Patch-8: None. Akshay Saraswat (8): Exynos5: TMU: Add driver for Thermal Management Unit Exynos5: FDT: Add TMU device node values Exynos5: TMU: Add TMU init and status check Exynos5: Config: Enable support for Exynos TMU driver TMU: Add TMU support in dtt command Exynos5: Config: Enable dtt command for TMU Exynos5: TMU: Add hardware tripping Exynos5: FDT: Add a H/W-trip member to TMU node arch/arm/cpu/armv7/exynos/power.c | 12 ++ arch/arm/dts/exynos5250.dtsi | 5 + arch/arm/include/asm/arch-exynos/power.h | 4 + arch/arm/include/asm/arch-exynos/tmu.h| 58 ++ board/samsung/dts/exynos5250-smdk5250.dts | 13 ++ board/samsung/smdk5250/smdk5250.c | 39 common/cmd_dtt.c | 32 ++- doc/device-tree-bindings/exynos/tmu.txt | 44 + drivers/power/Makefile| 1 + drivers/power/exynos-tmu.c| 319 ++ include/configs/exynos5250-dt.h | 5 + include/fdtdec.h | 1 + include/tmu.h | 46 + lib/fdtdec.c | 1 + 14 files changed, 579 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/arch-exynos/tmu.h create mode 100644 doc/device-tree-bindings/exynos/tmu.txt create mode 100644 drivers/power/exynos-tmu.c create mode 100644 include/tmu.h -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/8 v11] Exynos5: TMU: Add driver for Thermal Management Unit
Adding Exynos Thermal Management Unit driver to monitor SOC temperature and take actions corresponding to states of TMU. Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - Renamed as/asch/exynos-tmu.h to asm/arch/tmu.h. arch/arm/include/asm/arch-exynos/tmu.h | 58 +++ drivers/power/Makefile | 1 + drivers/power/exynos-tmu.c | 304 + include/tmu.h | 46 + 4 files changed, 409 insertions(+) create mode 100644 arch/arm/include/asm/arch-exynos/tmu.h create mode 100644 drivers/power/exynos-tmu.c create mode 100644 include/tmu.h diff --git a/arch/arm/include/asm/arch-exynos/tmu.h b/arch/arm/include/asm/arch-exynos/tmu.h new file mode 100644 index 000..31399b0 --- /dev/null +++ b/arch/arm/include/asm/arch-exynos/tmu.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * Akshay Saraswat + * + * EXYNOS - Thermal Management Unit + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_ARCH_TMU_H +#define __ASM_ARCH_TMU_H + +struct exynos5_tmu_reg { + unsigned triminfo; + unsigned rsvd1; + unsigned rsvd2; + unsigned rsvd3; + unsigned rsvd4; + unsigned triminfo_control; + unsigned rsvd5; + unsigned rsvd6; + unsigned tmu_control; + unsigned rsvd7; + unsigned tmu_status; + unsigned sampling_internal; + unsigned counter_value0; + unsigned counter_value1; + unsigned rsvd8; + unsigned rsvd9; + unsigned current_temp; + unsigned rsvd10; + unsigned rsvd11; + unsigned rsvd12; + unsigned threshold_temp_rise; + unsigned threshold_temp_fall; + unsigned rsvd13; + unsigned rsvd14; + unsigned past_temp3_0; + unsigned past_temp7_4; + unsigned past_temp11_8; + unsigned past_temp15_12; + unsigned inten; + unsigned intstat; + unsigned intclear; + unsigned rsvd15; + unsigned emul_con; +}; +#endif /* __ASM_ARCH_TMU_H */ diff --git a/drivers/power/Makefile b/drivers/power/Makefile index 8c71901..1dac16a 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk LIB:= $(obj)libpower.o +COBJS-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o COBJS-$(CONFIG_FTPMU010_POWER) += ftpmu010.o COBJS-$(CONFIG_TPS6586X_POWER) += tps6586x.o COBJS-$(CONFIG_TWL4030_POWER) += twl4030.o diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c new file mode 100644 index 000..cc5ffee --- /dev/null +++ b/drivers/power/exynos-tmu.c @@ -0,0 +1,304 @@ +/* + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * Akshay Saraswat + * + * EXYNOS - Thermal Management Unit + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include + +#define TRIMINFO_RELOAD1 +#define CORE_EN1 + +#define INTEN_RISE01 +#define INTEN_RISE1(1 << 4) +#define INTEN_RISE2(1 << 8) +#define INTEN_FALL0(1 << 16) +#define INTEN_FALL1(1 << 20) +#define INTEN_FALL2(1 << 24) + +#define TRIM_INFO_MASK 0xff + +#define INTCLEAR_RISE0 1 +#define INTCLEAR_RISE1 (1 << 4) +#define INTCLEAR_RISE2 (1 << 8) +#define INTCLEAR_FALL0 (1 << 16) +#define INTCLEAR_FALL1 (1 << 20) +#define INTCLEAR_FALL2 (1 << 24) +#define INTCLEARALL(INTCLEAR_RISE0 | INTCLEAR_RISE1 | \ +INTCLEAR_RISE2 | INTCLEAR_FALL0 | \ +INTCLEAR_FALL1 | INTCLEAR_FALL2) + +/* Tmeperature threshold values for various thermal events */ +struct temperature_params { + /* minimum value in temperature code range */ + unsigned int min_val; + /* maximum value in temperature code range */ + unsigned int max_val; + /* temperature threshold to start warning */ +
[U-Boot] [PATCH 2/8 v11] Exynos5: FDT: Add TMU device node values
Fdt entry for Exynos TMU driver specific pre-defined values used for calibration of current temperature and defining threshold values. Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. arch/arm/dts/exynos5250.dtsi | 5 board/samsung/dts/exynos5250-smdk5250.dts | 12 + doc/device-tree-bindings/exynos/tmu.txt | 41 +++ include/fdtdec.h | 1 + lib/fdtdec.c | 1 + 5 files changed, 60 insertions(+) create mode 100644 doc/device-tree-bindings/exynos/tmu.txt diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi index ed8c8dd..61d35a8 100644 --- a/arch/arm/dts/exynos5250.dtsi +++ b/arch/arm/dts/exynos5250.dtsi @@ -151,4 +151,9 @@ }; }; + tmu@1006 { + compatible = "samsung,exynos-tmu"; + reg = <0x1006 0x1>; + }; + }; diff --git a/board/samsung/dts/exynos5250-smdk5250.dts b/board/samsung/dts/exynos5250-smdk5250.dts index cbfab6f..00dac40 100644 --- a/board/samsung/dts/exynos5250-smdk5250.dts +++ b/board/samsung/dts/exynos5250-smdk5250.dts @@ -66,4 +66,16 @@ compatible = "maxim,max77686_pmic"; }; }; + + tmu@1006 { + samsung,min-temp= <25>; + samsung,max-temp= <125>; + samsung,start-warning = <95>; + samsung,start-tripping = <105>; + samsung,efuse-min-value = <40>; + samsung,efuse-value = <55>; + samsung,efuse-max-value = <100>; + samsung,slope = <274761730>; + samsung,dc-value= <25>; + }; }; diff --git a/doc/device-tree-bindings/exynos/tmu.txt b/doc/device-tree-bindings/exynos/tmu.txt new file mode 100644 index 000..bb734dc --- /dev/null +++ b/doc/device-tree-bindings/exynos/tmu.txt @@ -0,0 +1,41 @@ +Exynos Thermal management Unit + +Required properties: + + - compatible : Should be "samsung,exynos-tmu" for TMU + - samsung,min-temp : Minimum temperature value (25 degree celsius) + - Current temperature of SoC should be more than this value. + - samsung,max-temp : Maximum temperature value (125 degree celsius) + - Current temperature of SoC should be less than this value. + - samsung,start-warning : Temperature at which TMU starts giving warning (degree celsius) + - samsung,start-tripping : Temperature at which system will trip and shutdown (degree celsius) + - samsung,efuse-min-value : SOC efuse min value (Constant 40) + - efuse-value should be more than this value. + - samsung,efuse-value : SOC actual efuse value (Literal value) + - This is the data trimming info. + - This value is used to calculate measuring error. + - samsung,efuse-max-value : SoC max efuse value (Constant 100) + - efuse-value should be less than this value. + - samsung,slope : Default value 274761730 (Constant 0x1060_8802). + - This is the default value for TMU_CONTROL register. + - It sets the gain of amplifier to the positive-tc generator block. + - It selects thermal tripping mode and enables thermal tripping. + - samsung,dc-value : Measured data calibration value (Constant 25) + - Used for tempearture calculation. + - This is 25 because temperature measured is always above 25 degrees. + + +Example: + +tmu@1006 { + compatible = "samsung,exynos-tmu" + samsung,min-temp = <25>; + samsung,max-temp = <125>; + samsung,start-warning = <95>; + samsung,start-tripping = <105>; + samsung,efuse-min-value = <40>; + samsung,efuse-value = <55>; + samsung,efuse-max-value = <100>; + samsung,slope = <274761730>; + samsung,dc-value = <25>; +}; diff --git a/include/fdtdec.h b/include/fdtdec.h index 77f244f..b9301c8 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -81,6 +81,7 @@ enum fdt_compat_id { COMPAT_SAMSUNG_EXYNOS_EHCI, /* Exynos EHCI controller */ COMPAT_SAMSUNG_EXYNOS_USB_PHY, /* Exynos phy controller for usb2.0 */ COMPAT_MAXIM_MAX77686_PMIC, /* MAX77686 PMIC */ + COMPAT_SAMSUNG_EXYNOS_TMU, /* Exynos TMU */ COMPAT_COUNT, }; diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 3ae348d..5c427ff 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -56,6 +56,7 @@ static const char * const compat_names[COMPAT_COUNT] = { COMPAT(SAMSUNG_EXYNOS_EHCI, "samsung,exynos-ehci"), COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"), COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"), + COMPAT(SAMSUNG_EXYNOS_TMU, "samsung,exynos-tmu"), }; const char *fdtdec_get_compatible(enum fdt_compat_id id) -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/8 v11] Exynos5: TMU: Add TMU init and status check
This adds call to tmu_init() and TMU boot time analysis for the SoC temperature threshold breach. Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. board/samsung/smdk5250/smdk5250.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c index ffc5ee5..89247d9 100644 --- a/board/samsung/smdk5250/smdk5250.c +++ b/board/samsung/smdk5250/smdk5250.c @@ -37,9 +37,39 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; +#if defined CONFIG_EXYNOS_TMU +/* + * Boot Time Thermal Analysis for SoC temperature threshold breach + */ +static void boot_temp_check(void) +{ + int temp; + + switch (tmu_monitor(&temp)) { + /* Status TRIPPED ans WARNING means corresponding threshold breach */ + case TMU_STATUS_TRIPPED: + puts("EXYNOS_TMU: TRIPPING! Device power going down ...\n"); + set_ps_hold_ctrl(); + hang(); + break; + case TMU_STATUS_WARNING: + puts("EXYNOS_TMU: WARNING! Temperature very high\n"); + break; + /* +* TMU_STATUS_INIT means something is wrong with temperature sensing +* and TMU status was changed back from NORMAL to INIT. +*/ + case TMU_STATUS_INIT: + default: + debug("EXYNOS_TMU: Unknown TMU state\n"); + } +} +#endif + #ifdef CONFIG_USB_EHCI_EXYNOS int board_usb_vbus_init(void) { @@ -59,6 +89,15 @@ int board_usb_vbus_init(void) int board_init(void) { gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL); + +#if defined CONFIG_EXYNOS_TMU + if (tmu_init(gd->fdt_blob) != TMU_STATUS_NORMAL) { + debug("%s: Failed to init TMU\n", __func__); + return -1; + } + boot_temp_check(); +#endif + #ifdef CONFIG_EXYNOS_SPI spi_init(); #endif -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/8 v11] TMU: Add TMU support in dtt command
Add generic TMU support alongwith i2c sensors in dtt command to enable temperature reading in cases where TMU is present along-with/instead-of i2c sensors. Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. common/cmd_dtt.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c index cd94423..edbd4a8 100644 --- a/common/cmd_dtt.c +++ b/common/cmd_dtt.c @@ -27,7 +27,9 @@ #include #include +#include +#if defined CONFIG_DTT_SENSORS static unsigned long sensor_initialized; static void _initialize_dtt(void) @@ -59,9 +61,11 @@ void dtt_init(void) /* switch back to original I2C bus */ I2C_SET_BUS(old_bus); } +#endif -int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) +int dtt_i2c(void) { +#if defined CONFIG_DTT_SENSORS int i; unsigned char sensors[] = CONFIG_DTT_SENSORS; int old_bus; @@ -83,8 +87,34 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) /* switch back to original I2C bus */ I2C_SET_BUS(old_bus); +#endif return 0; +} + +int dtt_tmu(void) +{ +#if defined CONFIG_TMU_CMD_DTT + int cur_temp; + + /* Sense and return latest thermal info */ + if (tmu_monitor(&cur_temp) == TMU_STATUS_INIT) { + puts("TMU is in unknown state, temperature is invalid\n"); + return -1; + } + printf("Current temperature: %u degrees Celsius\n", cur_temp); +#endif + return 0; +} + +int do_dtt(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +{ + int err = 0; + + err |= dtt_i2c(); + err |= dtt_tmu(); + + return err; } /* do_dtt() */ /***/ -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/8 v11] Exynos5: Config: Enable dtt command for TMU
This enables the dtt command to read the current SOC temperature with the help of TMU Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. include/configs/exynos5250-dt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h index 53ca41f..8a8e9fe 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -119,6 +119,8 @@ /* Thermal Management Unit */ #define CONFIG_EXYNOS_TMU +#define CONFIG_CMD_DTT +#define CONFIG_TMU_CMD_DTT /* USB */ #define CONFIG_CMD_USB -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/8 v11] Exynos5: Config: Enable support for Exynos TMU driver
Enables TMU driver support for exynos5250 Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. include/configs/exynos5250-dt.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h index cabd2f2..53ca41f 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -117,6 +117,9 @@ #define CONFIG_BOOTDELAY 3 #define CONFIG_ZERO_BOOTDELAY_CHECK +/* Thermal Management Unit */ +#define CONFIG_EXYNOS_TMU + /* USB */ #define CONFIG_CMD_USB #define CONFIG_USB_EHCI -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 7/8 v11] Exynos5: TMU: Add hardware tripping
This adds hardware tripping at 110 degrees celsius which must enable forced system shutdown in case TMU fails to power off. Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. arch/arm/cpu/armv7/exynos/power.c| 12 arch/arm/include/asm/arch-exynos/power.h | 4 drivers/power/exynos-tmu.c | 25 - 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/power.c b/arch/arm/cpu/armv7/exynos/power.c index 400c8bc..363c20a 100644 --- a/arch/arm/cpu/armv7/exynos/power.c +++ b/arch/arm/cpu/armv7/exynos/power.c @@ -111,3 +111,15 @@ void set_ps_hold_ctrl(void) if (cpu_is_exynos5()) exynos5_set_ps_hold_ctrl(); } + +/* Enables hardware tripping to power off the system when TMU fails */ +void set_hw_thermal_trip(void) +{ + if (cpu_is_exynos5()) { + struct exynos5_power *power = + (struct exynos5_power *)samsung_get_base_power(); + + /* PS_HOLD_CONTROL register ENABLE_HW_TRIP bit*/ + setbits_le32(&power->ps_hold_control, POWER_ENABLE_HW_TRIP); + } +} diff --git a/arch/arm/include/asm/arch-exynos/power.h b/arch/arm/include/asm/arch-exynos/power.h index f2f73fa..e409b24 100644 --- a/arch/arm/include/asm/arch-exynos/power.h +++ b/arch/arm/include/asm/arch-exynos/power.h @@ -857,6 +857,9 @@ void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int enable); void set_usbhost_phy_ctrl(unsigned int enable); +/* Enables hardware tripping to power off the system when TMU fails */ +void set_hw_thermal_trip(void); + #define POWER_USB_HOST_PHY_CTRL_EN (1 << 0) #define POWER_USB_HOST_PHY_CTRL_DISABLE(0 << 0) @@ -865,6 +868,7 @@ void set_dp_phy_ctrl(unsigned int enable); #define EXYNOS_DP_PHY_ENABLE (1 << 0) #define EXYNOS_PS_HOLD_CONTROL_DATA_HIGH (1 << 8) +#define POWER_ENABLE_HW_TRIP (1UL << 31) /* * Set ps_hold data driving value high diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c index cc5ffee..f4fa9e1 100644 --- a/drivers/power/exynos-tmu.c +++ b/drivers/power/exynos-tmu.c @@ -22,9 +22,11 @@ #include #include #include +#include #define TRIMINFO_RELOAD1 #define CORE_EN1 +#define THERM_TRIP_EN (1 << 12) #define INTEN_RISE01 #define INTEN_RISE1(1 << 4) @@ -55,6 +57,8 @@ struct temperature_params { unsigned int start_warning; /* temperature threshold CPU tripping */ unsigned int start_tripping; + /* temperature threshold for HW tripping */ + unsigned int hardware_tripping; }; /* Pre-defined values and thresholds for calibration of current temperature */ @@ -196,6 +200,9 @@ static int get_tmu_fdt_values(struct tmu_info *info, const void *blob) info->data.ts.start_tripping = fdtdec_get_int(blob, node, "samsung,start-tripping", -1); error |= info->data.ts.start_tripping; + info->data.ts.hardware_tripping = fdtdec_get_int(blob, + node, "samsung,hw-tripping", -1); + error |= info->data.ts.hardware_tripping; info->data.efuse_min_value = fdtdec_get_int(blob, node, "samsung,efuse-min-value", -1); error |= info->data.efuse_min_value; @@ -230,7 +237,7 @@ static int get_tmu_fdt_values(struct tmu_info *info, const void *blob) static void tmu_setup_parameters(struct tmu_info *info) { unsigned int te_code, con; - unsigned int warning_code, trip_code; + unsigned int warning_code, trip_code, hwtrip_code; unsigned int cooling_temp; unsigned int rising_value; struct tmu_data *data = &info->data; @@ -254,9 +261,14 @@ static void tmu_setup_parameters(struct tmu_info *info) + info->te1 - info->dc_value; trip_code = data->ts.start_tripping + info->te1 - info->dc_value; + hwtrip_code = data->ts.hardware_tripping + + info->te1 - info->dc_value; + cooling_temp = 0; - rising_value = ((warning_code << 8) | (trip_code << 16)); + rising_value = ((warning_code << 8) | + (trip_code << 16) | + (hwtrip_code << 24)); /* Set interrupt level */ writel(rising_value, ®->threshold_temp_rise); @@ -276,12 +288,15 @@ static void tmu_setup_parameters(struct tmu_info *info) /* TMU core enable */ con = readl(®->tmu_control); - con |= CORE_EN; + con |= THERM_TRIP_EN | CORE_EN; writel(con, ®->tmu_control); - /* LEV0 LEV1 LEV2 interrupt enable */ - writel(INTEN_RISE0 | INTEN_RISE1 | INTEN_RISE2, ®->inten); + /* Enable HW thermal trip */ + set_hw_thermal_trip(); + + /* LEV1 LEV2 interrupt enabl
[U-Boot] [PATCH 8/8 v11] Exynos5: FDT: Add a H/W-trip member to TMU node
This adds a member to TMU FDT node for providing hardware tripping temperature threshold. Signed-off-by: Akshay Saraswat Acked-by: Simon Glass --- Changes since v10: - None. board/samsung/dts/exynos5250-smdk5250.dts | 1 + doc/device-tree-bindings/exynos/tmu.txt | 5 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/board/samsung/dts/exynos5250-smdk5250.dts b/board/samsung/dts/exynos5250-smdk5250.dts index 00dac40..1c2d52d 100644 --- a/board/samsung/dts/exynos5250-smdk5250.dts +++ b/board/samsung/dts/exynos5250-smdk5250.dts @@ -72,6 +72,7 @@ samsung,max-temp= <125>; samsung,start-warning = <95>; samsung,start-tripping = <105>; + samsung,hw-tripping = <110>; samsung,efuse-min-value = <40>; samsung,efuse-value = <55>; samsung,efuse-max-value = <100>; diff --git a/doc/device-tree-bindings/exynos/tmu.txt b/doc/device-tree-bindings/exynos/tmu.txt index bb734dc..89d3bf0 100644 --- a/doc/device-tree-bindings/exynos/tmu.txt +++ b/doc/device-tree-bindings/exynos/tmu.txt @@ -8,7 +8,9 @@ Required properties: - samsung,max-temp : Maximum temperature value (125 degree celsius) - Current temperature of SoC should be less than this value. - samsung,start-warning : Temperature at which TMU starts giving warning (degree celsius) - - samsung,start-tripping : Temperature at which system will trip and shutdown (degree celsius) + - samsung,start-tripping : Temperature at which TMU shuts down the system (degree celsius) + - samsung,hw-tripping : Temperature at which hardware tripping should happen + in case TMU fails to power off (degree celsius) - samsung,efuse-min-value : SOC efuse min value (Constant 40) - efuse-value should be more than this value. - samsung,efuse-value : SOC actual efuse value (Literal value) @@ -33,6 +35,7 @@ tmu@1006 { samsung,max-temp = <125>; samsung,start-warning = <95>; samsung,start-tripping = <105>; + samsung,hw-tripping = <110>; samsung,efuse-min-value = <40>; samsung,efuse-value = <55>; samsung,efuse-max-value = <100>; -- 1.8.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2 V3] EXYNOS5: Add initial DTS file for Snow.
This patch adds the DTS file for Snow Board. Signed-off-by: Rajeshwari Shinde Acked-by: Simon Glass --- Changes in V2: - None Changes in V3: - None board/samsung/dts/exynos5250-snow.dts | 69 + 1 files changed, 69 insertions(+), 0 deletions(-) create mode 100644 board/samsung/dts/exynos5250-snow.dts diff --git a/board/samsung/dts/exynos5250-snow.dts b/board/samsung/dts/exynos5250-snow.dts new file mode 100644 index 000..360d3bd --- /dev/null +++ b/board/samsung/dts/exynos5250-snow.dts @@ -0,0 +1,69 @@ +/* + * SAMSUNG Snow board device tree source + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +/dts-v1/; +/include/ ARCH_CPU_DTS + +/ { + model = "Google Snow"; + compatible = "google,snow", "samsung,exynos5250"; + + aliases { + i2c0 = "/i2c@12c6"; + i2c1 = "/i2c@12c7"; + i2c2 = "/i2c@12c8"; + i2c3 = "/i2c@12c9"; + i2c4 = "/i2c@12ca"; + i2c5 = "/i2c@12cb"; + i2c6 = "/i2c@12cc"; + i2c7 = "/i2c@12cd"; + spi0 = "/spi@12d2"; + spi1 = "/spi@12d3"; + spi2 = "/spi@12d4"; + spi3 = "/spi@131a"; + spi4 = "/spi@131b"; + }; + + sromc@1225 { + bank = <1>; + srom-timing = <1 9 12 1 6 1 1>; + width = <2>; + lan@500 { + compatible = "smsc,lan9215", "smsc,lan"; + reg = <0x500 0x100>; + phy-mode = "mii"; + }; + }; + + sound@12d6 { + samsung,i2s-epll-clock-frequency = <19200>; + samsung,i2s-sampling-rate = <48000>; + samsung,i2s-bits-per-sample = <16>; + samsung,i2s-channels = <2>; + samsung,i2s-lr-clk-framesize = <256>; + samsung,i2s-bit-clk-framesize = <32>; + samsung,codec-type = "max98095"; + }; + + i2c@12cd { + soundcodec@22 { + reg = <0x22>; + compatible = "maxim,max98095-codec"; + }; + }; + + i2c@12c6 { + pmic@9 { + reg = <0x9>; + compatible = "maxim,max77686_pmic"; + }; + }; +}; -- 1.7.4.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records
R_ARM_ABS32 relocation records cause symbol references to be zero before relocation, and become correct only after relocation. On the other hand, R_ARM_RELATIVE records make references correct before as well as after relocation. This patch series aims at removing all R_ARM_ABS32 relocations from ARM targets. the main contributor of R_ARM_ABS32 relocations is the support code for linker-lists, aka Linker-Generated Arrays. This is due to the fact that LGA start and end symbols, used for ranging these arrays, are linker- generated symbols, which always relocate as R_ARM_ABS32 even though they are supposed *not* to be absolute. V1 of this patch series fixed LGAs so that start or end symbols are actually compiler-generated, and thus their references are relocated using R_ARM_RELATIVE; V2 also fixes crt0 so that BSS start and end references do not produce R_ARM_ABS32 relocations either. With V2, none of the targets built with MAKEALL -a arm produces any R_ARM_ABS32 relocation. This series has been build-tested with ARM (295 targets clean) and powerpc (634 targets clean) Changes in v2: - fixed missing .sram memory mapping in OMAP lds - removed useless linker script sections in SPL lds files - made BSS start and end compiler-generated - moved SPL linker script changes to their own commit - added KEEP() to all linker files - removed spurious change to common/command.c - changed empty type from struct {} to char[0] - dropped patch to removed board/micronas/vct/u-boot.lds - removed all references to u-boot.lst Albert ARIBAUD (4): arm: omap: map u_boot_lists section to .sram Remove linker lists (LGAs) from SPL linker scripts arm: make __bss_start and __bss_end__ compiler-generated Refactor linker-generated arrays .gitignore |1 - Makefile | 13 +- arch/arm/cpu/arm920t/ep93xx/u-boot.lds |2 +- arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds|6 - arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds |6 - arch/arm/cpu/armv7/am33xx/u-boot-spl.lds | 67 ++ arch/arm/cpu/armv7/omap-common/u-boot-spl.lds|4 - arch/arm/cpu/ixp/u-boot.lds | 14 +- arch/arm/cpu/u-boot-spl.lds | 93 arch/arm/cpu/u-boot.lds | 14 +- arch/arm/lib/Makefile|1 + arch/arm/lib/bss.c | 39 arch/avr32/cpu/u-boot.lds|2 +- arch/blackfin/cpu/u-boot.lds |2 +- arch/microblaze/cpu/u-boot.lds |2 +- arch/mips/cpu/u-boot.lds |2 +- arch/nds32/cpu/n1213/u-boot.lds |2 +- arch/nios2/cpu/u-boot.lds|2 +- arch/powerpc/cpu/74xx_7xx/u-boot.lds |2 +- arch/powerpc/cpu/mpc512x/u-boot.lds |2 +- arch/powerpc/cpu/mpc5xx/u-boot.lds |2 +- arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds |2 +- arch/powerpc/cpu/mpc5xxx/u-boot.lds |2 +- arch/powerpc/cpu/mpc8220/u-boot.lds |2 +- arch/powerpc/cpu/mpc824x/u-boot.lds |2 +- arch/powerpc/cpu/mpc8260/u-boot.lds |2 +- arch/powerpc/cpu/mpc83xx/u-boot.lds |2 +- arch/powerpc/cpu/mpc85xx/u-boot-nand.lds |2 +- arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds |2 +- arch/powerpc/cpu/mpc85xx/u-boot.lds |2 +- arch/powerpc/cpu/mpc86xx/u-boot.lds |2 +- arch/powerpc/cpu/ppc4xx/u-boot.lds |2 +- arch/sandbox/cpu/u-boot.lds |2 +- arch/sh/cpu/sh2/u-boot.lds |2 +- arch/sh/cpu/sh3/u-boot.lds |2 +- arch/sh/cpu/sh4/u-boot.lds |2 +- arch/x86/cpu/u-boot.lds |2 +- board/BuS/eb_cpu5282/u-boot.lds |2 +- board/LEOX/elpt860/u-boot.lds|2 +- board/RPXClassic/u-boot.lds |2 +- board/RPXClassic/u-boot.lds.debug|2 +- board/RPXlite/u-boot.lds |2 +- board/RPXlite/u-boot.lds.debug |2 +- board/RPXlite_dw/u-boot.lds |2 +- board/RPXlite_dw/u-boot.lds.debug|2 +- board/RRvision/u-boot.lds|2 +- board/actux1/u-boot.lds | 24 ++- board/actux2/u-boot.lds | 24 ++- board/actux3/u-boot.lds | 18 +- board/adder/u-boot.lds |2 +- board/ait/cam_enc_4xx/u-boot-spl.lds |4 - board/altera/nios2-generic/u-boot.lds|2 +- board/amcc/acadia/u-boot-nand.lds|2 +- board/amcc/bamboo/u-boot-nand.lds|2 +- boa
[U-Boot] [PATCH 2/2 V3] EXYNOS5: Snow: Add a configuration file
This patch adds the configuration file for Snow Board and defines the same in boards.cfg. Signed-off-by: Rajeshwari Shinde --- Changes in V2: - Added Maintainer Changes in V3: - Added Maintainer in aphabetical order. MAINTAINERS|4 boards.cfg |1 + include/configs/snow.h | 33 + 3 files changed, 38 insertions(+), 0 deletions(-) create mode 100644 include/configs/snow.h diff --git a/MAINTAINERS b/MAINTAINERS index 45e2dd4..f6723ef 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -910,6 +910,10 @@ Matt Sealey Bo Shen at91sam9x5ekARM926EJS (AT91SAM9G15,G25,G35,X25,X35 SoC) +Rajeshwari Shinde + + snowARM ARMV7 (EXYNOS5250 SoC) + Michal Simek zynqARM ARMV7 (Zynq SoC) diff --git a/boards.cfg b/boards.cfg index b1319aa..54357eb 100644 --- a/boards.cfg +++ b/boards.cfg @@ -286,6 +286,7 @@ s5p_goni arm armv7 goni samsung smdkc100 arm armv7 smdkc100 samsungs5pc1xx origen arm armv7 origen samsungexynos s5pc210_universalarm armv7 universal_c210 samsungexynos +snowarm armv7 smdk5250 samsungexynos smdk5250arm armv7 smdk5250 samsungexynos smdkv310arm armv7 smdkv310 samsungexynos tratsarm armv7 trats samsungexynos diff --git a/include/configs/snow.h b/include/configs/snow.h new file mode 100644 index 000..b8460fd --- /dev/null +++ b/include/configs/snow.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 Samsung Electronics + * + * Configuration settings for the SAMSUNG EXYNOS5 Snow board. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __CONFIG_SNOW_H +#define __CONFIG_SNOW_H + +#include + +#undef CONFIG_DEFAULT_DEVICE_TREE +#define CONFIG_DEFAULT_DEVICE_TREE exynos5250-snow + +#endif /* __CONFIG_SNOW_H */ -- 1.7.4.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/2 V3] EXYNOS5: SNOW: Add initial dts and config file
This patch set adds initial dts and configuration file for snow. Changes in V2: - Added Maintainer. Changes in V3: - Added Maintainer in aphabetical order. Rajeshwari Shinde (2): EXYNOS5: Add initial DTS file for Snow. EXYNOS5: Snow: Add a configuration file MAINTAINERS |4 ++ board/samsung/dts/exynos5250-snow.dts | 69 + boards.cfg|1 + include/configs/snow.h| 33 4 files changed, 107 insertions(+), 0 deletions(-) create mode 100644 board/samsung/dts/exynos5250-snow.dts create mode 100644 include/configs/snow.h -- 1.7.4.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] arm: omap: map u_boot_lists section to .sram
Output section .u_boot_list was left unmapped in u-boot-spl.lds for omap-common, causing the location counter to roll back to bteween .rodata and .data, making __image_copy_end and _end symbols wrong. Mapping output section .u_boot_list to memory .sram fixes these symbols' mapping. This modifies the SPL binary but has no functional impact, as __image_copy_end and _end are never used in SPLs and u_boot_list is empty for all 29 boards affected (omap4_sdp4430 eco5pk igep0030 am335x_evm_uart3 omap3_beagle am3517_crane igep0032 mt_ventoux pcm051 am3517_evm omap3_evm_quick_mmc am335x_evm_uart2 am335x_evm_spiboot am335x_evm_uart1 omap3_evm igep0030_nand omap3_overo igep0020 am335x_evm omap4_panda omap5_evm am335x_evm_uart4 devkit8000 tricorder mcx twister omap3_evm_quick_nand am335x_evm_uart5 igep0020_nand). Signed-off-by: Albert ARIBAUD --- Changes in v2: - fixed missing .sram memory mapping in OMAP lds arch/arm/cpu/armv7/omap-common/u-boot-spl.lds |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds index 9979c30..6755628 100644 --- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds @@ -50,7 +50,7 @@ SECTIONS .u_boot_list : { #include - } + } > .sram . = ALIGN(4); __image_copy_end = .; -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/4] Remove linker lists (LGAs) from SPL linker scripts
Many SPL linker scripts needlessly include linker lists (aka LGAs). Remove them whenever possible; keep it only in the seven am335x_evm variants (am335x_evm, am335x_evm_uart[1-5], am335x_evm_spiboot), where there is actual content in output section .u_boot_list. This commit keeps all u-boot.bin and u-boot-spl.bin in ARM targets byte-identical. Signed-off-by: Albert ARIBAUD --- Changes in v2: - removed useless linker script sections in SPL lds files arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds |6 -- arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds|6 -- arch/arm/cpu/armv7/am33xx/u-boot-spl.lds | 67 + arch/arm/cpu/armv7/omap-common/u-boot-spl.lds |4 - arch/arm/cpu/u-boot-spl.lds| 93 board/ait/cam_enc_4xx/u-boot-spl.lds |4 - board/davinci/da8xxevm/u-boot-spl-da850evm.lds |5 -- board/davinci/da8xxevm/u-boot-spl-hawk.lds |5 -- board/vpac270/u-boot-spl.lds |4 - include/configs/am335x_evm.h |2 +- include/configs/pcm051.h |2 +- spl/Makefile |8 +- 12 files changed, 164 insertions(+), 42 deletions(-) create mode 100644 arch/arm/cpu/armv7/am33xx/u-boot-spl.lds create mode 100644 arch/arm/cpu/u-boot-spl.lds diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds index 6dc681a..0f3222c 100644 --- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds +++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds @@ -51,12 +51,6 @@ SECTIONS . = ALIGN(4); - .u_boot_list : { - #include - } - - . = ALIGN(4); - .rel.dyn : { __rel_dyn_start = .; *(.rel*) diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds index f3bd5e7..0af3e0a 100644 --- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds +++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds @@ -51,12 +51,6 @@ SECTIONS . = ALIGN(4); - .u_boot_list : { - #include - } - - . = ALIGN(4); - .rel.dyn : { __rel_dyn_start = .; *(.rel*) diff --git a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds new file mode 100644 index 000..1c3deef --- /dev/null +++ b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds @@ -0,0 +1,67 @@ +/* + * (C) Copyright 2002 + * Gary Jennejohn, DENX Software Engineering, + * + * (C) Copyright 2010 + * Texas Instruments, + * Aneesh V + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\ + LENGTH = CONFIG_SPL_MAX_SIZE } +MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \ + LENGTH = CONFIG_SPL_BSS_MAX_SIZE } + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + .text : + { + __start = .; + arch/arm/cpu/armv7/start.o (.text) + *(.text*) + } >.sram + + . = ALIGN(4); + .rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram + + . = ALIGN(4); + .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram + + .u_boot_list : { + #include + } >.sram + + . = ALIGN(4); + __image_copy_end = .; + _end = .; + + .bss : + { + . = ALIGN(4); + __bss_start = .; + *(.bss*) + . = ALIGN(4); + __bss_end__ = .; + } >.sdram +} diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds index 6755628..88f4069 100644 --- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds +++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds @@ -48,10 +48,6 @@ SECTIONS . = ALIGN(4); .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram - .u_boot_list : { - #include - } > .sram - . = ALIGN(4); __image_copy_end = .; _end = .; diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds new fi
[U-Boot] [PATCH v2 3/4] arm: make __bss_start and __bss_end__ compiler-generated
Turn __bss_start and __bss_end__ from linker-generated to compiler-generated symbols, causing relocations for these symbols to change type, from R_ARM_ABS32 to R_ARM_RELATIVE. This should have no functional impact, as it affects references to __bss_start and __bss_end__ only before relocation, and no such references are done. Signed-off-by: Albert ARIBAUD --- Changes in v2: - made BSS start and end compiler-generated arch/arm/cpu/ixp/u-boot.lds| 12 --- arch/arm/cpu/u-boot.lds| 12 --- arch/arm/lib/Makefile |1 + arch/arm/lib/bss.c | 39 board/actux1/u-boot.lds| 22 +--- board/actux2/u-boot.lds| 22 +--- board/actux3/u-boot.lds| 16 +++ board/dvlhost/u-boot.lds | 16 +++ board/freescale/mx31ads/u-boot.lds | 14 + 9 files changed, 122 insertions(+), 32 deletions(-) create mode 100644 arch/arm/lib/bss.c diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds index 81d954f..bba91d5 100644 --- a/arch/arm/cpu/ixp/u-boot.lds +++ b/arch/arm/cpu/ixp/u-boot.lds @@ -67,11 +67,17 @@ SECTIONS _end = .; - .bss __rel_dyn_start (OVERLAY) : { - __bss_start = .; + .bss_start __rel_dyn_start (OVERLAY) : { + KEEP(*(.__bss_start)); + } + + .bss __bss_start (OVERLAY) : { *(.bss*) . = ALIGN(4); - __bss_end__ = .; +___bssend___ = .; + } + .bss_end ___bssend___ (OVERLAY) : { + KEEP(*(.__bss_end__)); } /DISCARD/ : { *(.dynstr*) } diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds index e6b202b..e1bc8e7 100644 --- a/arch/arm/cpu/u-boot.lds +++ b/arch/arm/cpu/u-boot.lds @@ -81,11 +81,17 @@ SECTIONS *(.mmutable) } - .bss __rel_dyn_start (OVERLAY) : { - __bss_start = .; + .bss_start __rel_dyn_start (OVERLAY) : { + KEEP(*(.__bss_start)); + } + + .bss __bss_start (OVERLAY) : { *(.bss*) . = ALIGN(4); - __bss_end__ = .; +___bssend___ = .; + } + .bss_end ___bssend___ (OVERLAY) : { + KEEP(*(.__bss_end__)); } /DISCARD/ : { *(.dynstr*) } diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 57111af..11c2674 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -39,6 +39,7 @@ GLCOBJS += div0.o SOBJS-y += crt0.o ifndef CONFIG_SPL_BUILD +COBJS-y += bss.o COBJS-y+= board.o COBJS-y+= bootm.o COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o diff --git a/arch/arm/lib/bss.c b/arch/arm/lib/bss.c new file mode 100644 index 000..7c0b154 --- /dev/null +++ b/arch/arm/lib/bss.c @@ -0,0 +1,39 @@ +/* + * Copyright 2013 Albert ARIBAUD + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/** + * These two symbols are declared in a C file so that the linker + * uses R_ARM_RELATIVE relocation, rather than the R_ARM_ABS32 one + * it would use if the symbols were defined in the linker file. + * Using only R_ARM_RELATIVE relocation ensures that references to + * the symbols are correct after as well as before relocation. + * + * We need a 0-byte-size type for these symbols, and the compiler + * does not allow defining objects of C type 'void'. Using an empty + * struct is allowed by the compiler, but causes gcc versions 4.4 and + * below to complain about aliasing. Therefore we use the next best + * thing: zero-sized arrays, which are both 0-byte-size and exempt from + * aliasing warnings. + */ + +char __bss_start[0] __attribute__((used, section(".__bss_start"))); +char __bss_end__[0] __attribute__((used, section(".__bss_end__"))); diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds index c41eed0..572bcea 100644 --- a/board/actux1/u-boot.lds +++ b/board/actux1/u-boot.lds @@ -41,15 +41,15 @@ SECTIONS *(.text*) } - . = ALIGN (4); + . = ALIGN(4); .rodata : { *(SORT_BY_ALIGNMEN
[U-Boot] [PATCH] common/main: move set_working_fdt_addr to enable usage of $fdtaddr
When using $fdtaddr in $bootcmd and $bootcmd is automatically called, $fdtaddr is yet not defined. Signed-off-by: Barak Wasserstrom --- common/main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/main.c b/common/main.c index e2d2e09..77b9076 100644 --- a/common/main.c +++ b/common/main.c @@ -378,6 +378,10 @@ void main_loop (void) bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop"); +#if defined CONFIG_OF_CONTROL + set_working_fdt_addr((void *)gd->fdt_blob); +#endif /* CONFIG_OF_CONTROL */ + #ifdef CONFIG_BOOTCOUNT_LIMIT bootcount = bootcount_load(); bootcount++; @@ -500,10 +504,6 @@ void main_loop (void) #endif /* CONFIG_MENUKEY */ #endif /* CONFIG_BOOTDELAY */ -#if defined CONFIG_OF_CONTROL - set_working_fdt_addr((void *)gd->fdt_blob); -#endif /* CONFIG_OF_CONTROL */ - /* * Main Loop for Monitor Command Processing */ -- 1.7.11.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records
Dear Albert ARIBAUD, > R_ARM_ABS32 relocation records cause symbol references > to be zero before relocation, and become correct only > after relocation. On the other hand, R_ARM_RELATIVE > records make references correct before as well as > after relocation. > > This patch series aims at removing all R_ARM_ABS32 > relocations from ARM targets. > > the main contributor of R_ARM_ABS32 relocations is the > support code for linker-lists, aka Linker-Generated > Arrays. This is due to the fact that LGA start and end > symbols, used for ranging these arrays, are linker- > generated symbols, which always relocate as R_ARM_ABS32 > even though they are supposed *not* to be absolute. > > V1 of this patch series fixed LGAs so that start or > end symbols are actually compiler-generated, and thus > their references are relocated using R_ARM_RELATIVE; > V2 also fixes crt0 so that BSS start and end references > do not produce R_ARM_ABS32 relocations either. > > With V2, none of the targets built with MAKEALL -a arm > produces any R_ARM_ABS32 relocation. > > This series has been build-tested with ARM (295 targets > clean) and powerpc (634 targets clean) > > Changes in v2: > - fixed missing .sram memory mapping in OMAP lds > - removed useless linker script sections in SPL lds files > - made BSS start and end compiler-generated > - moved SPL linker script changes to their own commit > - added KEEP() to all linker files > - removed spurious change to common/command.c > - changed empty type from struct {} to char[0] > - dropped patch to removed board/micronas/vct/u-boot.lds > - removed all references to u-boot.lst > > Albert ARIBAUD (4): > arm: omap: map u_boot_lists section to .sram > Remove linker lists (LGAs) from SPL linker scripts > arm: make __bss_start and __bss_end__ compiler-generated > Refactor linker-generated arrays [...] Reviewed-by: Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] btrfs addition to uboot
Adnan Ali (1): Introduced btrfs file-system with btrload command Makefile |1 + common/Makefile|1 + common/cmd_btr.c | 53 +++ fs/btrfs/Makefile | 51 ++ fs/btrfs/btrfs.c | 1131 fs/fs.c| 86 +++- include/btrfs.h| 398 include/config_fallbacks.h |4 + include/crc32c.h | 48 ++ include/fs.h |1 + 10 files changed, 1769 insertions(+), 5 deletions(-) create mode 100644 common/cmd_btr.c create mode 100644 fs/btrfs/Makefile create mode 100644 fs/btrfs/btrfs.c create mode 100644 include/btrfs.h create mode 100644 include/crc32c.h -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support. This btrfs implementation is based on syslinux btrfs code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d. Signed-off-by: Adnan Ali --- Makefile |1 + common/Makefile|1 + common/cmd_btr.c | 53 +++ fs/btrfs/Makefile | 51 ++ fs/btrfs/btrfs.c | 1131 fs/fs.c| 86 +++- include/btrfs.h| 398 include/config_fallbacks.h |4 + include/crc32c.h | 48 ++ include/fs.h |1 + 10 files changed, 1769 insertions(+), 5 deletions(-) create mode 100644 common/cmd_btr.c create mode 100644 fs/btrfs/Makefile create mode 100644 fs/btrfs/btrfs.c create mode 100644 include/btrfs.h create mode 100644 include/crc32c.h diff --git a/Makefile b/Makefile index 3305e8c..cc35e7b 100644 --- a/Makefile +++ b/Makefile @@ -261,6 +261,7 @@ endif LIBS-$(CONFIG_OF_EMBED) += dts/libdts.o LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o LIBS-y += fs/libfs.o \ +fs/btrfs/libbtrfs.o \ fs/cbfs/libcbfs.o \ fs/cramfs/libcramfs.o \ fs/ext4/libext4fs.o \ diff --git a/common/Makefile b/common/Makefile index 54fcc81..093dd35 100644 --- a/common/Makefile +++ b/common/Makefile @@ -73,6 +73,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o +COBJS-$(CONFIG_CMD_BTR) += cmd_btr.o COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o diff --git a/common/cmd_btr.c b/common/cmd_btr.c new file mode 100644 index 000..faea625 --- /dev/null +++ b/common/cmd_btr.c @@ -0,0 +1,53 @@ +/* + * (C) Copyright 2013 Codethink Limited + * Btrfs port to Uboot by + * Adnan Ali + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * Boot support + */ +#include +#include + +char subvolname[MAX_SUBVOL_NAME]; + +int do_btr_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + if (argc > 5) + strcpy(subvolname, argv[5]); + else + strcpy(subvolname, ""); + + return do_load(cmdtp, flag, argc, argv, FS_TYPE_BTR, 16); +} + + +U_BOOT_CMD( + btrload,7, 0, do_btr_fsload, + "load binary file from a btr filesystem", + " [][subvol_name]\n" + "- Load binary file 'filename' from 'dev' on 'interface'\n" + " to address 'addr' from better filesystem.\n" + " the load stops on end of file.\n" + " subvol_name is used read that file from this subvolume.\n" + " All numeric parameters are assumed to be hex." +); + diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile new file mode 100644 index 000..a9e2021 --- /dev/null +++ b/fs/btrfs/Makefile @@ -0,0 +1,51 @@ +# +# (C) Copyright 2006 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2003 +# Pavel Bartusek, Sysgo Real-Time Solutions AG, p...@sysgo.de +# +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)libbtrfs.o + +AOBJS = +COBJS-$(CONFIG_FS_BTR) := btrfs.o + +SRCS := $(AOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS-y)) + +
Re: [U-Boot] Problems around fatwrite command from uboot
Hi Lukasz, I test with an extended timeout and no effect. I already test multiples SD with very good quality SD Card with same problem (30-40 MB read / 10-20 MB write + SLC) ( just under the UHS-I SD cards ) The problem appears when FAT (or FAT entries) is inconsistent and despite a repair, the problem persists on writes of other futures files by the ubbot fatwrite command. Thanks for your help. 2013/2/22 Lukasz Majewski > Hi Jean, > > > Hi, > > > > I use the last uboot from your git and boot with it on AM3517 EVM > > from SD card > > without NAND. > > > > I use this option in uboot config : #define CONFIG_FAT_WRITE 1 > > > > I use intensively fatload / fatwrite commands at the boot before > > kernel loading. > > > > Sometimes, in about 2% of cases of boot, the FAT becomes inconsistent > > and I have > > systematically these messages at boot when I use fatwrite command : > > > > U-Boot 2013.01-gd3b9a66-dirty (Feb 21 2013 - 11:02:33) > > ... > > writing MODIFYME.001 > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > Those kind of errors are caused by exceeding timeout for receiving > response from your SD card. > > Could you try with other (different manufacturer) card? > > It seems like card/vendor specific - it depends on the firmware on the > SD card. > > Please look into a similar thread: > > http://article.gmane.org/gmane.comp.boot-loaders.u-boot/150636/match=rfc+mmc+fix+increase+timeout+value+sdhci_send_command > > > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > mmc_send_cmd: timedout waiting on cmd inhibit to clear > > 42428 bytes written > > ... > > > > > -- > Best regards, > > Lukasz Majewski > > Samsung R&D Poland (SRPOL) | Linux Platform Group > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 03/10] am33xx: refactor am33xx clocks and add ti814x support
On Sun, Feb 17, 2013 at 09:17:01PM +0100, Peter Korsgaard wrote: > > "Matt" == Matt Porter writes: > > Matt> Split clock.c for am335x and ti814x and add the ti814x include file. > Matt> Signed-off-by: Matt Porter > Matt> --- > Matt> arch/arm/cpu/armv7/am33xx/Makefile |3 +- > Matt> arch/arm/cpu/armv7/am33xx/clock-am335x.c | 374 > ++ > Matt> arch/arm/cpu/armv7/am33xx/clock-ti814x.c | 234 ++ > Matt> arch/arm/cpu/armv7/am33xx/clock.c| 374 > -- > Matt> arch/arm/include/asm/arch-am33xx/clock.h |4 + > Matt> arch/arm/include/asm/arch-am33xx/clocks_ti814x.h | 112 +++ > Matt> 6 files changed, 726 insertions(+), 375 deletions(-) > Matt> create mode 100644 arch/arm/cpu/armv7/am33xx/clock-am335x.c > Matt> create mode 100644 arch/arm/cpu/armv7/am33xx/clock-ti814x.c > Matt> delete mode 100644 arch/arm/cpu/armv7/am33xx/clock.c > Matt> create mode 100644 arch/arm/include/asm/arch-am33xx/clocks_ti814x.h Hi Peter...thanks for reviewing this. > Do you have rename detection enabled? I would have imagined > clock-am335x.c to show up as a copy of clock.c On any given day I forget to format-patch with rename detection enabled. You caught me...will be fixed in v2. > Matt> +++ b/arch/arm/cpu/armv7/am33xx/clock-am335x.c > Matt> @@ -0,0 +1,374 @@ > Matt> +/* > Matt> + * clock.c > Matt> + * > Matt> + * clocks for AM33XX based boards > Matt> + * > Matt> + * Copyright (C) 2011, Texas Instruments, Incorporated - > http://www.ti.com/ > > This is no longer clock.c or 2011. Care to update the header? Ok > > Matt> +++ b/arch/arm/cpu/armv7/am33xx/clock-ti814x.c > Matt> @@ -0,0 +1,234 @@ > Matt> +/* > Matt> + * clock.c > Matt> + * > Matt> + * clocks for TI814X based boards > Matt> + * > Matt> + * Copyright (C) 2011, Texas Instruments, Incorporated - > http://www.ti.com/ > > Same here. Ok -Matt ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 04/10] am33xx: refactor am33xx mux support and add ti814x support
On Sun, Feb 17, 2013 at 08:18:57PM +, Peter Korsgaard wrote: > > "Matt" == Matt Porter writes: > > Matt> AM33XX and TI814X have a similar mux though the pinmux register > Matt> layout and address space differ. Add a separate ti814x mux include > Matt> to support the TI814X-specific differences. > > Same comment about the file headers as patch 03, otherwise it looks > good. Will clean the headers. -Matt > Acked-by: Peter Korsgaard > > -- > Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/10] am33xx: add ti814x specific register definitions
On Mon, Feb 18, 2013 at 03:18:42PM +, Tom Rini wrote: > On Sun, Feb 17, 2013 at 09:28:33PM +0100, Peter Korsgaard wrote: > > > "Matt" == Matt Porter writes: > > > > Matt> Support the ti814x specific register definitions within > > Matt> arch-am33xx. > > > > Matt> Signed-off-by: Matt Porter > > Matt> --- > > Matt> arch/arm/cpu/armv7/am33xx/sys_info.c|3 +++ > > Matt> arch/arm/include/asm/arch-am33xx/cpu.h | 11 + > > Matt> arch/arm/include/asm/arch-am33xx/hardware.h | 32 > > +++ > > Matt> arch/arm/include/asm/arch-am33xx/omap.h |7 ++ > > Matt> arch/arm/include/asm/arch-am33xx/spl.h |5 + > > Matt> 5 files changed, 54 insertions(+), 4 deletions(-) > > > > Matt> diff --git a/arch/arm/include/asm/arch-am33xx/hardware.h > > b/arch/arm/include/asm/arch-am33xx/hardware.h > > Matt> index 41ab2c0..786c159 100644 > > Matt> --- a/arch/arm/include/asm/arch-am33xx/hardware.h > > Matt> +++ b/arch/arm/include/asm/arch-am33xx/hardware.h > > Matt> @@ -20,9 +20,14 @@ > > Matt> #define __AM33XX_HARDWARE_H > > > > Matt> #include > > Matt> +#include > > > > Quite some of the base addresses are similar, but I wonder if it > > wouldn't be cleaner to simply have a hardware-am33xx.h / > > hardware-ti814x.h instead of all these ifdef / elif? > > Since I suspect the things common from ti814x and am33xx are also common > to ti816x (which has been left as an exercise to whomever needs that > next), I think we can re-structure this into something like that, but > keeping the common parts within hardware.h still. Sounds good. I'll restructure with only the common parts in hardware.h. > > Matt> /* Control Module Base Address */ > > Matt> +#ifdef CONFIG_AM33XX > > Matt> #define CTRL_BASE 0x44E1 > > Matt> #define CTRL_DEVICE_BASE0x44E10600 > > Matt> +#elif defined(CONFIG_TI814X) > > Matt> +#define CTRL_BASE 0x4814 > > Matt> +#endif > > > > No CTRL_DEVICE_BASE on ti814x? > > I think this is a side-effect of Matt not supporting the things attached > to it (USB in the case of am335x). I tried to avoid defining things I'm not yet using. For CTRL_DEVICE_BASE, I would add it once I get to adding cpsw support as we need to read the efused macid value from that area. > > Matt> --- a/arch/arm/include/asm/arch-am33xx/spl.h > > Matt> +++ b/arch/arm/include/asm/arch-am33xx/spl.h > > Matt> @@ -25,8 +25,13 @@ > > > > Matt> #define BOOT_DEVICE_XIP 2 > > Matt> #define BOOT_DEVICE_NAND5 > > Matt> +#ifdef CONFIG_AM33XX > > Matt> #define BOOT_DEVICE_MMC18 > > Matt> #define BOOT_DEVICE_MMC29 /* eMMC or daughter card */ > > Matt> +#elif defined(CONFIG_TI814X) > > Matt> +#define BOOT_DEVICE_MMC19 > > Matt> +#define BOOT_DEVICE_MMC28 /* ROM only supports 2nd > > instance */ > > > > Argh! Couldn't we just swap the meaning of mmc1/mmc2 or would that be > > too confusing? > > IMHO, that will lead to further confusion down the line. I talked with > Matt about this before and well, it's funky. This is definitely a quirky area wrt TI814x. AFAIK it's the only OMAP-ish part where the ROM only allows boot from a single MMC instance. Further, that single MMC instance is actually the 2nd one as noted in the comment. This means to keep all the existing SPL mmc init logic intact, we need to define as above so that the unimplemented first MMC instance (which does exist on the part) does not get intialized when the ROM drops a bootdevice of "8". -Matt ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
On Mon, Feb 25, 2013 at 12:24:37PM +, Adnan Ali wrote: > Introduces btrfs file-system to read file > from volume/sub-volumes with btrload command. This > implementation has read-only support. > This btrfs implementation is based on syslinux btrfs > code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d. > > Signed-off-by: Adnan Ali A few things: - In general in fs/btrfs/btrfs.c I see some coding style problems (lack of spacing, non-printf's longer than 80-wide). Do these come from syslinux and thus will make any re-syncs easier? - It looks like you added support for CONFIG_CMD_FS_GENERIC, if so did you test that? - Can you please enable this support code on at least one platform, preferably the one you've tested and developed with? [snip] > diff --git a/fs/fs.c b/fs/fs.c [snip] > +//file handle is valid get the size of the file /* Style comments only */ > +len=filedata.size; And spacing between variable and assignment. > @@ -178,7 +248,6 @@ int fs_set_blk_dev(const char *ifname, const char > *dev_part_str, int fstype) > for (i = 0; i < ARRAY_SIZE(fstypes); i++) { > if ((fstype != FS_TYPE_ANY) && (fstype != fstypes[i].fstype)) > continue; > - > if (!fstypes[i].probe()) { > fs_type = fstypes[i].fstype; > return 0; [snip] > @@ -208,7 +280,6 @@ static void fs_close(void) > int fs_ls(const char *dirname) > { > int ret; > - > switch (fs_type) { > case FS_TYPE_FAT: > ret = fs_ls_fat(dirname); Unrelated, please drop. > @@ -237,11 +311,13 @@ int fs_read(const char *filename, ulong addr, int > offset, int len) > case FS_TYPE_EXT: > ret = fs_read_ext(filename, addr, offset, len); > break; > +case FS_TYPE_BTR: > + ret = fs_read_btr(filename, addr, offset, len); > + break; > default: > ret = fs_read_unsupported(filename, addr, offset, len); > break; > } > - > fs_close(); And unrelated whitespace changes here as well. > diff --git a/include/btrfs.h b/include/btrfs.h [snip] > +/* > + * Extent structure: contains the mapping of some chunk of a file > + * that is contiguous on disk. > + */ > +struct extent { > +//sector_tpstart; /* Physical start sector */ > +__le64 pstart; Fix please. > +/* > + * Our definition of "not whitespace" > + */ > +static inline char not_whitespace(char c) > +{ > + return (unsigned char)c > ' '; > +} Can't you just use isspace from ? > diff --git a/include/crc32c.h b/include/crc32c.h > new file mode 100644 > index 000..d04916e > --- /dev/null > +++ b/include/crc32c.h > @@ -0,0 +1,48 @@ > +/* > + * Copied from Linux kernel crypto/crc32c.c > + * Copyright (c) 2004 Cisco Systems, Inc. > + * Copyright (c) 2008 Herbert Xu > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by the Free > + * Software Foundation; either version 2 of the License, or (at your option) > + * any later version. > + * > + */ > + > +/* > + * This is the CRC-32C table > + * Generated with: > + * width = 32 bits > + * poly = 0x1EDC6F41 > + * reflect input bytes = true > + * reflect output bytes = true > + */ > + > +/* > + * Steps through buffer one byte at at time, calculates reflected > + * crc using table. > + */ > + > +static inline u32 crc32c_cal(u32 crc, const char *data, size_t length, u32 > *crc32c_table) > +{ > + while (length--) > + crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >> 8); > + > + return crc; > +} > + > +static inline void crc32c_init(u32 *crc32c_table, u32 pol) > +{ > + int i, j; > + u32 v; > + const u32 poly = pol; /* Bit-reflected CRC32C polynomial */ > + > + for (i = 0; i < 256; i++) { > + v = i; > + for (j = 0; j < 8; j++) { > + v = (v >> 1) ^ ((v & 1) ? poly : 0); > + } > + crc32c_table[i] = v; > + } > +} Simon, since you've just been over all the crc32 recently, do we have these functions somewhere already that can be easily tapped in to? Thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records
On Mon, Feb 25, 2013 at 11:58:56AM +0100, Albert ARIBAUD wrote: > R_ARM_ABS32 relocation records cause symbol references > to be zero before relocation, and become correct only > after relocation. On the other hand, R_ARM_RELATIVE > records make references correct before as well as > after relocation. > > This patch series aims at removing all R_ARM_ABS32 > relocations from ARM targets. > > the main contributor of R_ARM_ABS32 relocations is the > support code for linker-lists, aka Linker-Generated > Arrays. This is due to the fact that LGA start and end > symbols, used for ranging these arrays, are linker- > generated symbols, which always relocate as R_ARM_ABS32 > even though they are supposed *not* to be absolute. > > V1 of this patch series fixed LGAs so that start or > end symbols are actually compiler-generated, and thus > their references are relocated using R_ARM_RELATIVE; > V2 also fixes crt0 so that BSS start and end references > do not produce R_ARM_ABS32 relocations either. > > With V2, none of the targets built with MAKEALL -a arm > produces any R_ARM_ABS32 relocation. > > This series has been build-tested with ARM (295 targets > clean) and powerpc (634 targets clean) > > Changes in v2: > - fixed missing .sram memory mapping in OMAP lds > - removed useless linker script sections in SPL lds files > - made BSS start and end compiler-generated > - moved SPL linker script changes to their own commit > - added KEEP() to all linker files > - removed spurious change to common/command.c > - changed empty type from struct {} to char[0] > - dropped patch to removed board/micronas/vct/u-boot.lds > - removed all references to u-boot.lst > > Albert ARIBAUD (4): > arm: omap: map u_boot_lists section to .sram > Remove linker lists (LGAs) from SPL linker scripts > arm: make __bss_start and __bss_end__ compiler-generated > Refactor linker-generated arrays Reviewed-by: Tom Rini Aside from ARM and I assume Sandbox, has this been runtime tested on other arches yet? -- 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] May I join the maintainers of the u-boot blackfin custodian git tree?
On Mon, Feb 25, 2013 at 01:49:54PM +0800, Sonic Zhang wrote: > Hi all, > > > On Tue, Feb 19, 2013 at 3:27 PM, Sonic Zhang wrote: > > Dear Das U-boot developers and upstream git maintainers, > > > > I am Sonic Zhang from the Blackfin Linux team in > > Analog Devices Inc. Blackfin is one of the high performance general > > purpose DSPs, which can run complete OS without MMU, such as Linux. I > > have worked on the Linux kernel and u-boot porting and driver > > developing for Blackfin architecture since year 2005. In addition, I > > also manage the annual open source releases for Blackfin GNU > > toolchain, Das U-boot and Linux distribution in Analog Devices. The > > latest 2012R2 releases was just done on Feb. 4, 2013. The details can > > be found on http://blackfin.uclinux.org > > > > Mike Frysinger used to be our upstream maintainer for the the u-boot > > blackfin custodian tree. But, he is no longer with Analog Devices. So, > > I take over the u-boot maintaining work for Blackfin now. May I join > > the maintainers of the u-boot blackfin custodian git tree at > > git://git.denx.de/u-boot-blackfin.git ? My public rsa key file is > > attached. > > Any comments? Sorry for the late reply. v4 of your series looks good. I'll send you an off-list email to get a few things rolling. -- 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 v3] Introduced btrfs file-system with btrload command
On 25/02/13 15:04, Tom Rini wrote: On Mon, Feb 25, 2013 at 12:24:37PM +, Adnan Ali wrote: Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support. This btrfs implementation is based on syslinux btrfs code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d. Signed-off-by: Adnan Ali A few things: - In general in fs/btrfs/btrfs.c I see some coding style problems (lack of spacing, non-printf's longer than 80-wide). Do these come from syslinux and thus will make any re-syncs easier? Most of the ported code is unmodified so its coding style should be same as syslinux. - It looks like you added support for CONFIG_CMD_FS_GENERIC, if so did you test that? This command wasn't enabled in my configs. I haven't added any command i.e btrls for this as this feature is not supported yet. - Can you please enable this support code on at least one platform, preferably the one you've tested and developed with? Even if do enable support for this, it will also debug 'Unsupported filesystem type.' For the rest of changes you proposed i will change them and send as v4 patch. [snip] diff --git a/fs/fs.c b/fs/fs.c [snip] +//file handle is valid get the size of the file /* Style comments only */ +len=filedata.size; And spacing between variable and assignment. @@ -178,7 +248,6 @@ int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype) for (i = 0; i < ARRAY_SIZE(fstypes); i++) { if ((fstype != FS_TYPE_ANY) && (fstype != fstypes[i].fstype)) continue; - if (!fstypes[i].probe()) { fs_type = fstypes[i].fstype; return 0; [snip] @@ -208,7 +280,6 @@ static void fs_close(void) int fs_ls(const char *dirname) { int ret; - switch (fs_type) { case FS_TYPE_FAT: ret = fs_ls_fat(dirname); Unrelated, please drop. @@ -237,11 +311,13 @@ int fs_read(const char *filename, ulong addr, int offset, int len) case FS_TYPE_EXT: ret = fs_read_ext(filename, addr, offset, len); break; +case FS_TYPE_BTR: + ret = fs_read_btr(filename, addr, offset, len); + break; default: ret = fs_read_unsupported(filename, addr, offset, len); break; } - fs_close(); And unrelated whitespace changes here as well. diff --git a/include/btrfs.h b/include/btrfs.h [snip] +/* + * Extent structure: contains the mapping of some chunk of a file + * that is contiguous on disk. + */ +struct extent { +//sector_tpstart; /* Physical start sector */ +__le64 pstart; Fix please. +/* + * Our definition of "not whitespace" + */ +static inline char not_whitespace(char c) +{ + return (unsigned char)c > ' '; +} Can't you just use isspace from ? diff --git a/include/crc32c.h b/include/crc32c.h new file mode 100644 index 000..d04916e --- /dev/null +++ b/include/crc32c.h @@ -0,0 +1,48 @@ +/* + * Copied from Linux kernel crypto/crc32c.c + * Copyright (c) 2004 Cisco Systems, Inc. + * Copyright (c) 2008 Herbert Xu + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + */ + +/* + * This is the CRC-32C table + * Generated with: + * width = 32 bits + * poly = 0x1EDC6F41 + * reflect input bytes = true + * reflect output bytes = true + */ + +/* + * Steps through buffer one byte at at time, calculates reflected + * crc using table. + */ + +static inline u32 crc32c_cal(u32 crc, const char *data, size_t length, u32 *crc32c_table) +{ + while (length--) + crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >> 8); + + return crc; +} + +static inline void crc32c_init(u32 *crc32c_table, u32 pol) +{ + int i, j; + u32 v; + const u32 poly = pol; /* Bit-reflected CRC32C polynomial */ + + for (i = 0; i < 256; i++) { + v = i; + for (j = 0; j < 8; j++) { + v = (v >> 1) ^ ((v & 1) ? poly : 0); + } + crc32c_table[i] = v; + } +} Simon, since you've just been over all the crc32 recently, do we have these functions somewhere already that can be easily tapped in to? Thanks! Thanks Adnan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records
Hi Albert, Tom, 2013/2/25 Tom Rini : > On Mon, Feb 25, 2013 at 11:58:56AM +0100, Albert ARIBAUD wrote: > >> R_ARM_ABS32 relocation records cause symbol references >> to be zero before relocation, and become correct only >> after relocation. On the other hand, R_ARM_RELATIVE >> records make references correct before as well as >> after relocation. >> >> This patch series aims at removing all R_ARM_ABS32 >> relocations from ARM targets. >> >> the main contributor of R_ARM_ABS32 relocations is the >> support code for linker-lists, aka Linker-Generated >> Arrays. This is due to the fact that LGA start and end >> symbols, used for ranging these arrays, are linker- >> generated symbols, which always relocate as R_ARM_ABS32 >> even though they are supposed *not* to be absolute. >> >> V1 of this patch series fixed LGAs so that start or >> end symbols are actually compiler-generated, and thus >> their references are relocated using R_ARM_RELATIVE; >> V2 also fixes crt0 so that BSS start and end references >> do not produce R_ARM_ABS32 relocations either. >> >> With V2, none of the targets built with MAKEALL -a arm >> produces any R_ARM_ABS32 relocation. >> >> This series has been build-tested with ARM (295 targets >> clean) and powerpc (634 targets clean) >> >> Changes in v2: >> - fixed missing .sram memory mapping in OMAP lds >> - removed useless linker script sections in SPL lds files >> - made BSS start and end compiler-generated >> - moved SPL linker script changes to their own commit >> - added KEEP() to all linker files >> - removed spurious change to common/command.c >> - changed empty type from struct {} to char[0] >> - dropped patch to removed board/micronas/vct/u-boot.lds >> - removed all references to u-boot.lst >> >> Albert ARIBAUD (4): >> arm: omap: map u_boot_lists section to .sram >> Remove linker lists (LGAs) from SPL linker scripts >> arm: make __bss_start and __bss_end__ compiler-generated >> Refactor linker-generated arrays > > Reviewed-by: Tom Rini > > Aside from ARM and I assume Sandbox, has this been runtime tested on > other arches yet? > I've runtime tested the refactored LGA on MIPS, so Tested-by: Daniel Schwierzeck -- Best regards, Daniel ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/25/2013 11:08 AM, Adnan Ali wrote: > On 25/02/13 15:04, Tom Rini wrote: >> On Mon, Feb 25, 2013 at 12:24:37PM +, Adnan Ali wrote: >> >>> Introduces btrfs file-system to read file from >>> volume/sub-volumes with btrload command. This implementation >>> has read-only support. This btrfs implementation is based on >>> syslinux btrfs code, commit >>> 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d. >>> >>> Signed-off-by: Adnan Ali >> A few things: - In general in fs/btrfs/btrfs.c I see some coding >> style problems (lack of spacing, non-printf's longer than >> 80-wide). Do these come from syslinux and thus will make any >> re-syncs easier? > Most of the ported code is unmodified so its coding style should be > same as syslinux. That's what I thought. >> - It looks like you added support for CONFIG_CMD_FS_GENERIC, if >> so did you test that? > This command wasn't enabled in my configs. I haven't added any > command i.e btrls for this as this feature is not supported yet. Can you then please? Thanks. >> - Can you please enable this support code on at least one >> platform, preferably the one you've tested and developed with? > Even if do enable support for this, it will also debug 'Unsupported > filesystem type.' I don't understand. > For the rest of changes you proposed i will change them and send as > v4 patch. Thanks! - -- Tom -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRK5FtAAoJENk4IS6UOR1WLbYP/i/c8s10TIoya1UnLiCX87tt u/DRhip4/HBhyCtZmxCejLM6VrgJ8GBACq7hP6eXY3BE5zRB11rKnaypOdc1EA6h WG87W+6LDOQEvFPzuyXRpXIGvUwq5gHsa95rM0pq/k5WnUJwl4eRAyuhU0JFilQ8 p83GUbYH3Ss1ZX6sr2O+LNkGrIW/PNw1TVioJYyfUUQvcqVYw8CIBLSusxCkY445 ps2QD3Np4XvYXkGFoHUkb0t+Lp0m87PaHBAuABr+TqUEne+QT3GU1E6xN4jcoasX 2Bd0LQFnIhoU6hiH/EuAsQs8tt48ByEliug0Yvr7iK4Cb5sQen21LjXUagarvArF RKkg/SThdqwYStfkX5/+z73m2F3lcGGF9IobVuz9HWi2VvXEYM500+pGYcOzjP+3 V+deSp0PReW4lbFRnFgxcArETIumd4+deCQzX9XHUC20iC/Xf2N+s6L5VTGqQf0g 33+QDPaUo1SdCZmKiCpVuBa0hzZsQPRhFOHRUpGbEZRbf45iHl5Ewhm88K6dTiz4 vsr7YJDs4rJcph0q6tKSLVVGioPpa3EqpWZrXGB4JTwc6GHbluAvL7GXrHWxtbtX AZOxNEegmljq+l+6g+n2sZ+RDlyynU/x9NvKVEM8ucqmMGrcrTKG5fUc536U2sWL 8xEfGHfYMZ9AxbF0DEXY =FPEv -END PGP SIGNATURE- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
On 25/02/13 16:29, Tom Rini wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/25/2013 11:08 AM, Adnan Ali wrote: On 25/02/13 15:04, Tom Rini wrote: On Mon, Feb 25, 2013 at 12:24:37PM +, Adnan Ali wrote: Introduces btrfs file-system to read file from volume/sub-volumes with btrload command. This implementation has read-only support. This btrfs implementation is based on syslinux btrfs code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d. Signed-off-by: Adnan Ali A few things: - In general in fs/btrfs/btrfs.c I see some coding style problems (lack of spacing, non-printf's longer than 80-wide). Do these come from syslinux and thus will make any re-syncs easier? Most of the ported code is unmodified so its coding style should be same as syslinux. That's what I thought. - It looks like you added support for CONFIG_CMD_FS_GENERIC, if so did you test that? This command wasn't enabled in my configs. I haven't added any command i.e btrls for this as this feature is not supported yet. Can you then please? Thanks. I have added support for this in my configs, build and flashed on my mx53loco hardware it booted fine. When i type LS gives me ** Unrecognized filesystem type **. which is what i have done it in code. Any ls should print above message when its using btrfs. - Can you please enable this support code on at least one platform, preferably the one you've tested and developed with? Even if do enable support for this, it will also debug 'Unsupported filesystem type.' I don't understand. I'm assuming that you are asking me to test it on atleast one hardware platform with CONFIG_CMD_FS_GENERIC enabled. Which i done it on mx53loco. If my assumption is wrong can you please rephrase your question. For the rest of changes you proposed i will change them and send as v4 patch. Thanks! - -- Tom -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRK5FtAAoJENk4IS6UOR1WLbYP/i/c8s10TIoya1UnLiCX87tt u/DRhip4/HBhyCtZmxCejLM6VrgJ8GBACq7hP6eXY3BE5zRB11rKnaypOdc1EA6h WG87W+6LDOQEvFPzuyXRpXIGvUwq5gHsa95rM0pq/k5WnUJwl4eRAyuhU0JFilQ8 p83GUbYH3Ss1ZX6sr2O+LNkGrIW/PNw1TVioJYyfUUQvcqVYw8CIBLSusxCkY445 ps2QD3Np4XvYXkGFoHUkb0t+Lp0m87PaHBAuABr+TqUEne+QT3GU1E6xN4jcoasX 2Bd0LQFnIhoU6hiH/EuAsQs8tt48ByEliug0Yvr7iK4Cb5sQen21LjXUagarvArF RKkg/SThdqwYStfkX5/+z73m2F3lcGGF9IobVuz9HWi2VvXEYM500+pGYcOzjP+3 V+deSp0PReW4lbFRnFgxcArETIumd4+deCQzX9XHUC20iC/Xf2N+s6L5VTGqQf0g 33+QDPaUo1SdCZmKiCpVuBa0hzZsQPRhFOHRUpGbEZRbf45iHl5Ewhm88K6dTiz4 vsr7YJDs4rJcph0q6tKSLVVGioPpa3EqpWZrXGB4JTwc6GHbluAvL7GXrHWxtbtX AZOxNEegmljq+l+6g+n2sZ+RDlyynU/x9NvKVEM8ucqmMGrcrTKG5fUc536U2sWL 8xEfGHfYMZ9AxbF0DEXY =FPEv -END PGP SIGNATURE- Thanks Adnan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/25/2013 11:44 AM, Adnan Ali wrote: > On 25/02/13 16:29, Tom Rini wrote: [snip] > - It looks like you added support for > CONFIG_CMD_FS_GENERIC, if so did you test that? This command wasn't enabled in my configs. I haven't added any command i.e btrls for this as this feature is not supported yet. > Can you then please? Thanks. >> I have added support for this in my configs, build and flashed on >> my mx53loco hardware it booted fine. When i type LS gives me ** >> Unrecognized filesystem type **. which is what i have done it in >> code. Any ls should print above message when its using btrfs. > > - Can you please enable this support code on at least one > platform, preferably the one you've tested and developed > with? Even if do enable support for this, it will also debug 'Unsupported filesystem type.' > I don't understand. >> I'm assuming that you are asking me to test it on atleast one >> hardware platform with CONFIG_CMD_FS_GENERIC enabled. Which i >> done it on mx53loco. If my assumption is wrong can you please >> rephrase your question. OK. Can you please add btrfs support to CONFIG_CMD_FS_GENERIC? Or try and point out that it's quite difficult / annoying / we need to fix our interface? You'd be the first person other than the author of the original changes to do so, so your feedback here would be quite useful. Thanks! - -- Tom -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRK5X2AAoJENk4IS6UOR1WFqAP/0DStonfADUwZTzyxwT22spZ xGrJGUCVBBpiZ+xoO3ZRuKYG/DAkD3kYATV2DqgM/kqVuusHyiPeh4z1qcO78tWk Quwce9sIU5uhMkQey0sCbIX5YHgxY0DbrcxpNLedQLKLo1NOZY3/uJUDRNt8uIeP B3PH5uNXR8hVwwC0ML8dC8ZK7/XbPBZvdr0jjhYR8RzfHVxbpFKNL1vjxsN9TZiS ZAp+DyIP389FPRQd2zt4bhzNHGuJ2TkwewEXi00MCO8vKkRKvuPZbV7hc0w9t+d7 m1VbAzLL/FZ9ld8r3CvowgBg91vP/y8Vjr5bnX9CaZzaf96vPTVldx/UmZ9xtWtb TzPxPaYkHXEmtdGfxfYI/v1CHu9rkjiDOrZMPbXNx2XzjYdwp5kk8Hlfqi+F8d+m wFt+q2kHZdAEPDoIcvsi4buAbiqyehH03K0QpaH1UaEH01lVvw8S9U1p9/iLcSrV c1kN4GMySKdPTIoTv97S4SpHUcijI1aMOaqc462M4YKroRg54iMMHCFkQBy0HF4U n6B+yZv1Yy5IWf4Z5b143V8FN8yOSvfzG+gEMICc/NZU09nT6fwfPRfMWj2lIPj8 wsDYpdL7amDAl2TUCLEB8vbue5ELjB2Bu2S25wKrsKrN9mPvh1LvFyHhO4HJ49Ly +1SAb04CSBOhgXOzO+SZ =pYZr -END PGP SIGNATURE- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 0/4] Get rid of R_ARM_ABS32 relocation records
Hi Tom, On Mon, 25 Feb 2013 10:19:13 -0500, Tom Rini wrote: > On Mon, Feb 25, 2013 at 11:58:56AM +0100, Albert ARIBAUD wrote: > > > R_ARM_ABS32 relocation records cause symbol references > > to be zero before relocation, and become correct only > > after relocation. On the other hand, R_ARM_RELATIVE > > records make references correct before as well as > > after relocation. > > > > This patch series aims at removing all R_ARM_ABS32 > > relocations from ARM targets. > > > > the main contributor of R_ARM_ABS32 relocations is the > > support code for linker-lists, aka Linker-Generated > > Arrays. This is due to the fact that LGA start and end > > symbols, used for ranging these arrays, are linker- > > generated symbols, which always relocate as R_ARM_ABS32 > > even though they are supposed *not* to be absolute. > > > > V1 of this patch series fixed LGAs so that start or > > end symbols are actually compiler-generated, and thus > > their references are relocated using R_ARM_RELATIVE; > > V2 also fixes crt0 so that BSS start and end references > > do not produce R_ARM_ABS32 relocations either. > > > > With V2, none of the targets built with MAKEALL -a arm > > produces any R_ARM_ABS32 relocation. > > > > This series has been build-tested with ARM (295 targets > > clean) and powerpc (634 targets clean) > > > > Changes in v2: > > - fixed missing .sram memory mapping in OMAP lds > > - removed useless linker script sections in SPL lds files > > - made BSS start and end compiler-generated > > - moved SPL linker script changes to their own commit > > - added KEEP() to all linker files > > - removed spurious change to common/command.c > > - changed empty type from struct {} to char[0] > > - dropped patch to removed board/micronas/vct/u-boot.lds > > - removed all references to u-boot.lst > > > > Albert ARIBAUD (4): > > arm: omap: map u_boot_lists section to .sram > > Remove linker lists (LGAs) from SPL linker scripts > > arm: make __bss_start and __bss_end__ compiler-generated > > Refactor linker-generated arrays > > Reviewed-by: Tom Rini > > Aside from ARM and I assume Sandbox, has this been runtime tested on > other arches yet? None other on my side. Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4] Exynos5: Pinmux: Add fdt for pinmux
This patch adds fdt nodes for peripherals which require pin muxing and configuration. Device tree bindings for pinctrl are kept same as required for Linux. Existing pinmux code modified to retrieve gpio range and function related info from fdt. Depends-on: [U-Boot] [PATCH 0/4 V3] EXYNOS5: Add GPIO numbering feature URL: http://lists.denx.de/pipermail/u-boot/2013-February/146151.html Signed-off-by: Akshay Saraswat --- Changes since v3: - Added comments to reduce ambiguity and increase readability. - Fixed few other nits. arch/arm/cpu/armv7/exynos/pinmux.c | 404 +++ arch/arm/dts/exynos5250-pinctrl.dtsi | 675 ++ arch/arm/dts/exynos5250.dtsi |1 + doc/device-tree-bindings/samsung-pinctrl.txt | 253 ++ include/fdtdec.h |1 + lib/fdtdec.c |1 + 6 files changed, 1229 insertions(+), 106 deletions(-) create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi create mode 100644 doc/device-tree-bindings/samsung-pinctrl.txt diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c index a01ce0c..ba34560 100644 --- a/arch/arm/cpu/armv7/exynos/pinmux.c +++ b/arch/arm/cpu/armv7/exynos/pinmux.c @@ -27,6 +27,21 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + +/* + * Struct for temporarily storing pin numbers and + * pin function related info. + */ +struct pin_group { + void *dev_name; /* Name of the Peripheral device */ + int npins; /* Number of pins to be configured */ + int function; /* Pin function */ + int pull_mode; /* Pin pull mode */ + int drive_strength; /* Pin drive strength */ + enum exynos5_gpio_pin gpio[]; /* Pin numbers to be configured */ +}; + struct gpio_name_num_table exynos5_gpio_table[] = { { 'a', GPIO_A00 }, { 'b', GPIO_B00 }, @@ -42,87 +57,224 @@ struct gpio_name_num_table exynos5_gpio_table[] = { { 'z', GPIO_Z0 }, }; -static void exynos5_uart_config(int peripheral) +/* Populate exynos5_gpio_pin array in a particular pin_group */ +static void pinmux_get_pin_numbers(const struct fdt_property *fprop, + struct pin_group *pingrp) +{ + int i; + char gpio[5]; + + pingrp->npins = 0; + + /* +* Get all the pin names from fdt and fill the gpio array +* with corresponding enum values(Pin numbers). +*/ + for (i = 0; !(fprop->data[i] == (int)NULL && + fprop->data[i-1] == (int)NULL); i += 7) { + int pin_num = -1; + + /* +* Modify pin name retrieved from fdt, +* so that name_to_gpio may understand. +*/ + gpio[0] = fprop->data[i]; + gpio[1] = fprop->data[i + 1]; + gpio[2] = fprop->data[i + 2]; + gpio[3] = fprop->data[i + 3]; + gpio[4] = fprop->data[i + 5]; + + pin_num = name_to_gpio(gpio); + + /* +* If pin number is valid, add it to the pin array +* and increment pin count. +*/ + if (pin_num >= 0) { + pingrp->gpio[pingrp->npins] = pin_num; + pingrp->npins++; + } + } +} + +/* Extract all the config info for a node from fdt */ +static int pinmux_get_fdt_values(struct pin_group *pingrp) { - int i, start, count; + int node, subnode; + const struct fdt_property *fprop; + + /* Loop for all pinctrl nodes in fdt */ + for (node = fdtdec_next_compatible(gd->fdt_blob, 0, + COMPAT_SAMSUNG_PINCTRL); node >= 0; + node = fdtdec_next_compatible(gd->fdt_blob, node, + COMPAT_SAMSUNG_PINCTRL)) { + /* Get the subnode from FDT for this peripheral*/ + subnode = fdt_subnode_offset(gd->fdt_blob, + node, pingrp->dev_name); + if (subnode < 0) + continue; + + /* Get names of pins to be configured from fdt */ + fprop = fdt_get_property(gd->fdt_blob, + subnode, "samsung,pins", NULL); + + /* Convert pin names to pin numbers */ + pinmux_get_pin_numbers(fprop, pingrp); + + /* Get the pin function from fdt */ + pingrp->function = fdtdec_get_int(gd->fdt_blob, + subnode, "samsung,pin-function", 0); + + /* Get the pull mode for pins from fdt */ + pingrp->pull_mode = fdtdec_get_int(gd->fdt_blob, + subnode, "samsung,pin-pud", 0); +
[U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Implement u-boot.nand target that can be reused with a small amount of churn across all CPU models. The idea is to delegate the u-boot.nand target out of the main Makefile and into the CPU's Makefile (very similar to what u-boot.imx does now). The main Makefile shall only contain path to which the u-boot.nand target is delegated. Hopefully this will not produce too much bloat in the main Makefile. To demonstrate this implementation, add u-boot.nand target for i.MX53. Signed-off-by: Marek Vasut Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Stefano Babic --- Makefile | 18 ++ arch/arm/imx-common/Makefile |6 ++ 2 files changed, 24 insertions(+) diff --git a/Makefile b/Makefile index 41054b7..8b1010a 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,23 @@ $(obj)u-boot.img: $(obj)u-boot.bin $(obj)u-boot.imx: $(obj)u-boot.bin depend $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx +# +# Generic u-boot.nand target. +# +# Every CPU that needs u-boot.nand must add a path to an implementation of +# the actual u-boot.nand generator below. +# +ifdef CONFIG_MX53 +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common +endif + +$(obj)u-boot.nand: $(obj)u-boot.bin depend + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then \ + echo "This CPU does not support u-boot.nand target!" ; \ + exit 1 ; \ + fi + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand + $(obj)u-boot.kwb: $(obj)u-boot.bin $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ @@ -857,6 +874,7 @@ clobber:tidy @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.pbl @rm -f $(obj)u-boot.imx + @rm -f $(obj)u-boot.nand @rm -f $(obj)u-boot.ubl @rm -f $(obj)u-boot.ais @rm -f $(obj)u-boot.dtb diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 5d5c5b2..71ea36f 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ +$(obj)u-boot.nand: $(obj)u-boot.imx + ( \ + echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ; \ + dd if=/dev/zero bs=1015 count=1 2>/dev/null ) | \ + cat - $< > $@ + $(obj)SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ -e $(CONFIG_SPL_TEXT_BASE) -d $< $@ -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4] imx: Align the imximage header and payload to multiples of 4k
The MX53 ROM loads the data from NAND in multiples of pages and supports maximum page size of 4k. Thus, align the image and header to 4k to be safe from ROM bugs. Signed-off-by: Marek Vasut Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Stefano Babic --- tools/imximage.c | 11 +++ tools/imximage.h |3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/imximage.c b/tools/imximage.c index fa308c9..c018562 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -518,11 +518,14 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd, /* * ROM bug alert -* mx53 only loads 512 byte multiples. -* The remaining fraction of a block bytes would -* not be loaded. +* +* MX53 only loads 512 byte multiples in case of SD boot. +* MX53 only loads NAND page multiples in case of NAND boot and +* supports up to 4096 byte large pages, thus align to 4096. +* +* The remaining fraction of a block bytes would not be loaded! */ - *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512); + *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096); } int imximage_check_params(struct mkimage_params *params) diff --git a/tools/imximage.h b/tools/imximage.h index 42b6090..dfd2e9e 100644 --- a/tools/imximage.h +++ b/tools/imximage.h @@ -151,13 +151,14 @@ typedef struct { dcd_v2_t dcd_table; } imx_header_v2_t; +/* The header must be aligned to 4k on MX53 for NAND boot */ struct imx_header { union { imx_header_v1_t hdr_v1; imx_header_v2_t hdr_v2; } header; uint32_t flash_offset; -}; +} __attribute__((aligned(4096))); typedef void (*set_dcd_val_t)(struct imx_header *imxhdr, char *name, int lineno, -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4] mx5: Add NAND clock handling
Augment the MX5 clock code with function to enable and configure NFC clock. This is necessary to get NFC working on MX5. Signed-off-by: Marek Vasut Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Stefano Babic --- arch/arm/cpu/armv7/mx5/clock.c| 12 ++-- arch/arm/include/asm/arch-mx5/clock.h |1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c index 76c2c52..f768fc9 100644 --- a/arch/arm/cpu/armv7/mx5/clock.c +++ b/arch/arm/cpu/armv7/mx5/clock.c @@ -739,10 +739,11 @@ static int config_core_clk(u32 ref, u32 freq) static int config_nfc_clk(u32 nfc_clk) { u32 parent_rate = get_emi_slow_clk(); - u32 div = parent_rate / nfc_clk; + u32 div; - if (nfc_clk <= 0) + if (nfc_clk == 0) return -EINVAL; + div = parent_rate / nfc_clk; if (div == 0) div++; if (parent_rate / div > NFC_CLK_MAX) @@ -755,6 +756,13 @@ static int config_nfc_clk(u32 nfc_clk) return 0; } +void enable_nfc_clk(unsigned char enable) +{ + unsigned int cg = enable ? MXC_CCM_CCGR_CG_ON : MXC_CCM_CCGR_CG_OFF; + + clrsetbits_le32(&mxc_ccm->CCGR5, MXC_CCM_CCGR_CG_MASK << 20, cg << 20); +} + /* Config main_bus_clock for periphs */ static int config_periph_clk(u32 ref, u32 freq) { diff --git a/arch/arm/include/asm/arch-mx5/clock.h b/arch/arm/include/asm/arch-mx5/clock.h index 9cdfb48..6910192 100644 --- a/arch/arm/include/asm/arch-mx5/clock.h +++ b/arch/arm/include/asm/arch-mx5/clock.h @@ -68,5 +68,6 @@ void set_usboh3_clk(void); void enable_usboh3_clk(unsigned char enable); void mxc_set_sata_internal_clock(void); int enable_i2c_clk(unsigned char enable, unsigned i2c_num); +void enable_nfc_clk(unsigned char enable); #endif /* __ASM_ARCH_CLOCK_H */ -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4] mx5: Add support for DENX M53EVK
Add basic support for the DENX M53EVK board. Currently supported is the MMC, Ethernet, I2C. Signed-off-by: Marek Vasut Cc: Andreas Widder Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Stefano Babic Cc: Wolfgang Denk --- board/denx/m53evk/Makefile | 40 board/denx/m53evk/imximage.cfg | 108 +++ board/denx/m53evk/m53evk.c | 404 boards.cfg |1 + include/configs/m53evk.h | 226 ++ 5 files changed, 779 insertions(+) create mode 100644 board/denx/m53evk/Makefile create mode 100644 board/denx/m53evk/imximage.cfg create mode 100644 board/denx/m53evk/m53evk.c create mode 100644 include/configs/m53evk.h diff --git a/board/denx/m53evk/Makefile b/board/denx/m53evk/Makefile new file mode 100644 index 000..bfb040a --- /dev/null +++ b/board/denx/m53evk/Makefile @@ -0,0 +1,40 @@ +# +# DENX M53EVK +# Copyright (C) 2012-2013 Marek Vasut +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).o + +COBJS := m53evk.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/denx/m53evk/imximage.cfg b/board/denx/m53evk/imximage.cfg new file mode 100644 index 000..3d60de0 --- /dev/null +++ b/board/denx/m53evk/imximage.cfg @@ -0,0 +1,108 @@ +/* + * DENX M53 DRAM init values + * Copyright (C) 2012-2013 Marek Vasut + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not write to the Free Software + * Foundation Inc. 51 Franklin Street Fifth Floor Boston, + * MA 02110-1301 USA + * + * Refer docs/README.imxmage for more details about how-to configure + * and create imximage boot image + * + * The syntax is taken as close as possible with the kwbimage + */ +/* image version */ +IMAGE_VERSION 2 + +/* + * Boot Device : one of + * spi, sd, nand + */ +BOOT_FROM nand + +/* + * Device Configuration Data (DCD) + * + * Each entry must have the format: + * Addr-type AddressValue + * + * where: + * Addr-type register length (1,2 or 4 bytes) + * Address absolute address of the register + * value value to be stored in the register + */ +DATA 4 0x53fa86f4 0x/* GRP_DDRMODE_CTL */ +DATA 4 0x53fa8714 0x/* GRP_DDRMODE */ +DATA 4 0x53fa86fc 0x/* GRP_DDRPKE */ +DATA 4 0x53fa8724 0x0400/* GRP_DDR_TYPE */ + +DATA 4 0x53fa872c 0x0030/* GRP_B3DS */ +DATA 4 0x53fa8554 0x0030/* DRAM_DQM3 */ +DATA 4 0x53fa8558 0x00300040/* DRAM_SDQS3 */ + +DATA 4 0x53fa8728 0x0030/* GRP_B2DS */ +DATA 4 0x53fa8560 0x0030/* DRAM_DQM2 */ +DATA 4 0x53fa8568 0x00300040/* DRAM_SDQS2 */ + +DATA 4 0x53fa871c 0x0030/* GRP_B1DS */ +DATA 4 0x53fa8594 0x0030/* DRAM_DQM1 */ +DATA 4 0x53fa8590 0x00300040/* DRAM_SDQS1 */ + +DATA 4 0x53fa8718 0x0030/* GRP_B0DS */ +DATA 4 0x53fa8584 0x0030/* DRAM_DQM0 */ +DATA 4 0x53fa857c 0x00300040/* DRAM_SDQS0 */ + +DATA 4 0x53fa8578 0x0030/* DRAM_SDCLK_0 */ +DATA 4 0x53fa8570 0x0030/* DRAM_SDCLK_1 */ + +DATA 4 0x53fa8574 0x0030/* DRAM_CAS */ +DATA 4 0x53fa8588 0x0030/* DRAM_RAS */ +DATA 4 0x53fa86f0 0x0030/* GRP_ADDDS */ +DATA 4 0x53fa8720 0x0030/* GRP_CTLDS */ + +DATA 4 0x53fa8564 0x00300040/* DRAM_SDODT1 */ +D
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Marek Vasut, On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote: > Implement u-boot.nand target that can be reused with a small amount of > churn across all CPU models. The idea is to delegate the u-boot.nand target > out of the main Makefile and into the CPU's Makefile (very similar to what > u-boot.imx does now). The main Makefile shall only contain path to which the > u-boot.nand target is delegated. Hopefully this will not produce too much > bloat in the main Makefile. > > To demonstrate this implementation, add u-boot.nand target for i.MX53. > > Signed-off-by: Marek Vasut > Cc: Benoît Thébaudeau > Cc: Fabio Estevam > Cc: Stefano Babic > --- > Makefile | 18 ++ > arch/arm/imx-common/Makefile |6 ++ > 2 files changed, 24 insertions(+) > > diff --git a/Makefile b/Makefile > index 41054b7..8b1010a 100644 > --- a/Makefile > +++ b/Makefile > @@ -470,6 +470,23 @@ $(obj)u-boot.img:$(obj)u-boot.bin > $(obj)u-boot.imx: $(obj)u-boot.bin depend > $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx > > +# > +# Generic u-boot.nand target. > +# > +# Every CPU that needs u-boot.nand must add a path to an implementation of > +# the actual u-boot.nand generator below. > +# > +ifdef CONFIG_MX53 > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common What about calling it rather CONFIG_NAND_TGT_PATH? TRG looks more like trigger. > +endif > + > +$(obj)u-boot.nand: $(obj)u-boot.bin depend ^ $(obj)u-boot.bin already depends on depend through $(obj)u-boot, so it's useless here. > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then > \ > + echo "This CPU does not support u-boot.nand target!" ; > \ > + exit 1 ; > \ > + fi > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand ^ $(OBJTREE)/ > + > $(obj)u-boot.kwb: $(obj)u-boot.bin > $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ > -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > @@ -857,6 +874,7 @@ clobber: tidy > @rm -f $(obj)u-boot.kwb > @rm -f $(obj)u-boot.pbl > @rm -f $(obj)u-boot.imx > + @rm -f $(obj)u-boot.nand > @rm -f $(obj)u-boot.ubl > @rm -f $(obj)u-boot.ais > @rm -f $(obj)u-boot.dtb > diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile > index 5d5c5b2..71ea36f 100644 > --- a/arch/arm/imx-common/Makefile > +++ b/arch/arm/imx-common/Makefile > @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin > $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ > -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > > +$(obj)u-boot.nand: $(obj)u-boot.imx > + ( \ > + echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ; \ > + dd if=/dev/zero bs=1015 count=1 2>/dev/null ) | \ > + cat - $< > $@ Is that all? According to 7.5.2.2 (i.MX53 RM), the boot ROM switches to serial mode if anything goes wrong with the NAND. Hence, for reliable NAND boot, you have to choose either DBBT or SPL (or both, but that would be waste). Populating the DBBT would be complicated, so I'd go for SPL. You could just use my u-boot-with-nand-spl.imx and change the dummy header to a true FCB with the fingerprint like you did in your header above. u-boot.nand then becomes useless. > + > $(obj)SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst > "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ > -e $(CONFIG_SPL_TEXT_BASE) -d $< $@ Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] imx: Align the imximage header and payload to multiples of 4k
On Monday, February 25, 2013 7:19:55 PM, Marek Vasut wrote: > The MX53 ROM loads the data from NAND in multiples of pages and > supports maximum page size of 4k. Thus, align the image and header > to 4k to be safe from ROM bugs. > > Signed-off-by: Marek Vasut > Cc: Benoît Thébaudeau > Cc: Fabio Estevam > Cc: Stefano Babic > --- > tools/imximage.c | 11 +++ > tools/imximage.h |3 ++- > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/tools/imximage.c b/tools/imximage.c > index fa308c9..c018562 100644 > --- a/tools/imximage.c > +++ b/tools/imximage.c > @@ -518,11 +518,14 @@ static void imximage_set_header(void *ptr, struct stat > *sbuf, int ifd, > > /* >* ROM bug alert > - * mx53 only loads 512 byte multiples. > - * The remaining fraction of a block bytes would > - * not be loaded. > + * > + * MX53 only loads 512 byte multiples in case of SD boot. > + * MX53 only loads NAND page multiples in case of NAND boot and > + * supports up to 4096 byte large pages, thus align to 4096. > + * > + * The remaining fraction of a block bytes would not be loaded! >*/ > - *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512); > + *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096); > } > > int imximage_check_params(struct mkimage_params *params) > diff --git a/tools/imximage.h b/tools/imximage.h > index 42b6090..dfd2e9e 100644 > --- a/tools/imximage.h > +++ b/tools/imximage.h > @@ -151,13 +151,14 @@ typedef struct { > dcd_v2_t dcd_table; > } imx_header_v2_t; > > +/* The header must be aligned to 4k on MX53 for NAND boot */ > struct imx_header { > union { > imx_header_v1_t hdr_v1; > imx_header_v2_t hdr_v2; > } header; > uint32_t flash_offset; > -}; > +} __attribute__((aligned(4096))); So what is the exact rule for the image start page in the FCB? Is it just 0x400 + 4096 + start page * page size? This does not seem to match table 7-12, unless 0 has a special meaning? > > typedef void (*set_dcd_val_t)(struct imx_header *imxhdr, > char *name, int lineno, > -- > 1.7.10.4 > > Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/4] mx5: Add NAND clock handling
Dear Marek Vasut, On Monday, February 25, 2013 7:19:56 PM, Marek Vasut wrote: > Augment the MX5 clock code with function to enable and configure > NFC clock. This is necessary to get NFC working on MX5. > > Signed-off-by: Marek Vasut > Cc: Benoît Thébaudeau > Cc: Fabio Estevam > Cc: Stefano Babic > --- > arch/arm/cpu/armv7/mx5/clock.c| 12 ++-- > arch/arm/include/asm/arch-mx5/clock.h |1 + > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c > index 76c2c52..f768fc9 100644 > --- a/arch/arm/cpu/armv7/mx5/clock.c > +++ b/arch/arm/cpu/armv7/mx5/clock.c > @@ -739,10 +739,11 @@ static int config_core_clk(u32 ref, u32 freq) > static int config_nfc_clk(u32 nfc_clk) > { > u32 parent_rate = get_emi_slow_clk(); > - u32 div = parent_rate / nfc_clk; > + u32 div; > > - if (nfc_clk <= 0) > + if (nfc_clk == 0) > return -EINVAL; > + div = parent_rate / nfc_clk; > if (div == 0) > div++; > if (parent_rate / div > NFC_CLK_MAX) > @@ -755,6 +756,13 @@ static int config_nfc_clk(u32 nfc_clk) > return 0; > } > > +void enable_nfc_clk(unsigned char enable) > +{ > + unsigned int cg = enable ? MXC_CCM_CCGR_CG_ON : MXC_CCM_CCGR_CG_OFF; > + > + clrsetbits_le32(&mxc_ccm->CCGR5, MXC_CCM_CCGR_CG_MASK << 20, cg << 20); Please use MXC_CCM_CCGR5_EMI_ENFC(MXC_CCM_CCGR_CG_MASK) and MXC_CCM_CCGR_CG_MASK(cg). > +} > + > /* Config main_bus_clock for periphs */ > static int config_periph_clk(u32 ref, u32 freq) > { > diff --git a/arch/arm/include/asm/arch-mx5/clock.h > b/arch/arm/include/asm/arch-mx5/clock.h > index 9cdfb48..6910192 100644 > --- a/arch/arm/include/asm/arch-mx5/clock.h > +++ b/arch/arm/include/asm/arch-mx5/clock.h > @@ -68,5 +68,6 @@ void set_usboh3_clk(void); > void enable_usboh3_clk(unsigned char enable); > void mxc_set_sata_internal_clock(void); > int enable_i2c_clk(unsigned char enable, unsigned i2c_num); > +void enable_nfc_clk(unsigned char enable); > > #endif /* __ASM_ARCH_CLOCK_H */ > -- > 1.7.10.4 > > Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/4] mx5: Add support for DENX M53EVK
Dear Marek Vasut, On Monday, February 25, 2013 7:24:07 PM, Marek Vasut wrote: > Add basic support for the DENX M53EVK board. Currently supported is > the MMC, Ethernet, I2C. > > Signed-off-by: Marek Vasut > Cc: Andreas Widder > Cc: Benoît Thébaudeau > Cc: Fabio Estevam > Cc: Stefano Babic > Cc: Wolfgang Denk > --- > board/denx/m53evk/Makefile | 40 > board/denx/m53evk/imximage.cfg | 108 +++ > board/denx/m53evk/m53evk.c | 404 > > boards.cfg |1 + > include/configs/m53evk.h | 226 ++ > 5 files changed, 779 insertions(+) > create mode 100644 board/denx/m53evk/Makefile > create mode 100644 board/denx/m53evk/imximage.cfg > create mode 100644 board/denx/m53evk/m53evk.c > create mode 100644 include/configs/m53evk.h > > diff --git a/board/denx/m53evk/Makefile b/board/denx/m53evk/Makefile > new file mode 100644 > index 000..bfb040a > --- /dev/null > +++ b/board/denx/m53evk/Makefile > @@ -0,0 +1,40 @@ > +# > +# DENX M53EVK > +# Copyright (C) 2012-2013 Marek Vasut > +# > +# This program is free software; you can redistribute it and/or > +# modify it under the terms of the GNU General Public License as > +# published by the Free Software Foundation; either version 2 of > +# the License, or (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, > +# MA 02111-1307 USA > +# > + > +include $(TOPDIR)/config.mk > + > +LIB = $(obj)lib$(BOARD).o > + > +COBJS:= m53evk.o > + > +SRCS := $(COBJS:.o=.c) > +OBJS := $(addprefix $(obj),$(COBJS)) > + > +$(LIB): $(obj).depend $(OBJS) > + $(call cmd_link_o_target, $(OBJS)) > + > +# > + > +# defines $(obj).depend target > +include $(SRCTREE)/rules.mk > + > +sinclude $(obj).depend > + > +# > diff --git a/board/denx/m53evk/imximage.cfg b/board/denx/m53evk/imximage.cfg > new file mode 100644 > index 000..3d60de0 > --- /dev/null > +++ b/board/denx/m53evk/imximage.cfg > @@ -0,0 +1,108 @@ > +/* > + * DENX M53 DRAM init values > + * Copyright (C) 2012-2013 Marek Vasut > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not write to the Free Software > + * Foundation Inc. 51 Franklin Street Fifth Floor Boston, > + * MA 02110-1301 USA > + * > + * Refer docs/README.imxmage for more details about how-to configure > + * and create imximage boot image > + * > + * The syntax is taken as close as possible with the kwbimage > + */ > +/* image version */ > +IMAGE_VERSION2 > + > +/* > + * Boot Device : one of > + * spi, sd, nand > + */ > +BOOT_FROMnand > + > +/* > + * Device Configuration Data (DCD) > + * > + * Each entry must have the format: > + * Addr-type AddressValue > + * > + * where: > + * Addr-type register length (1,2 or 4 bytes) > + * Address absolute address of the register > + * value value to be stored in the register > + */ > +DATA 4 0x53fa86f4 0x /* GRP_DDRMODE_CTL */ > +DATA 4 0x53fa8714 0x /* GRP_DDRMODE */ > +DATA 4 0x53fa86fc 0x /* GRP_DDRPKE */ > +DATA 4 0x53fa8724 0x0400 /* GRP_DDR_TYPE */ > + > +DATA 4 0x53fa872c 0x0030 /* GRP_B3DS */ > +DATA 4 0x53fa8554 0x0030 /* DRAM_DQM3 */ > +DATA 4 0x53fa8558 0x00300040 /* DRAM_SDQS3 */ > + > +DATA 4 0x53fa8728 0x0030 /* GRP_B2DS */ > +DATA 4 0x53fa8560 0x0030 /* DRAM_DQM2 */ > +DATA 4 0x53fa8568 0x00300040 /* DRAM_SDQS2 */ > + > +DATA 4 0x53fa871c 0x0030 /* GRP_B1DS */ > +DATA 4 0x53fa8594 0x0030 /* DRAM_DQM1 */ > +DATA 4 0x53fa8590 0x00300040 /* DRAM_SDQS1 */ > + > +DATA 4 0x53fa8718 0x0030 /* GRP_B0DS */ > +DATA 4 0x53fa8584 0x0030 /* DRAM_DQM0 */ > +DATA 4 0x53fa857c 0x00300040 /* DRAM_SDQS0 */ > + > +DATA 4 0x53fa8578 0x003000
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
On 02/25/2013 12:19:54 PM, Marek Vasut wrote: Implement u-boot.nand target that can be reused with a small amount of churn across all CPU models. The idea is to delegate the u-boot.nand target out of the main Makefile and into the CPU's Makefile (very similar to what u-boot.imx does now). The main Makefile shall only contain path to which the u-boot.nand target is delegated. Hopefully this will not produce too much bloat in the main Makefile. To demonstrate this implementation, add u-boot.nand target for i.MX53. Signed-off-by: Marek Vasut Cc: Benoît Thébaudeau Cc: Fabio Estevam Cc: Stefano Babic --- Makefile | 18 ++ arch/arm/imx-common/Makefile |6 ++ 2 files changed, 24 insertions(+) diff --git a/Makefile b/Makefile index 41054b7..8b1010a 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,23 @@ $(obj)u-boot.img: $(obj)u-boot.bin $(obj)u-boot.imx: $(obj)u-boot.bin depend $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx +# +# Generic u-boot.nand target. +# +# Every CPU that needs u-boot.nand must add a path to an implementation of +# the actual u-boot.nand generator below. +# +ifdef CONFIG_MX53 +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common +endif + +$(obj)u-boot.nand: $(obj)u-boot.bin depend + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then \ + echo "This CPU does not support u-boot.nand target!" ; \ + exit 1 ; \ + fi + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand We already have CONFIG_SPL_TARGET. Why do we need a new mechanism specific to NAND, with ifdefs in the main Makefile? If we do have something specific to NAND, it should be u-boot-nand.bin to match what nand_spl produced, and it should just be a generic rule that links to what CONFIG_SPL_TARGET produced, if the right CONFIG symbol is set by the board config to say that this is a NAND SPL. Or is someone going to say that they want to generate multiple different SPL images from the same build? :-P -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Benoît Thébaudeau, > Dear Marek Vasut, > > On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote: > > Implement u-boot.nand target that can be reused with a small amount of > > churn across all CPU models. The idea is to delegate the u-boot.nand > > target out of the main Makefile and into the CPU's Makefile (very > > similar to what u-boot.imx does now). The main Makefile shall only > > contain path to which the u-boot.nand target is delegated. Hopefully > > this will not produce too much bloat in the main Makefile. > > > > To demonstrate this implementation, add u-boot.nand target for i.MX53. > > > > Signed-off-by: Marek Vasut > > Cc: Benoît Thébaudeau > > Cc: Fabio Estevam > > Cc: Stefano Babic > > --- > > > > Makefile | 18 ++ > > arch/arm/imx-common/Makefile |6 ++ > > 2 files changed, 24 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index 41054b7..8b1010a 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -470,6 +470,23 @@ $(obj)u-boot.img: $(obj)u-boot.bin > > > > $(obj)u-boot.imx: $(obj)u-boot.bin depend > > > > $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx > > > > +# > > +# Generic u-boot.nand target. > > +# > > +# Every CPU that needs u-boot.nand must add a path to an implementation > > of +# the actual u-boot.nand generator below. > > +# > > +ifdef CONFIG_MX53 > > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common > > What about calling it rather CONFIG_NAND_TGT_PATH? TRG looks more like > trigger. > > > +endif > > + > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend > >^ > $(obj)u-boot.bin already depends on depend through $(obj)u-boot, so it's > useless here. > > > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then \ > > + echo "This CPU does not support u-boot.nand target!" ; \ > > + exit 1 ; \ > > + fi > > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand > >^ >$(OBJTREE)/ > > > + > > > > $(obj)u-boot.kwb: $(obj)u-boot.bin > > > > $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ > > -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > > > > @@ -857,6 +874,7 @@ clobber:tidy > > > > @rm -f $(obj)u-boot.kwb > > @rm -f $(obj)u-boot.pbl > > @rm -f $(obj)u-boot.imx > > > > + @rm -f $(obj)u-boot.nand > > > > @rm -f $(obj)u-boot.ubl > > @rm -f $(obj)u-boot.ais > > @rm -f $(obj)u-boot.dtb > > > > diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile > > index 5d5c5b2..71ea36f 100644 > > --- a/arch/arm/imx-common/Makefile > > +++ b/arch/arm/imx-common/Makefile > > @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin > > $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX > > > > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ > > -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > > > > +$(obj)u-boot.nand: $(obj)u-boot.imx > > + ( \ > > + echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ; \ > > + dd if=/dev/zero bs=1015 count=1 2>/dev/null ) | \ > > + cat - $< > $@ > > Is that all? That's all for now, that's how it boots and how others do it as well. In the long run though, I'd prefer to bend mxsboot to generate the DBBT. > According to 7.5.2.2 (i.MX53 RM), the boot ROM switches to > serial mode if anything goes wrong with the NAND. Hence, for reliable NAND > boot, you have to choose either DBBT or SPL (or both, but that would be > waste). > > Populating the DBBT would be complicated, so I'd go for SPL. You could just > use my u-boot-with-nand-spl.imx and change the dummy header to a true FCB > with the fingerprint like you did in your header above. u-boot.nand then > becomes useless. > > > + > > > > $(obj)SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst > > "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp > > > > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ > > -e $(CONFIG_SPL_TEXT_BASE) -d $< $@ > > Best regards, > Benoît Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Scott Wood, > On 02/25/2013 12:19:54 PM, Marek Vasut wrote: > > Implement u-boot.nand target that can be reused with a small amount of > > churn across all CPU models. The idea is to delegate the u-boot.nand > > target > > out of the main Makefile and into the CPU's Makefile (very similar to > > what > > u-boot.imx does now). The main Makefile shall only contain path to > > which the > > u-boot.nand target is delegated. Hopefully this will not produce too > > much > > bloat in the main Makefile. > > > > To demonstrate this implementation, add u-boot.nand target for i.MX53. > > > > Signed-off-by: Marek Vasut > > Cc: Benoît Thébaudeau > > Cc: Fabio Estevam > > Cc: Stefano Babic > > --- > > > > Makefile | 18 ++ > > arch/arm/imx-common/Makefile |6 ++ > > 2 files changed, 24 insertions(+) > > > > diff --git a/Makefile b/Makefile > > index 41054b7..8b1010a 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -470,6 +470,23 @@ $(obj)u-boot.img: $(obj)u-boot.bin > > > > $(obj)u-boot.imx: $(obj)u-boot.bin depend > > > > $(MAKE) -C $(SRCTREE)/arch/arm/imx-common > > > > $(obj)u-boot.imx > > > > +# > > +# Generic u-boot.nand target. > > +# > > +# Every CPU that needs u-boot.nand must add a path to an > > implementation of > > +# the actual u-boot.nand generator below. > > +# > > +ifdef CONFIG_MX53 > > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common > > +endif > > + > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend > > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; > > then\ > > + echo "This CPU does not support u-boot.nand > > target!" ; \ > > + exit 1 > > ; \ > > + fi > > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand > > We already have CONFIG_SPL_TARGET. Why do we need a new mechanism > specific to NAND, with ifdefs in the main Makefile? This board doesn't use SPL at all. > If we do have something specific to NAND, it should be u-boot-nand.bin > to match what nand_spl produced, and it should just be a generic rule > that links to what CONFIG_SPL_TARGET produced, if the right CONFIG > symbol is set by the board config to say that this is a NAND SPL. Or > is someone going to say that they want to generate multiple different > SPL images from the same build? :-P I'd like to generate a bootable NAND image on mx53 and on mx23/28, thus I need generic target. And I need it flexible enough, since on mx23/28 it munges u- boot.sb into the resulting image while on mx53 it munges u-boot.imx into the resulting image. > -Scott Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] imx: Align the imximage header and payload to multiples of 4k
Dear Benoît Thébaudeau, > On Monday, February 25, 2013 7:19:55 PM, Marek Vasut wrote: > > The MX53 ROM loads the data from NAND in multiples of pages and > > supports maximum page size of 4k. Thus, align the image and header > > to 4k to be safe from ROM bugs. > > > > Signed-off-by: Marek Vasut > > Cc: Benoît Thébaudeau > > Cc: Fabio Estevam > > Cc: Stefano Babic > > --- > > > > tools/imximage.c | 11 +++ > > tools/imximage.h |3 ++- > > 2 files changed, 9 insertions(+), 5 deletions(-) > > > > diff --git a/tools/imximage.c b/tools/imximage.c > > index fa308c9..c018562 100644 > > --- a/tools/imximage.c > > +++ b/tools/imximage.c > > @@ -518,11 +518,14 @@ static void imximage_set_header(void *ptr, struct > > stat *sbuf, int ifd, > > > > /* > > > > * ROM bug alert > > > > -* mx53 only loads 512 byte multiples. > > -* The remaining fraction of a block bytes would > > -* not be loaded. > > +* > > +* MX53 only loads 512 byte multiples in case of SD boot. > > +* MX53 only loads NAND page multiples in case of NAND boot and > > +* supports up to 4096 byte large pages, thus align to 4096. > > +* > > +* The remaining fraction of a block bytes would not be loaded! > > > > */ > > > > - *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512); > > + *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096); > > > > } > > > > int imximage_check_params(struct mkimage_params *params) > > > > diff --git a/tools/imximage.h b/tools/imximage.h > > index 42b6090..dfd2e9e 100644 > > --- a/tools/imximage.h > > +++ b/tools/imximage.h > > @@ -151,13 +151,14 @@ typedef struct { > > > > dcd_v2_t dcd_table; > > > > } imx_header_v2_t; > > > > +/* The header must be aligned to 4k on MX53 for NAND boot */ > > > > struct imx_header { > > > > union { > > > > imx_header_v1_t hdr_v1; > > imx_header_v2_t hdr_v2; > > > > } header; > > uint32_t flash_offset; > > > > -}; > > +} __attribute__((aligned(4096))); > > So what is the exact rule for the image start page in the FCB? Is it just > 0x400 + 4096 + start page * page size? This does not seem to match table > 7-12, unless 0 has a special meaning? I believe it's '0 == offset 4096 in NAND', do you happen to have board with 4k page NAND to verify this? > > typedef void (*set_dcd_val_t)(struct imx_header *imxhdr, > > > > char *name, int lineno, > > > > -- > > 1.7.10.4 > > Best regards, > Benoît Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Marek Vasut, On Monday, February 25, 2013 10:09:07 PM, Marek Vasut wrote: > Dear Benoît Thébaudeau, > > > Dear Marek Vasut, > > > > On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote: > > > Implement u-boot.nand target that can be reused with a small amount of > > > churn across all CPU models. The idea is to delegate the u-boot.nand > > > target out of the main Makefile and into the CPU's Makefile (very > > > similar to what u-boot.imx does now). The main Makefile shall only > > > contain path to which the u-boot.nand target is delegated. Hopefully > > > this will not produce too much bloat in the main Makefile. > > > > > > To demonstrate this implementation, add u-boot.nand target for i.MX53. > > > > > > Signed-off-by: Marek Vasut > > > Cc: Benoît Thébaudeau > > > Cc: Fabio Estevam > > > Cc: Stefano Babic > > > --- > > > > > > Makefile | 18 ++ > > > arch/arm/imx-common/Makefile |6 ++ > > > 2 files changed, 24 insertions(+) > > > > > > diff --git a/Makefile b/Makefile > > > index 41054b7..8b1010a 100644 > > > --- a/Makefile > > > +++ b/Makefile > > > @@ -470,6 +470,23 @@ $(obj)u-boot.img:$(obj)u-boot.bin > > > > > > $(obj)u-boot.imx: $(obj)u-boot.bin depend > > > > > > $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx > > > > > > +# > > > +# Generic u-boot.nand target. > > > +# > > > +# Every CPU that needs u-boot.nand must add a path to an implementation > > > of +# the actual u-boot.nand generator below. > > > +# > > > +ifdef CONFIG_MX53 > > > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common > > > > What about calling it rather CONFIG_NAND_TGT_PATH? TRG looks more like > > trigger. > > > > > +endif > > > + > > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend > > > >^ > > $(obj)u-boot.bin already depends on depend through $(obj)u-boot, so it's > > useless here. > > > > > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then > \ > > > + echo "This CPU does not support u-boot.nand target!" ; > \ > > > + exit 1 ; > \ > > > + fi > > > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand > > > >^ > >$(OBJTREE)/ > > > > > + > > > > > > $(obj)u-boot.kwb: $(obj)u-boot.bin > > > > > > $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ > > > -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > > > > > > @@ -857,6 +874,7 @@ clobber: tidy > > > > > > @rm -f $(obj)u-boot.kwb > > > @rm -f $(obj)u-boot.pbl > > > @rm -f $(obj)u-boot.imx > > > > > > + @rm -f $(obj)u-boot.nand > > > > > > @rm -f $(obj)u-boot.ubl > > > @rm -f $(obj)u-boot.ais > > > @rm -f $(obj)u-boot.dtb > > > > > > diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile > > > index 5d5c5b2..71ea36f 100644 > > > --- a/arch/arm/imx-common/Makefile > > > +++ b/arch/arm/imx-common/Makefile > > > @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin > > > $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX > > > > > > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ > > > -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ > > > > > > +$(obj)u-boot.nand: $(obj)u-boot.imx > > > + ( \ > > > + echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ; \ > > > + dd if=/dev/zero bs=1015 count=1 2>/dev/null ) | \ > > > + cat - $< > $@ > > > > Is that all? > > That's all for now, that's how it boots and how others do it as well. In the > long run though, I'd prefer to bend mxsboot to generate the DBBT. After a quick look at mxsboot, it seems to just generate an empty DBBT, so this does not help for boot reliability. > > According to 7.5.2.2 (i.MX53 RM), the boot ROM switches to > > serial mode if anything goes wrong with the NAND. Hence, for reliable NAND > > boot, you have to choose either DBBT or SPL (or both, but that would be > > waste). > > > > Populating the DBBT would be complicated, so I'd go for SPL. You could just > > use my u-boot-with-nand-spl.imx and change the dummy header to a true FCB > > with the fingerprint like you did in your header above. u-boot.nand then > > becomes useless. > > > > > + > > > > > > $(obj)SPL: $(OBJTREE)/spl/u-boot-spl.bin $(OBJTREE)/$(patsubst > > > "%",%,$(CONFIG_IMX_CONFIG)).cfgtmp > > > > > > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \ > > > -e $(CONFIG_SPL_TEXT_BASE) -d $< $@ Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] imx: Align the imximage header and payload to multiples of 4k
Dear Marek Vasut, On Monday, February 25, 2013 10:07:49 PM, Marek Vasut wrote: > Dear Benoît Thébaudeau, > > > On Monday, February 25, 2013 7:19:55 PM, Marek Vasut wrote: > > > The MX53 ROM loads the data from NAND in multiples of pages and > > > supports maximum page size of 4k. Thus, align the image and header > > > to 4k to be safe from ROM bugs. > > > > > > Signed-off-by: Marek Vasut > > > Cc: Benoît Thébaudeau > > > Cc: Fabio Estevam > > > Cc: Stefano Babic > > > --- > > > > > > tools/imximage.c | 11 +++ > > > tools/imximage.h |3 ++- > > > 2 files changed, 9 insertions(+), 5 deletions(-) > > > > > > diff --git a/tools/imximage.c b/tools/imximage.c > > > index fa308c9..c018562 100644 > > > --- a/tools/imximage.c > > > +++ b/tools/imximage.c > > > @@ -518,11 +518,14 @@ static void imximage_set_header(void *ptr, struct > > > stat *sbuf, int ifd, > > > > > > /* > > > > > >* ROM bug alert > > > > > > - * mx53 only loads 512 byte multiples. > > > - * The remaining fraction of a block bytes would > > > - * not be loaded. > > > + * > > > + * MX53 only loads 512 byte multiples in case of SD boot. > > > + * MX53 only loads NAND page multiples in case of NAND boot and > > > + * supports up to 4096 byte large pages, thus align to 4096. > > > + * > > > + * The remaining fraction of a block bytes would not be loaded! > > > > > >*/ > > > > > > - *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512); > > > + *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096); > > > > > > } > > > > > > int imximage_check_params(struct mkimage_params *params) > > > > > > diff --git a/tools/imximage.h b/tools/imximage.h > > > index 42b6090..dfd2e9e 100644 > > > --- a/tools/imximage.h > > > +++ b/tools/imximage.h > > > @@ -151,13 +151,14 @@ typedef struct { > > > > > > dcd_v2_t dcd_table; > > > > > > } imx_header_v2_t; > > > > > > +/* The header must be aligned to 4k on MX53 for NAND boot */ > > > > > > struct imx_header { > > > > > > union { > > > > > > imx_header_v1_t hdr_v1; > > > imx_header_v2_t hdr_v2; > > > > > > } header; > > > uint32_t flash_offset; > > > > > > -}; > > > +} __attribute__((aligned(4096))); > > > > So what is the exact rule for the image start page in the FCB? Is it just > > 0x400 + 4096 + start page * page size? This does not seem to match table > > 7-12, unless 0 has a special meaning? > > I believe it's '0 == offset 4096 in NAND', You set the i.MX header to a size of 4096, then you add the 1024-byte FCB, so we're already at 5120. > do you happen to have board with > 4k > page NAND to verify this? No. :( > > > typedef void (*set_dcd_val_t)(struct imx_header *imxhdr, > > > > > > char *name, int lineno, > > > > > > -- > > > 1.7.10.4 Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
On 02/25/2013 03:10:35 PM, Marek Vasut wrote: Dear Scott Wood, > On 02/25/2013 12:19:54 PM, Marek Vasut wrote: > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend > > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; > > then \ > > + echo "This CPU does not support u-boot.nand > > target!" ; \ > > + exit 1 > > ; \ > > + fi > > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand > > We already have CONFIG_SPL_TARGET. Why do we need a new mechanism > specific to NAND, with ifdefs in the main Makefile? This board doesn't use SPL at all. So maybe we need a more general (but optional) CONFIG_BUILD_TARGET. > If we do have something specific to NAND, it should be u-boot-nand.bin > to match what nand_spl produced, and it should just be a generic rule > that links to what CONFIG_SPL_TARGET produced, if the right CONFIG > symbol is set by the board config to say that this is a NAND SPL. Or > is someone going to say that they want to generate multiple different > SPL images from the same build? :-P I'd like to generate a bootable NAND image on mx53 and on mx23/28, From the same build, or just in general? thus I need generic target. And I need it flexible enough, since on mx23/28 it munges u- boot.sb into the resulting image while on mx53 it munges u-boot.imx into the resulting image. So each one would set the appropriate CONFIG_BUILD_TARGET for whatever needs to get built, and then something like CONFIG_NAND_IMAGE could hold the image name that should be linked to produce a standard u-boot-nand.bin output. -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCHv2 3/4] env_nand.c: clarify log messages when env reading fails
On 02/25/2013 03:39:12 AM, Phil Sutter wrote: Scott, On Fri, Feb 22, 2013 at 07:59:41PM -0600, Scott Wood wrote: > We should also give a message if one of the CRCs is bad, though that's > an existing problem. Yes, that would be nice. While writing this, I also had the idea of introducing some macros for unified message output, like so: | #define __print(level, ...) { | printf("*** %s - ", level); | printf(__VA_ARGS__); | printf("\n"); | } | #define perror(...) __print("Error", __VA_ARGS__) | #define pwarn(...) __print("Warning", __VA_ARGS__) | ... What do you think? That would require diligently touching a lot of source files, of course. This suggestion belongs in its own thread with an appropriate subject, but if we do anything like this we should use pr_warn(), pr_err(), etc. since we share a bunch of code with Linux -- although output from that code may be made worse since it's not expecting the prefixes... -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
Hi, On Mon, Feb 25, 2013 at 7:04 AM, Tom Rini wrote: > On Mon, Feb 25, 2013 at 12:24:37PM +, Adnan Ali wrote: > >> Introduces btrfs file-system to read file >> from volume/sub-volumes with btrload command. This >> implementation has read-only support. >> This btrfs implementation is based on syslinux btrfs >> code, commit 269ebc845ebc8b46ef4b0be7fa0005c7fdb95b8d. >> >> Signed-off-by: Adnan Ali > > A few things: > - In general in fs/btrfs/btrfs.c I see some coding style problems (lack > of spacing, non-printf's longer than 80-wide). Do these come from > syslinux and thus will make any re-syncs easier? > - It looks like you added support for CONFIG_CMD_FS_GENERIC, if so did > you test that? > - Can you please enable this support code on at least one platform, > preferably the one you've tested and developed with? > > [snip] >> diff --git a/fs/fs.c b/fs/fs.c > [snip] >> +//file handle is valid get the size of the file > > /* Style comments only */ > >> +len=filedata.size; > > And spacing between variable and assignment. > >> @@ -178,7 +248,6 @@ int fs_set_blk_dev(const char *ifname, const char >> *dev_part_str, int fstype) >> for (i = 0; i < ARRAY_SIZE(fstypes); i++) { >> if ((fstype != FS_TYPE_ANY) && (fstype != fstypes[i].fstype)) >> continue; >> - >> if (!fstypes[i].probe()) { >> fs_type = fstypes[i].fstype; >> return 0; > [snip] >> @@ -208,7 +280,6 @@ static void fs_close(void) >> int fs_ls(const char *dirname) >> { >> int ret; >> - >> switch (fs_type) { >> case FS_TYPE_FAT: >> ret = fs_ls_fat(dirname); > > Unrelated, please drop. > >> @@ -237,11 +311,13 @@ int fs_read(const char *filename, ulong addr, int >> offset, int len) >> case FS_TYPE_EXT: >> ret = fs_read_ext(filename, addr, offset, len); >> break; >> +case FS_TYPE_BTR: >> + ret = fs_read_btr(filename, addr, offset, len); >> + break; >> default: >> ret = fs_read_unsupported(filename, addr, offset, len); >> break; >> } >> - >> fs_close(); > > And unrelated whitespace changes here as well. > >> diff --git a/include/btrfs.h b/include/btrfs.h > [snip] >> +/* >> + * Extent structure: contains the mapping of some chunk of a file >> + * that is contiguous on disk. >> + */ >> +struct extent { >> +//sector_tpstart; /* Physical start sector */ >> +__le64 pstart; > > Fix please. > >> +/* >> + * Our definition of "not whitespace" >> + */ >> +static inline char not_whitespace(char c) >> +{ >> + return (unsigned char)c > ' '; >> +} > > Can't you just use isspace from ? > >> diff --git a/include/crc32c.h b/include/crc32c.h >> new file mode 100644 >> index 000..d04916e >> --- /dev/null >> +++ b/include/crc32c.h >> @@ -0,0 +1,48 @@ >> +/* >> + * Copied from Linux kernel crypto/crc32c.c >> + * Copyright (c) 2004 Cisco Systems, Inc. >> + * Copyright (c) 2008 Herbert Xu >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License as published by the >> Free >> + * Software Foundation; either version 2 of the License, or (at your option) >> + * any later version. >> + * >> + */ >> + >> +/* >> + * This is the CRC-32C table >> + * Generated with: >> + * width = 32 bits >> + * poly = 0x1EDC6F41 >> + * reflect input bytes = true >> + * reflect output bytes = true >> + */ >> + >> +/* >> + * Steps through buffer one byte at at time, calculates reflected >> + * crc using table. >> + */ >> + >> +static inline u32 crc32c_cal(u32 crc, const char *data, size_t length, u32 >> *crc32c_table) >> +{ >> + while (length--) >> + crc = crc32c_table[(u8)(crc ^ *data++)] ^ (crc >> 8); >> + >> + return crc; >> +} >> + >> +static inline void crc32c_init(u32 *crc32c_table, u32 pol) >> +{ >> + int i, j; >> + u32 v; >> + const u32 poly = pol; /* Bit-reflected CRC32C polynomial */ >> + >> + for (i = 0; i < 256; i++) { >> + v = i; >> + for (j = 0; j < 8; j++) { >> + v = (v >> 1) ^ ((v & 1) ? poly : 0); >> + } >> + crc32c_table[i] = v; >> + } >> +} > > Simon, since you've just been over all the crc32 recently, do we have > these functions somewhere already that can be easily tapped in to? > Thanks! Should be - see lib/crc32.c. There is already at least one other copy (ubifs I think) so we should try to avoid adding more. Maybe the polynomial is different here? But even so it should go with the existing code I think. Regards, Simon > > -- > Tom ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Scott Wood, > On 02/25/2013 03:10:35 PM, Marek Vasut wrote: > > Dear Scott Wood, > > > > > On 02/25/2013 12:19:54 PM, Marek Vasut wrote: > > > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend > > > > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; > > > > then\ > > > > + echo "This CPU does not support u-boot.nand > > > > target!" ; \ > > > > + exit 1 > > > > ; \ > > > > + fi > > > > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand > > > > > > We already have CONFIG_SPL_TARGET. Why do we need a new mechanism > > > specific to NAND, with ifdefs in the main Makefile? > > > > This board doesn't use SPL at all. > > So maybe we need a more general (but optional) CONFIG_BUILD_TARGET. Can you elaborate? > > > If we do have something specific to NAND, it should be > > > > u-boot-nand.bin > > > > > to match what nand_spl produced, and it should just be a generic > > > > rule > > > > > that links to what CONFIG_SPL_TARGET produced, if the right CONFIG > > > symbol is set by the board config to say that this is a NAND SPL. > > > > Or > > > > > is someone going to say that they want to generate multiple > > > > different > > > > > SPL images from the same build? :-P > > > > I'd like to generate a bootable NAND image on mx53 and on mx23/28, > > From the same build, or just in general? What do you mean by 'from the same build' ? From a build for the particular board running the SOC=mxs . > > thus I need generic target. And I need it flexible enough, since on > > mx23/28 it munges u- > > boot.sb into the resulting image while on mx53 it munges u-boot.imx > > into the > > resulting image. > > So each one would set the appropriate CONFIG_BUILD_TARGET for whatever > needs to get built, and then something like CONFIG_NAND_IMAGE could > hold the image name that should be linked to produce a standard > u-boot-nand.bin output. Yea, sounds reasonable. But why call it CONFIG_ , it can't be stored in the board.h files, it has to be somewhere in the Makefile hierarchy. > -Scott Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Introduced btrfs file-system with btrload command
Hi, On Mon, Feb 25, 2013 at 8:48 AM, Tom Rini wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 02/25/2013 11:44 AM, Adnan Ali wrote: >> On 25/02/13 16:29, Tom Rini wrote: > [snip] >> - It looks like you added support for >> CONFIG_CMD_FS_GENERIC, if so did you test that? > This command wasn't enabled in my configs. I haven't added > any command i.e btrls for this as this feature is not > supported yet. >> Can you then please? Thanks. >>> I have added support for this in my configs, build and flashed on >>> my mx53loco hardware it booted fine. When i type LS gives me ** >>> Unrecognized filesystem type **. which is what i have done it in >>> code. Any ls should print above message when its using btrfs. >> >> - Can you please enable this support code on at least one >> platform, preferably the one you've tested and developed >> with? > Even if do enable support for this, it will also debug > 'Unsupported filesystem type.' >> I don't understand. >>> I'm assuming that you are asking me to test it on atleast one >>> hardware platform with CONFIG_CMD_FS_GENERIC enabled. Which i >>> done it on mx53loco. If my assumption is wrong can you please >>> rephrase your question. > > OK. Can you please add btrfs support to CONFIG_CMD_FS_GENERIC? Or > try and point out that it's quite difficult / annoying / we need to > fix our interface? You'd be the first person other than the author of > the original changes to do so, so your feedback here would be quite > useful. Thanks! Actually please see my series starting here, which adds more support to that layer: http://patchwork.ozlabs.org/patch/208215/ Perhaps btrfs could fit in there too? Regards, Simon > > - -- > Tom > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQIcBAEBAgAGBQJRK5X2AAoJENk4IS6UOR1WFqAP/0DStonfADUwZTzyxwT22spZ > xGrJGUCVBBpiZ+xoO3ZRuKYG/DAkD3kYATV2DqgM/kqVuusHyiPeh4z1qcO78tWk > Quwce9sIU5uhMkQey0sCbIX5YHgxY0DbrcxpNLedQLKLo1NOZY3/uJUDRNt8uIeP > B3PH5uNXR8hVwwC0ML8dC8ZK7/XbPBZvdr0jjhYR8RzfHVxbpFKNL1vjxsN9TZiS > ZAp+DyIP389FPRQd2zt4bhzNHGuJ2TkwewEXi00MCO8vKkRKvuPZbV7hc0w9t+d7 > m1VbAzLL/FZ9ld8r3CvowgBg91vP/y8Vjr5bnX9CaZzaf96vPTVldx/UmZ9xtWtb > TzPxPaYkHXEmtdGfxfYI/v1CHu9rkjiDOrZMPbXNx2XzjYdwp5kk8Hlfqi+F8d+m > wFt+q2kHZdAEPDoIcvsi4buAbiqyehH03K0QpaH1UaEH01lVvw8S9U1p9/iLcSrV > c1kN4GMySKdPTIoTv97S4SpHUcijI1aMOaqc462M4YKroRg54iMMHCFkQBy0HF4U > n6B+yZv1Yy5IWf4Z5b143V8FN8yOSvfzG+gEMICc/NZU09nT6fwfPRfMWj2lIPj8 > wsDYpdL7amDAl2TUCLEB8vbue5ELjB2Bu2S25wKrsKrN9mPvh1LvFyHhO4HJ49Ly > +1SAb04CSBOhgXOzO+SZ > =pYZr > -END PGP SIGNATURE- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
On 02/25/2013 05:03:30 PM, Marek Vasut wrote: Dear Scott Wood, > So maybe we need a more general (but optional) CONFIG_BUILD_TARGET. Can you elaborate? Same as CONFIG_SPL_TARGET, but not SPL-specific. Basically a way for a board config file to add to $(ALL-y). > So each one would set the appropriate CONFIG_BUILD_TARGET for whatever > needs to get built, and then something like CONFIG_NAND_IMAGE could > hold the image name that should be linked to produce a standard > u-boot-nand.bin output. Yea, sounds reasonable. But why call it CONFIG_ , it can't be stored in the board.h files, it has to be somewhere in the Makefile hierarchy. Why can't it go in the board.h files? -Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Scott Wood, On Tuesday, February 26, 2013 12:07:25 AM, Scott Wood wrote: > On 02/25/2013 05:03:30 PM, Marek Vasut wrote: > > Dear Scott Wood, > > > > > So maybe we need a more general (but optional) CONFIG_BUILD_TARGET. > > > > Can you elaborate? > > Same as CONFIG_SPL_TARGET, but not SPL-specific. Basically a way for a > board config file to add to $(ALL-y). > > > > So each one would set the appropriate CONFIG_BUILD_TARGET for > > whatever > > > needs to get built, and then something like CONFIG_NAND_IMAGE could > > > hold the image name that should be linked to produce a standard > > > u-boot-nand.bin output. > > > > Yea, sounds reasonable. But why call it CONFIG_ , it can't be stored > > in the > > board.h files, it has to be somewhere in the Makefile hierarchy. > > Why can't it go in the board.h files? We could do all that, but should we? As I said to Marek, I think that it's a big mistake to omit the SPL here. The only other solution to get a reliable boot would be the DBBT, but it's very hard to use in real life, away from a production line. The SPL is really easy to enable here, and it's only a matter of time before someone gets bitten by this lack of reliability, so why not just do things right? The boot time and footprint of an SPL would really be negligible, and it's not because other implementations omit both SPL and a valid DBBT that U-Boot should do the same. Best regards, Benoît ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] patman: Add Cover-letter-cc tag to Cc cover letter to people
Simon, On Sat, Feb 23, 2013 at 8:15 PM, Simon Glass wrote: > The cover letter is sent to everyone who is on the Cc list for any of > the patches in the series. Sometimes it is useful to send just the cover > letter to additional people, so that they are aware of the series, but > don't need to wade through all the individual patches. > > Add a new Cover-letter-cc tag for this purpose. > > Signed-off-by: Simon Glass > --- > tools/patman/README | 12 +++- > tools/patman/patchstream.py | 8 > tools/patman/series.py | 11 --- > 3 files changed, 27 insertions(+), 4 deletions(-) Reviewed-by: Doug Anderson ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks
Adjust the sizes calculated for whole partition/chip operations by removing the size of bad blocks so we don't try to erase/read/write past a partition/chip boundary. Signed-off-by: Harvey Chapman --- common/cmd_nand.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 495610c..657ea23 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -428,6 +428,32 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count, return ret; } +static int adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev) { + /* We grab the nand info object here fresh because this is usually +* called after arg_off_size() which can change the value of dev. +*/ + nand_info_t *nand = &nand_info[dev]; + loff_t original_size = *size; + loff_t maxoffset = offset + *size; + int badblocks = 0; + + /* count badblocks in NAND from offset to offset + size */ + for (; offset < maxoffset; offset += nand->erasesize) + if (nand_block_isbad(nand, offset)) { + badblocks++; + } + /* adjust size if any bad blocks found */ + if (badblocks) { + *size -= badblocks * nand->erasesize; + printf("size adjusted to 0x%llx (%d bad blocks)\n", + (unsigned long long)*size, badblocks); + } + /* return size adjusted as a positive value so callers +* can use the return code to determine if anything happened +*/ + return (original_size - *size); +} + static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i, ret = 0; @@ -524,6 +550,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int scrub = !strncmp(cmd, "scrub", 5); int spread = 0; int args = 2; + int adjust_size = 0; const char *scrub_warn = "Warning: " "scrub option will erase all factory set bad blocks!\n" @@ -540,8 +567,10 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) spread = 1; } else if (!strcmp(&cmd[5], ".part")) { args = 1; + adjust_size = 1; } else if (!strcmp(&cmd[5], ".chip")) { args = 0; + adjust_size = 1; } else { goto usage; } @@ -560,6 +589,15 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0) return 1; + /* The size for erase.part and erase.chip has been calculated +* for us as the remainder of the chip/partition from offset. +* Adjust down for bad blocks, if necessary, so we don't +* erase past the end of the chip/partition by accident. +*/ + if (adjust_size && !scrub) { + adjust_size_for_badblocks(&size, off, dev); + } + nand = &nand_info[dev]; memset(&opts, 0, sizeof(opts)); @@ -644,6 +682,19 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) &off, &size) != 0) return 1; + /* If no size was given, it has been calculated for us as +* the remainder of the chip/partition from offset. Adjust +* down for bad blocks, if necessary, so we don't +* read/write past the end of the partition by accident. +* +* nand read addr part size "size" is arg 5 +*/ + if (argc < 5) { + /* Don't try to use rwsize here, it's not the +* right type +*/ + adjust_size_for_badblocks(&size, off, dev); + } rwsize = size; } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 0/2] Add Arndale board support
The Arndale board is based on samsung's exynos5250 SOC. First patch moves board specific options to board specific config file and the second patch adds the initial config and dts file for the arndale board. Changes in v2: - Added entry is MAINTAINERS - Added Chander's Acked-by Inderpal Singh (2): smdk5250: move board specific options to board specific config file Exynos5: Arndale: Add support for exynos5250 based arndale board. MAINTAINERS |4 ++ board/samsung/dts/exynos5250-arndale.dts | 36 ++ boards.cfg |1 + include/configs/arndale.h| 39 +++ include/configs/exynos5250-dt.h | 60 -- include/configs/smdk5250.h | 35 + 6 files changed, 115 insertions(+), 60 deletions(-) create mode 100644 board/samsung/dts/exynos5250-arndale.dts create mode 100644 include/configs/arndale.h -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/2] Exynos5: Arndale: Add support for exynos5250 based arndale board.
The Arndale board is based on samsung's exynos5250 SOC. This patch adds a initial config and dts file. Signed-off-by: Inderpal Singh Acked-by: Chander Kashyap --- This depends on the first 6 patches from Amar at [1] [1] http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/151523 MAINTAINERS |4 +++ board/samsung/dts/exynos5250-arndale.dts | 36 +++ boards.cfg |1 + include/configs/arndale.h| 39 ++ 4 files changed, 80 insertions(+) create mode 100644 board/samsung/dts/exynos5250-arndale.dts create mode 100644 include/configs/arndale.h diff --git a/MAINTAINERS b/MAINTAINERS index 45e2dd4..da0dd38 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -736,6 +736,10 @@ Chander Kashyap SMDKV310ARM ARMV7 (EXYNOS4210 SoC) SMDK5250ARM ARMV7 (EXYNOS5250 SoC) +Inderpal Singh + + arndale ARM ARMV7 (EXYNOS5250 SoC) + Lukasz Majewski trats ARM ARMV7 (EXYNOS4210 SoC) diff --git a/board/samsung/dts/exynos5250-arndale.dts b/board/samsung/dts/exynos5250-arndale.dts new file mode 100644 index 000..9b4d6b2 --- /dev/null +++ b/board/samsung/dts/exynos5250-arndale.dts @@ -0,0 +1,36 @@ +/* + * SAMSUNG Arndale board device tree source + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +/dts-v1/; +/include/ ARCH_CPU_DTS + +/ { + model = "SAMSUNG Arndale board based on EXYNOS5250"; + compatible = "samsung,arndale", "samsung,exynos5250"; + + mmc@1220 { + samsung,bus-width = <8>; + samsung,timing = <1 3 3>; + }; + + mmc@1221 { + status = "disabled"; + }; + + mmc@1222 { + samsung,bus-width = <4>; + samsung,timing = <1 2 3>; + }; + + mmc@1223 { + status = "disabled"; + }; +}; diff --git a/boards.cfg b/boards.cfg index b1319aa..2017ce0 100644 --- a/boards.cfg +++ b/boards.cfg @@ -287,6 +287,7 @@ smdkc100 arm armv7 smdkc100samsung origen arm armv7 origen samsungexynos s5pc210_universalarm armv7 universal_c210 samsungexynos smdk5250arm armv7 smdk5250 samsungexynos +arndale arm armv7 smdk5250 samsungexynos smdkv310arm armv7 smdkv310 samsungexynos tratsarm armv7 trats samsungexynos harmony arm armv7:arm720t harmony nvidia tegra20 diff --git a/include/configs/arndale.h b/include/configs/arndale.h new file mode 100644 index 000..c71370e --- /dev/null +++ b/include/configs/arndale.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 Samsung Electronics + * + * Configuration settings for the SAMSUNG Arndale board. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __CONFIG_ARNDALE_H +#define __CONFIG_ARNDALE_H + +#include + +#undef CONFIG_DEFAULT_DEVICE_TREE +#define CONFIG_DEFAULT_DEVICE_TREE exynos5250-arndale + +#define CONFIG_SERIAL2 +#define CONFIG_SYS_PROMPT "Arndale # " +#define CONFIG_IDENT_STRING" for Arndale" + +#define CONFIG_ENV_IS_IN_MMC + +#endif /* __CONFIG_ARNDALE_H */ -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/2] smdk5250: move board specific options to board specific config file
Signed-off-by: Inderpal Singh Acked-by: Chander Kashyap --- include/configs/exynos5250-dt.h | 60 --- include/configs/smdk5250.h | 35 +++ 2 files changed, 35 insertions(+), 60 deletions(-) diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h index 3fa86b2..d4a589c 100644 --- a/include/configs/exynos5250-dt.h +++ b/include/configs/exynos5250-dt.h @@ -73,7 +73,6 @@ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (4 << 20)) /* select serial console configuration */ -#define CONFIG_SERIAL3 /* use SERIAL 3 */ #define CONFIG_BAUDRATE115200 #define EXYNOS5_DEFAULT_UART_OFFSET0x01 @@ -139,7 +138,6 @@ /* Miscellaneous configurable options */ #define CONFIG_SYS_LONGHELP/* undef to save memory */ #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser*/ -#define CONFIG_SYS_PROMPT "SMDK5250 # " #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ #define CONFIG_SYS_PBSIZE 384 /* Print Buffer Size */ #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ @@ -179,7 +177,6 @@ /* FLASH and environment organization */ #define CONFIG_SYS_NO_FLASH #undef CONFIG_CMD_IMLS -#define CONFIG_IDENT_STRING" for SMDK5250" #define CONFIG_SYS_MMC_ENV_DEV 0 @@ -232,57 +229,10 @@ #define CONFIG_I2C_EDID /* PMIC */ -#define CONFIG_PMIC -#define CONFIG_PMIC_I2C -#define CONFIG_PMIC_MAX77686 - -/* SPI */ -#define CONFIG_ENV_IS_IN_SPI_FLASH -#define CONFIG_SPI_FLASH - -#ifdef CONFIG_SPI_FLASH -#define CONFIG_EXYNOS_SPI -#define CONFIG_CMD_SF -#define CONFIG_CMD_SPI -#define CONFIG_SPI_FLASH_WINBOND -#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 -#define CONFIG_SF_DEFAULT_SPEED5000 -#define EXYNOS5_SPI_NUM_CONTROLLERS5 -#endif - -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH -#define CONFIG_ENV_SPI_MODESPI_MODE_0 -#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE -#define CONFIG_ENV_SPI_BUS 1 -#define CONFIG_ENV_SPI_MAX_HZ 5000 -#endif - -/* PMIC */ #define CONFIG_POWER #define CONFIG_POWER_I2C #define CONFIG_POWER_MAX77686 -/* SPI */ -#define CONFIG_ENV_IS_IN_SPI_FLASH -#define CONFIG_SPI_FLASH - -#ifdef CONFIG_SPI_FLASH -#define CONFIG_EXYNOS_SPI -#define CONFIG_CMD_SF -#define CONFIG_CMD_SPI -#define CONFIG_SPI_FLASH_WINBOND -#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 -#define CONFIG_SF_DEFAULT_SPEED5000 -#define EXYNOS5_SPI_NUM_CONTROLLERS5 -#endif - -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH -#define CONFIG_ENV_SPI_MODESPI_MODE_0 -#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE -#define CONFIG_ENV_SPI_BUS 1 -#define CONFIG_ENV_SPI_MAX_HZ 5000 -#endif - /* Ethernet Controllor Driver */ #ifdef CONFIG_CMD_NET #define CONFIG_SMC911X @@ -314,14 +264,4 @@ #define CONFIG_SHA1 #define CONFIG_SHA256 -/* Display */ -#define CONFIG_LCD -#ifdef CONFIG_LCD -#define CONFIG_EXYNOS_FB -#define CONFIG_EXYNOS_DP -#define LCD_XRES 2560 -#define LCD_YRES 1600 -#define LCD_BPPLCD_COLOR16 -#endif - #endif /* __CONFIG_H */ diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h index 81f83a8..51c4215 100644 --- a/include/configs/smdk5250.h +++ b/include/configs/smdk5250.h @@ -30,4 +30,39 @@ #undef CONFIG_DEFAULT_DEVICE_TREE #define CONFIG_DEFAULT_DEVICE_TREE exynos5250-smdk5250 +#define CONFIG_SYS_PROMPT "SMDK5250 # " +#define CONFIG_SERIAL3 /* use SERIAL 3 */ +#define CONFIG_IDENT_STRING" for SMDK5250" + +/* SPI */ +#define CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_SPI_FLASH + +#ifdef CONFIG_SPI_FLASH +#define CONFIG_EXYNOS_SPI +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI +#define CONFIG_SPI_FLASH_WINBOND +#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 +#define CONFIG_SF_DEFAULT_SPEED5000 +#define EXYNOS5_SPI_NUM_CONTROLLERS5 +#endif + +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SPI_MODESPI_MODE_0 +#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE +#define CONFIG_ENV_SPI_BUS 1 +#define CONFIG_ENV_SPI_MAX_HZ 5000 +#endif + +/* Display */ +#define CONFIG_LCD +#ifdef CONFIG_LCD +#define CONFIG_EXYNOS_FB +#define CONFIG_EXYNOS_DP +#define LCD_XRES 2560 +#define LCD_YRES 1600 +#define LCD_BPPLCD_COLOR16 +#endif + #endif /* __CONFIG_SMDK_H */ -- 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] nand: adjust erase/read/write partition/chip size for bad blocks
[Slightly off-topic, but I can't find the answer with google] I changed the From: line in this patch e-mail to the address I use for this list rather than the address I committed with. Will this affect the author line once accepted upstream? That is, should I have left the From: address as it was created by format-patch? Thanks, Harvey On Feb 25, 2013, at 11:40 PM, Harvey Chapman wrote: > Adjust the sizes calculated for whole partition/chip operations by > removing the size of bad blocks so we don't try to erase/read/write > past a partition/chip boundary. > > Signed-off-by: Harvey Chapman > --- > common/cmd_nand.c | 51 +++ > 1 file changed, 51 insertions(+) > > diff --git a/common/cmd_nand.c b/common/cmd_nand.c > index 495610c..657ea23 100644 > --- a/common/cmd_nand.c > +++ b/common/cmd_nand.c > @@ -428,6 +428,32 @@ static int raw_access(nand_info_t *nand, ulong addr, > loff_t off, ulong count, > return ret; > } > > +static int adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev) { > + /* We grab the nand info object here fresh because this is usually > + * called after arg_off_size() which can change the value of dev. > + */ > + nand_info_t *nand = &nand_info[dev]; > + loff_t original_size = *size; > + loff_t maxoffset = offset + *size; > + int badblocks = 0; > + > + /* count badblocks in NAND from offset to offset + size */ > + for (; offset < maxoffset; offset += nand->erasesize) > + if (nand_block_isbad(nand, offset)) { > + badblocks++; > + } > + /* adjust size if any bad blocks found */ > + if (badblocks) { > + *size -= badblocks * nand->erasesize; > + printf("size adjusted to 0x%llx (%d bad blocks)\n", > +(unsigned long long)*size, badblocks); > + } > + /* return size adjusted as a positive value so callers > + * can use the return code to determine if anything happened > + */ > + return (original_size - *size); > +} > + > static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > { > int i, ret = 0; > @@ -524,6 +550,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > int scrub = !strncmp(cmd, "scrub", 5); > int spread = 0; > int args = 2; > + int adjust_size = 0; > const char *scrub_warn = > "Warning: " > "scrub option will erase all factory set bad blocks!\n" > @@ -540,8 +567,10 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > spread = 1; > } else if (!strcmp(&cmd[5], ".part")) { > args = 1; > + adjust_size = 1; > } else if (!strcmp(&cmd[5], ".chip")) { > args = 0; > + adjust_size = 1; > } else { > goto usage; > } > @@ -560,6 +589,15 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0) > return 1; > > + /* The size for erase.part and erase.chip has been calculated > + * for us as the remainder of the chip/partition from offset. > + * Adjust down for bad blocks, if necessary, so we don't > + * erase past the end of the chip/partition by accident. > + */ > + if (adjust_size && !scrub) { > + adjust_size_for_badblocks(&size, off, dev); > + } > + > nand = &nand_info[dev]; > > memset(&opts, 0, sizeof(opts)); > @@ -644,6 +682,19 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > &off, &size) != 0) > return 1; > > + /* If no size was given, it has been calculated for us > as > + * the remainder of the chip/partition from offset. > Adjust > + * down for bad blocks, if necessary, so we don't > + * read/write past the end of the partition by accident. > + * > + * nand read addr part size "size" is arg 5 > + */ > + if (argc < 5) { > + /* Don't try to use rwsize here, it's not the > + * right type > + */ > + adjust_size_for_badblocks(&size, off, dev); > + } > rwsize = size; > } > > -- > 1.7.10.4 > > _
Re: [U-Boot] [RFC PATCH v2 01/15] Implement autoconf header file
Hi Joe, On Sun, Feb 24, 2013 at 11:50 AM, Joe Hershberger wrote: > Hi Simon, > > On Sun, Feb 24, 2013 at 11:25 AM, Simon Glass wrote: >> Add support for generating an autoconf.h header file that can be used in >> the source instead of #ifdef. >> >> For example, instead of: >> >> #ifdef CONFIG_VERSION_VARIABLE >> setenv("ver", version_string); /* set version variable */ >> #endif >> >> you can do: >> >> if (autoconf_version_variable()) >> setenv("ver", version_string); /* set version variable */ > > You are changing the meaning between these two examples. The old code > was #ifDEF, which means the new example needs to be autoconf_HAS_*. > Is there a reason to muddy the waters by recommending people use this > automatic value of 0 instead of using the "has" function? Any more > than without this patch we should go change most all the #ifdef to > #if? > >> The compiler will ensure that the dead code is eliminated, so the result >> is the same. >> >> Where the value of the CONFIG define is 0, you can use the autoconf_has...() >> form. For example CONFIG_BOOTDELAY can be -ve, 0 or +ve, but if it is >> defined at all, it affects behaviour: >> >> #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) >> s = getenv ("bootdelay"); >> #endif >> >> So we use: >> >> if (autoconf_has_bootdelay() && autoconf_bootdelay() >= 0) >> s = getenv ("bootdelay"); >> >> This later form should only be used for such 'difficult' defines where a >> zero value still means that the CONFIG should be considered to be defined. >> >> Signed-off-by: Simon Glass >> --- >> Changes in v2: >> - Split out changes to main.c into separate patches >> - Fix up a few errors and comments in the original RFC >> - Use autoconf_...() instead of config_...() >> - Use autoconf_has_...() instead of config_..._enabled() >> - Add a grep to the sed/sort pipe to speed up processing >> >> Makefile | 42 - >> README| 87 >> +-- >> include/common.h | 3 ++ >> include/config_drop.h | 17 + >> tools/scripts/define2conf.sed | 37 ++ >> tools/scripts/define2list.sed | 31 +++ >> 6 files changed, 213 insertions(+), 4 deletions(-) >> create mode 100644 include/config_drop.h >> create mode 100644 tools/scripts/define2conf.sed >> create mode 100644 tools/scripts/define2list.sed >> >> diff --git a/Makefile b/Makefile >> index fc18dd4..9f4f55d 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -614,6 +614,7 @@ updater: >> # parallel sub-makes creating .depend files simultaneously. >> depend dep:$(TIMESTAMP_FILE) $(VERSION_FILE) \ >> $(obj)include/autoconf.mk \ >> + $(obj)include/generated/autoconf.h \ >> $(obj)include/generated/generic-asm-offsets.h \ >> $(obj)include/generated/asm-offsets.h >> for dir in $(SUBDIRS) $(CPUDIR) $(LDSCRIPT_MAKEFILE_DIR) ; >> do \ >> @@ -688,6 +689,44 @@ $(obj)include/autoconf.mk: $(obj)include/config.h >> sed -n -f tools/scripts/define2mk.sed > $@.tmp && \ >> mv $@.tmp $@ >> >> +# Create a C header file where every '#define CONFIG_XXX value' becomes >> +# '#define config_xxx() value', or '#define config_xxx() 0' where the CONFIG >> +# is not used by this board configuration. This allows C code to do things >> +# like 'if (config_xxx())' and have the compiler remove the dead code, >> +# instead of using '#ifdef CONFIG_XXX...#endif'. Note that in most cases >> +# if the config_...() returns 0 then the option is not enabled. In some rare >> +# cases such as CONFIG_BOOTDELAY, the config can be enabled but still have a >> +# a value of 0. So in addition we a #define config_xxx_enabled(), setting >> the > > You forgot to update this comment when changing to autoconf_has. Grep > perhaps? > >> +# value to 0 if the option is disabled, 1 if enabled. This last feature will >> +# hopefully be deprecated soon. >> +# The file is regenerated when any U-Boot header file changes. >> +$(obj)include/generated/autoconf.h: $(obj)include/config.h >> + @$(XECHO) Generating $@ ; \ >> + set -e ; \ >> + : Extract the config macros to a C header file ; \ >> + $(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \ >> + sed -n -f tools/scripts/define2conf.sed > $@.tmp; \ >> + : Regenerate our list of all config macros if neeed ; \ >> + if [ ! -f $@-all.tmp ] || \ >> + find $(src) -name '*.h' -type f -newer $@-all.tmp | \ >> + egrep -qv 'include/(autoconf.h|generated|config.h)'; >> \ >> + then \ >> + : Extract all config macros from all C header files ; \ >> + : We can grep for CONFIG since the value will be dropped ; \ >> + ( \ >> + find ${src} -name
Re: [U-Boot] [RFC PATCH v2 02/15] at91: Correct CONFIG_AUTOBOOT_PROMPT definition for pm9263
Hi Joe, On Sun, Feb 24, 2013 at 11:53 AM, Joe Hershberger wrote: > Hi Simon, > > On Sun, Feb 24, 2013 at 11:26 AM, Simon Glass wrote: >> This is not currently used, since autoboot is not enabled for this >> board, but the string is missing a parameter. Add it. >> > > Why not enable autoboot for this board so that this setting gets testing? Actually with autoconf this setting is tested, which is how I found the problem. The old code used #ifdef and so the problem was masked. Or do you think I should enable because that was probably the board vendor's indent? Regards, Simon > >> >> Signed-off-by: Simon Glass >> --- >> Changes in v2: None >> >> include/configs/pm9263.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/include/configs/pm9263.h b/include/configs/pm9263.h >> index b60a9ad..6f6ddfa 100644 >> --- a/include/configs/pm9263.h >> +++ b/include/configs/pm9263.h >> @@ -355,7 +355,7 @@ >> >> #define CONFIG_BOOTCOMMAND "run flashboot" >> #define CONFIG_ROOTPATH"/ronetix/rootfs" >> -#define CONFIG_AUTOBOOT_PROMPT "autoboot in %d seconds\n" >> +#define CONFIG_AUTOBOOT_PROMPT "autoboot in %d seconds\n", bootdelay >> >> #define CONFIG_CON_ROT "fbcon=rotate:3 " >> #define CONFIG_BOOTARGS"root=/dev/mtdblock4 >> rootfstype=jffs2 "\ >> -- >> 1.8.1.3 >> >> ___ >> U-Boot mailing list >> U-Boot@lists.denx.de >> http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v2 04/15] main: Separate out the two abortboot() functions
Hi Joe, On Sun, Feb 24, 2013 at 12:13 PM, Joe Hershberger wrote: > Hi Simon, > > On Sun, Feb 24, 2013 at 11:26 AM, Simon Glass wrote: >> There are two implementations of autoboot(). Turn these into two separate >> functions, and create a single autoboot() which calls either one or the >> other. >> >> Also it seems that nothing uses autoboot() outside main, so make it static. > > You say "autoboot" in this change log, but I think you mean to say > "abortboot". Yes, will fix, thanks. > >> >> Signed-off-by: Simon Glass >> --- >> Changes in v2: None >> >> common/main.c| 22 ++ >> include/common.h | 3 --- >> 2 files changed, 10 insertions(+), 15 deletions(-) >> >> diff --git a/common/main.c b/common/main.c >> index 2b8af2c..1e12e55 100644 >> --- a/common/main.c >> +++ b/common/main.c >> @@ -92,11 +92,7 @@ extern void mdm_init(void); /* defined in board.c */ >> * returns: 0 - no key string, allow autoboot 1 - got key string, abort >> */ >> #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) >> -# if defined(CONFIG_AUTOBOOT_KEYED) >> -#ifndef CONFIG_MENU >> -static inline >> -#endif >> -int abortboot(int bootdelay) >> +static int abortboot_keyed(int bootdelay) >> { >> int abort = 0; >> uint64_t etime = endtick(bootdelay); >> @@ -209,16 +205,11 @@ int abortboot(int bootdelay) >> return abort; >> } >> >> -# else /* !defined(CONFIG_AUTOBOOT_KEYED) */ >> - >> #ifdef CONFIG_MENUKEY >> static int menukey = 0; >> #endif >> >> -#ifndef CONFIG_MENU >> -static inline >> -#endif >> -int abortboot(int bootdelay) >> +static int abortboot_normal(int bootdelay) >> { >> int abort = 0; >> unsigned long ts; >> @@ -274,7 +265,14 @@ int abortboot(int bootdelay) >> >> return abort; >> } >> -# endif/* CONFIG_AUTOBOOT_KEYED */ >> + >> +static int abortboot(int bootdelay) >> +{ >> + if (autoconf_autoboot_keyed()) >> + return abortboot_keyed(bootdelay); >> + else >> + return abortboot_normal(bootdelay); >> +} >> #endif /* CONFIG_BOOTDELAY >= 0 */ >> >> /* >> diff --git a/include/common.h b/include/common.h >> index 491783b..fb219fd 100644 >> --- a/include/common.h >> +++ b/include/common.h >> @@ -297,9 +297,6 @@ int readline_into_buffer(const char *const prompt, char >> *buffer, >> intparse_line (char *, char *[]); >> void init_cmd_timeout(void); >> void reset_cmd_timeout(void); >> -#ifdef CONFIG_MENU >> -intabortboot(int bootdelay); >> -#endif > > Is CONFIG_MENU gone at this point? Does it no longer reference abortboot()? Well it isn't needed in this file. In fact it seems since commit 8594753b this code is not needed any more. > >> extern char console_buffer[]; >> >> /* arch/$(ARCH)/lib/board.c */ >> -- >> 1.8.1.3 >> >> ___ >> U-Boot mailing list >> U-Boot@lists.denx.de >> http://lists.denx.de/mailman/listinfo/u-boot > > > Reviewed-by: Joe Hershberger Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks
On Feb 26, 2013, at 12:22 AM, Harvey Chapman wrote: > [Slightly off-topic, but I can't find the answer with google] > I changed the From: line in this patch e-mail to the address I use for this > list rather than the address I committed with. Will this affect the author > line once accepted upstream? That is, should I have left the From: address as > it was created by format-patch? I got an answer via StackOverflow. Re-submitting the patch as a reply (hopefully). ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks
From: Harvey Chapman Adjust the sizes calculated for whole partition/chip operations by removing the size of bad blocks so we don't try to erase/read/write past a partition/chip boundary. Signed-off-by: Harvey Chapman --- common/cmd_nand.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 495610c..657ea23 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -428,6 +428,32 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count, return ret; } +static int adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev) { + /* We grab the nand info object here fresh because this is usually +* called after arg_off_size() which can change the value of dev. +*/ + nand_info_t *nand = &nand_info[dev]; + loff_t original_size = *size; + loff_t maxoffset = offset + *size; + int badblocks = 0; + + /* count badblocks in NAND from offset to offset + size */ + for (; offset < maxoffset; offset += nand->erasesize) + if (nand_block_isbad(nand, offset)) { + badblocks++; + } + /* adjust size if any bad blocks found */ + if (badblocks) { + *size -= badblocks * nand->erasesize; + printf("size adjusted to 0x%llx (%d bad blocks)\n", + (unsigned long long)*size, badblocks); + } + /* return size adjusted as a positive value so callers +* can use the return code to determine if anything happened +*/ + return (original_size - *size); +} + static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i, ret = 0; @@ -524,6 +550,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int scrub = !strncmp(cmd, "scrub", 5); int spread = 0; int args = 2; + int adjust_size = 0; const char *scrub_warn = "Warning: " "scrub option will erase all factory set bad blocks!\n" @@ -540,8 +567,10 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) spread = 1; } else if (!strcmp(&cmd[5], ".part")) { args = 1; + adjust_size = 1; } else if (!strcmp(&cmd[5], ".chip")) { args = 0; + adjust_size = 1; } else { goto usage; } @@ -560,6 +589,15 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0) return 1; + /* The size for erase.part and erase.chip has been calculated +* for us as the remainder of the chip/partition from offset. +* Adjust down for bad blocks, if necessary, so we don't +* erase past the end of the chip/partition by accident. +*/ + if (adjust_size && !scrub) { + adjust_size_for_badblocks(&size, off, dev); + } + nand = &nand_info[dev]; memset(&opts, 0, sizeof(opts)); @@ -644,6 +682,19 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) &off, &size) != 0) return 1; + /* If no size was given, it has been calculated for us as +* the remainder of the chip/partition from offset. Adjust +* down for bad blocks, if necessary, so we don't +* read/write past the end of the partition by accident. +* +* nand read addr part size "size" is arg 5 +*/ + if (argc < 5) { + /* Don't try to use rwsize here, it's not the +* right type +*/ + adjust_size_for_badblocks(&size, off, dev); + } rwsize = size; } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v2 09/15] main: Use autoconf for boot_delay code
Hi Joe, On Sun, Feb 24, 2013 at 12:40 PM, Joe Hershberger wrote: > Hi Simon, > > On Sun, Feb 24, 2013 at 11:26 AM, Simon Glass wrote: >> Convert this function and its children to use autoconf instead of #ifdef. >> >> Some header files must now be included unconditionally, so remove some of >> the #ifdefs from the header section, and put these header files into the >> right order. >> >> Signed-off-by: Simon Glass >> --- >> Changes in v2: None >> >> common/main.c | 104 >> +++-- >> include/menu.h | 2 -- >> 2 files changed, 41 insertions(+), 65 deletions(-) >> >> diff --git a/common/main.c b/common/main.c >> index 4f11e58..a5d3f82 100644 >> --- a/common/main.c >> +++ b/common/main.c [snip] >> @@ -258,7 +248,6 @@ static int abortboot(int bootdelay) >> * printing the error message to console. >> */ >> >> -#ifdef CONFIG_OF_CONTROL >> static void secure_boot_cmd(char *cmd) >> { >> cmd_tbl_t *cmdtp; >> @@ -311,93 +300,82 @@ static void process_fdt_options(const void *blob) >> (void *)(autoconf_sys_text_base() + addr)); >> } >> } >> -#endif /* CONFIG_OF_CONTROL */ >> >> static void process_boot_delay(void) >> { >> -#ifdef CONFIG_BOOTCOUNT_LIMIT >> unsigned long bootcount = 0; >> unsigned long bootlimit = 0; >> -#endif /* CONFIG_BOOTCOUNT_LIMIT */ >> -#ifdef CONFIG_OF_CONTROL >> - char *env; >> -#endif >> - char *s; >> + const char *s; >> int bootdelay; >> >> -#ifdef CONFIG_BOOTCOUNT_LIMIT >> - bootcount = bootcount_load(); >> - bootcount++; >> - bootcount_store (bootcount); >> - setenv_ulong("bootcount", bootcount); >> - bootlimit = getenv_ulong("bootlimit", 10, 0); >> -#endif /* CONFIG_BOOTCOUNT_LIMIT */ >> + if (autoconf_bootcount_limit()) { >> + bootcount = bootcount_load(); >> + bootcount++; >> + bootcount_store(bootcount); >> + setenv_ulong("bootcount", bootcount); >> + bootlimit = getenv_ulong("bootlimit", 10, 0); >> + } >> >> s = getenv ("bootdelay"); >> bootdelay = s ? (int)simple_strtol(s, NULL, 10) : >> autoconf_bootdelay(); > > This would look a lot nicer as: >bootdelay = getenv_ulong_def("bootdelay", autoconf_bootdelay()); Yes of course, thank you. [snip] Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] Exynos5: Arndale: Add support for exynos5250 based arndale board.
Dear Wolfgang Denk, On 19 February 2013 12:13, Wolfgang Denk wrote: > Dear Inderpal Singh, > > In message <1360841461-18028-3-git-send-email-inderpal.si...@linaro.org> you > wrote: >> The Arndale board is based on samsung's exynos5250 SOC. >> This patch adds a initial config and dts file. >> >> Signed-off-by: Inderpal Singh >> --- >> This depends on the first 6 patches from Amar at [1] >> >> [1] http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/151523 >> >> >> board/samsung/dts/exynos5250-arndale.dts | 36 +++ >> boards.cfg |1 + >> include/configs/arndale.h| 39 >> ++ >> 3 files changed, 76 insertions(+) >> create mode 100644 board/samsung/dts/exynos5250-arndale.dts >> create mode 100644 include/configs/arndale.h > > Entry to MAINTAINERS missing. Thanks for pointing out. I have sent v2 updating the MAINTAINERS file. Regards, Inder > > 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 > "A witty saying proves nothing." - Voltaire ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks
Adjust the sizes calculated for whole partition/chip operations by removing the size of bad blocks so we don't try to erase/read/write past a partition/chip boundary. Signed-off-by: Harvey Chapman --- common/cmd_nand.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 495610c..657ea23 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -428,6 +428,32 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count, return ret; } +static int adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev) { + /* We grab the nand info object here fresh because this is usually +* called after arg_off_size() which can change the value of dev. +*/ + nand_info_t *nand = &nand_info[dev]; + loff_t original_size = *size; + loff_t maxoffset = offset + *size; + int badblocks = 0; + + /* count badblocks in NAND from offset to offset + size */ + for (; offset < maxoffset; offset += nand->erasesize) + if (nand_block_isbad(nand, offset)) { + badblocks++; + } + /* adjust size if any bad blocks found */ + if (badblocks) { + *size -= badblocks * nand->erasesize; + printf("size adjusted to 0x%llx (%d bad blocks)\n", + (unsigned long long)*size, badblocks); + } + /* return size adjusted as a positive value so callers +* can use the return code to determine if anything happened +*/ + return (original_size - *size); +} + static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { int i, ret = 0; @@ -524,6 +550,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int scrub = !strncmp(cmd, "scrub", 5); int spread = 0; int args = 2; + int adjust_size = 0; const char *scrub_warn = "Warning: " "scrub option will erase all factory set bad blocks!\n" @@ -540,8 +567,10 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) spread = 1; } else if (!strcmp(&cmd[5], ".part")) { args = 1; + adjust_size = 1; } else if (!strcmp(&cmd[5], ".chip")) { args = 0; + adjust_size = 1; } else { goto usage; } @@ -560,6 +589,15 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0) return 1; + /* The size for erase.part and erase.chip has been calculated +* for us as the remainder of the chip/partition from offset. +* Adjust down for bad blocks, if necessary, so we don't +* erase past the end of the chip/partition by accident. +*/ + if (adjust_size && !scrub) { + adjust_size_for_badblocks(&size, off, dev); + } + nand = &nand_info[dev]; memset(&opts, 0, sizeof(opts)); @@ -644,6 +682,19 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) &off, &size) != 0) return 1; + /* If no size was given, it has been calculated for us as +* the remainder of the chip/partition from offset. Adjust +* down for bad blocks, if necessary, so we don't +* read/write past the end of the partition by accident. +* +* nand read addr part size "size" is arg 5 +*/ + if (argc < 5) { + /* Don't try to use rwsize here, it's not the +* right type +*/ + adjust_size_for_badblocks(&size, off, dev); + } rwsize = size; } -- 1.7.10.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks
Sorry for all of the e-mails while I fumble with git send-email. On Feb 26, 2013, at 12:43 AM, Harvey Chapman wrote: > Adjust the sizes calculated for whole partition/chip operations by > removing the size of bad blocks so we don't try to erase/read/write > past a partition/chip boundary. > > Signed-off-by: Harvey Chapman > --- > common/cmd_nand.c | 51 +++ > 1 file changed, 51 insertions(+) > > diff --git a/common/cmd_nand.c b/common/cmd_nand.c > index 495610c..657ea23 100644 > --- a/common/cmd_nand.c > +++ b/common/cmd_nand.c > @@ -428,6 +428,32 @@ static int raw_access(nand_info_t *nand, ulong addr, > loff_t off, ulong count, > return ret; > } > > +static int adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev) { > + /* We grab the nand info object here fresh because this is usually > + * called after arg_off_size() which can change the value of dev. > + */ > + nand_info_t *nand = &nand_info[dev]; > + loff_t original_size = *size; > + loff_t maxoffset = offset + *size; > + int badblocks = 0; > + > + /* count badblocks in NAND from offset to offset + size */ > + for (; offset < maxoffset; offset += nand->erasesize) > + if (nand_block_isbad(nand, offset)) { > + badblocks++; > + } > + /* adjust size if any bad blocks found */ > + if (badblocks) { > + *size -= badblocks * nand->erasesize; > + printf("size adjusted to 0x%llx (%d bad blocks)\n", > +(unsigned long long)*size, badblocks); > + } > + /* return size adjusted as a positive value so callers > + * can use the return code to determine if anything happened > + */ > + return (original_size - *size); > +} > + > static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > { > int i, ret = 0; > @@ -524,6 +550,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > int scrub = !strncmp(cmd, "scrub", 5); > int spread = 0; > int args = 2; > + int adjust_size = 0; > const char *scrub_warn = > "Warning: " > "scrub option will erase all factory set bad blocks!\n" > @@ -540,8 +567,10 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > spread = 1; > } else if (!strcmp(&cmd[5], ".part")) { > args = 1; > + adjust_size = 1; > } else if (!strcmp(&cmd[5], ".chip")) { > args = 0; > + adjust_size = 1; > } else { > goto usage; > } > @@ -560,6 +589,15 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > if (arg_off_size(argc - o, argv + o, &dev, &off, &size) != 0) > return 1; > > + /* The size for erase.part and erase.chip has been calculated > + * for us as the remainder of the chip/partition from offset. > + * Adjust down for bad blocks, if necessary, so we don't > + * erase past the end of the chip/partition by accident. > + */ > + if (adjust_size && !scrub) { > + adjust_size_for_badblocks(&size, off, dev); > + } > + > nand = &nand_info[dev]; > > memset(&opts, 0, sizeof(opts)); > @@ -644,6 +682,19 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > &off, &size) != 0) > return 1; > > + /* If no size was given, it has been calculated for us > as > + * the remainder of the chip/partition from offset. > Adjust > + * down for bad blocks, if necessary, so we don't > + * read/write past the end of the partition by accident. > + * > + * nand read addr part size "size" is arg 5 > + */ > + if (argc < 5) { > + /* Don't try to use rwsize here, it's not the > + * right type > + */ > + adjust_size_for_badblocks(&size, off, dev); > + } > rwsize = size; > } > > -- > 1.7.10.4 > > ___ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH v2 11/15] main: Use autoconf in command line reading
Hi Joe, On Sun, Feb 24, 2013 at 12:56 PM, Joe Hershberger wrote: > Hi Simon, > > On Sun, Feb 24, 2013 at 11:26 AM, Simon Glass wrote: >> Remove #ifdefs in favour of autoconf for this code. This involves removing >> a few unnecessary #ifdefs in headers also. >> >> We have two versions of the code - one that handles command line editing and >> one that is just a simple implementation. Create a new function called >> readline_into_buffer() which calls either cread_line() or the new >> simple_readline(), created to hold the 'simple' code. >> >> The cread_print_hist_list() function is not actually used anywhere, so punt >> it. >> >> Signed-off-by: Simon Glass >> --- >> Changes in v2: None >> >> common/main.c | 186 >> -- >> include/command.h | 2 - >> include/common.h | 2 - >> 3 files changed, 84 insertions(+), 106 deletions(-) >> >> diff --git a/common/main.c b/common/main.c >> index e1483db..3966321 100644 >> --- a/common/main.c >> +++ b/common/main.c [snip] > > It would be great if you separated the following unrelated formatting > changes into a separate patch. OK, will do. > >> /* >> * Special character handling >> */ >> switch (c) { >> - case '\r': /* Enter >>*/ >> + case '\r': /* Enter*/ >> case '\n': >> *p = '\0'; >> puts ("\r\n"); >> - return (p - p_buf); >> + return p - p_buf; >> >> - case '\0': /* nul >>*/ >> + case '\0': /* nul */ >> continue; >> >> - case 0x03: /* ^C - break >>*/ >> + case 0x03: /* ^C - break */ >> p_buf[0] = '\0';/* discard input */ >> - return (-1); >> + return -1; >> >> - case 0x15: /* ^U - erase line >>*/ >> + case 0x15: /* ^U - erase line */ >> while (col > plen) { >> puts (erase_seq); >> --col; >> @@ -1045,15 +988,15 @@ int readline_into_buffer(const char *const prompt, >> char *buffer, int timeout) >> n = 0; >> continue; >> >> - case 0x17: /* ^W - erase word >>*/ >> + case 0x17: /* ^W - erase word */ >> p=delete_char(p_buf, p, &col, &n, plen); >> while ((n > 0) && (*p != ' ')) { >> p=delete_char(p_buf, p, &col, &n, plen); >> } >> continue; >> >> - case 0x08: /* ^H - backspace >>*/ >> - case 0x7F: /* DEL - backspace >>*/ >> + case 0x08: /* ^H - backspace */ >> + case 0x7F: /* DEL - backspace */ >> p=delete_char(p_buf, p, &col, &n, plen); >> continue; >> >> @@ -1062,22 +1005,28 @@ int readline_into_buffer(const char *const prompt, >> char *buffer, int timeout) >> * Must be a normal character then >> */ >> if (n < CONFIG_SYS_CBSIZE-2) { >> - if (c == '\t') {/* expand TABs >>*/ >> -#ifdef CONFIG_AUTO_COMPLETE >> - /* if auto completion triggered just >> continue */ >> - *p = '\0'; >> - if (cmd_auto_complete(prompt, >> console_buffer, &n, &col)) { >> - p = p_buf + n; /* reset */ >> - continue; >> + if (c == '\t') {/* expand TABs */ >> + if (autoconf_auto_complete()) { >> + /* >> +* if auto completion >> triggered >> +* just continue >> +*/ >> + *p = '\0'; >> + if (cmd_auto_complete(prompt, >> + >> console_buffer, >> +
Re: [U-Boot] [RFC PATCH v2 12/15] main: Use autoconf in main_loop()
Hi Joe, On Sun, Feb 24, 2013 at 1:33 PM, Joe Hershberger wrote: > Hi Simon, > > On Sun, Feb 24, 2013 at 11:26 AM, Simon Glass wrote: >> Convert main_loop() over to use autoconf, and add a required prototype >> to common.h. >> >> The do_mdm_init variable is now always defined, but this seems like an >> acceptable compromise. >> >> In fdt_support.h the #ifdef used is CONFIG_OF_LIBFDT. However, even if >> this is not defined we want to make the functions available for our >> conditional-compilation scheme. The only place where we really don't >> have access to these support functions is when USE_HOSTCC is defined. >> So change the #ifdef to that. >> >> Signed-off-by: Simon Glass >> --- >> Changes in v2: None >> >> common/main.c | 77 >> +++ >> include/common.h | 1 + >> include/fdt_support.h | 4 +-- >> 3 files changed, 37 insertions(+), 45 deletions(-) >> >> diff --git a/common/main.c b/common/main.c >> index 3966321..40a79b7 100644 >> --- a/common/main.c >> +++ b/common/main.c >> @@ -63,10 +63,7 @@ static int retry_time = -1; /* -1 so can call >> readline before main_loop */ >> >> #defineendtick(seconds) (get_ticks() + (uint64_t)(seconds) * >> get_tbclk()) >> >> -#ifdef CONFIG_MODEM_SUPPORT >> int do_mdm_init = 0; >> -extern void mdm_init(void); /* defined in board.c */ >> -#endif >> >> /*** >> * Watch for 'delay' seconds for autoboot stop or autoboot delay string. >> @@ -383,51 +380,47 @@ void main_loop(void) >> int len; >> int rc = 1; >> int flag; >> -#ifdef CONFIG_PREBOOT >> - char *p; >> -#endif >> >> bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop"); >> >> -#ifdef CONFIG_MODEM_SUPPORT >> - debug("DEBUG: main_loop: do_mdm_init=%d\n", do_mdm_init); >> - if (do_mdm_init) { >> - char *str = strdup(getenv("mdm_cmd")); >> - setenv("preboot", str); /* set or delete definition */ >> - if (str != NULL) >> - free(str); >> - mdm_init(); /* wait for modem connection */ >> + if (autoconf_modem_support()) { > > Why not just remove do_mdm_init and use gd->do_mdm_init here? Would that be valid? There is board code to set that - I am not sure what the intent is but it seems beyond the scope of this patch to change it. > >> + debug("DEBUG: main_loop: do_mdm_init=%d\n", do_mdm_init); >> + if (do_mdm_init) { >> + char *str = strdup(getenv("mdm_cmd")); >> + >> + setenv("preboot", str); /* set or delete definition >> */ >> + if (str != NULL) >> + free(str); >> + mdm_init(); /* wait for modem connection */ >> + } >> } >> -#endif /* CONFIG_MODEM_SUPPORT */ >> >> -#ifdef CONFIG_VERSION_VARIABLE >> - { >> + if (autoconf_version_variable()) >> setenv("ver", version_string); /* set version variable */ >> - } >> -#endif /* CONFIG_VERSION_VARIABLE */ >> >> -#ifdef CONFIG_SYS_HUSH_PARSER >> - u_boot_hush_start(); >> -#endif >> + if (autoconf_sys_hush_parser()) >> + u_boot_hush_start(); >> >> -#if defined(CONFIG_HUSH_INIT_VAR) >> - hush_init_var(); >> -#endif >> + if (autoconf_hush_init_var()) >> + hush_init_var(); >> + >> + if (autoconf_preboot()) { >> + char *p = getenv("preboot"); >> + >> + if (p) { >> + int prev; >> >> -#ifdef CONFIG_PREBOOT >> - p = getenv("preboot"); >> - if (p) { >> -# ifdef CONFIG_AUTOBOOT_KEYED >> - int prev = disable_ctrlc(1);/* disable Control C >> checking */ >> -# endif >> + /* disable Control C checking */ >> + if (autoconf_autoboot_keyed()) >> + prev = disable_ctrlc(1); >> >> - run_command_list(p, -1, 0); >> + run_command_list(p, -1, 0); >> >> -# ifdef CONFIG_AUTOBOOT_KEYED >> - disable_ctrlc(prev);/* restore Control C checking */ >> -# endif >> + /* restore Control C checking */ >> + if (autoconf_autoboot_keyed()) >> + disable_ctrlc(prev); >> + } >> } >> -#endif /* CONFIG_PREBOOT */ >> >> if (autoconf_update_tftp()) >> update_tftp(0UL); >> @@ -435,9 +428,8 @@ void main_loop(void) >> if (autoconf_has_bootdelay() && autoconf_bootdelay() >= 0) >> process_boot_delay(); >> >> -#if defined CONFIG_OF_CONTROL >> - set_working_fdt_addr((void *)gd->fdt_blob); >> -#endif /* CONFIG_OF_CONTROL */ >> + if (autoconf_of_control() && autoconf_of_libfdt()) > > Why are you adding an additional condit
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Benoît Thébaudeau, > Dear Scott Wood, > > On Tuesday, February 26, 2013 12:07:25 AM, Scott Wood wrote: > > On 02/25/2013 05:03:30 PM, Marek Vasut wrote: > > > Dear Scott Wood, > > > > > > > So maybe we need a more general (but optional) CONFIG_BUILD_TARGET. > > > > > > Can you elaborate? > > > > Same as CONFIG_SPL_TARGET, but not SPL-specific. Basically a way for a > > board config file to add to $(ALL-y). > > > > > > So each one would set the appropriate CONFIG_BUILD_TARGET for > > > > > > whatever > > > > > > > needs to get built, and then something like CONFIG_NAND_IMAGE could > > > > hold the image name that should be linked to produce a standard > > > > u-boot-nand.bin output. > > > > > > Yea, sounds reasonable. But why call it CONFIG_ , it can't be stored > > > in the > > > board.h files, it has to be somewhere in the Makefile hierarchy. > > > > Why can't it go in the board.h files? > > We could do all that, but should we? As I said to Marek, I think that it's > a big mistake to omit the SPL here. The only other solution to get a > reliable boot would be the DBBT, but it's very hard to use in real life, > away from a production line. The SPL is really easy to enable here, and > it's only a matter of time before someone gets bitten by this lack of > reliability, so why not just do things right? The boot time and footprint > of an SPL would really be negligible, and it's not because other > implementations omit both SPL and a valid DBBT that U-Boot should do the > same. I'm not against SPL, but then we're starting to drift away from the whole idea of generating u-boot-nand.bin or similar image. Being able to generate u-boot- nand.bin or u-boot-sd.bin etc ... on a per-CPU basis (since this is CPU specific) is the ultimate goal here, whatever is embedded in the image. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target
Dear Scott Wood, > On 02/25/2013 05:03:30 PM, Marek Vasut wrote: > > Dear Scott Wood, > > > > > So maybe we need a more general (but optional) CONFIG_BUILD_TARGET. > > > > Can you elaborate? > > Same as CONFIG_SPL_TARGET, but not SPL-specific. Basically a way for a > board config file to add to $(ALL-y). > > > > So each one would set the appropriate CONFIG_BUILD_TARGET for > > > > whatever > > > > > needs to get built, and then something like CONFIG_NAND_IMAGE could > > > hold the image name that should be linked to produce a standard > > > u-boot-nand.bin output. > > > > Yea, sounds reasonable. But why call it CONFIG_ , it can't be stored > > in the > > board.h files, it has to be somewhere in the Makefile hierarchy. > > Why can't it go in the board.h files? How would a config file contain the CPU-specific portions of a Makefile? > -Scott Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] patch error
Dear wanxs, it is usually polite to supply your full name in the email. > Dear Marek Vasut, > Thanks for your patches.But when I patch them to my u-boot,I get a > error. > I get u-boot-imx from denx. > git apply > U-Boot-1-4-common-imx-Implement-generic-u-boot.nand-target.patch > > error: patch failed: Makefile:470 > error: Makefile: patch does not apply > error: patch failed: arch/arm/imx-common/Makefile:50 The patch depends on the OBJTREE vs. obj fixes. > your > wanxs Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot