[U-Boot] [PATCH v2 08/11] x86: tsc: Add driver model timer support
This adds driver model timer support to x86 tsc timer driver. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None arch/x86/lib/tsc_timer.c | 65 1 file changed, 65 insertions(+) diff --git a/arch/x86/lib/tsc_timer.c b/arch/x86/lib/tsc_timer.c index 5a962ce..4a95959 100644 --- a/arch/x86/lib/tsc_timer.c +++ b/arch/x86/lib/tsc_timer.c @@ -8,7 +8,9 @@ */ #include +#include #include +#include #include #include #include @@ -278,6 +280,7 @@ success: return delta / 1000; } +#ifndef CONFIG_TIMER void timer_set_base(u64 base) { gd->arch.tsc_base = base; @@ -297,10 +300,14 @@ u64 notrace get_ticks(void) panic("No tick base available"); return now_tick - gd->arch.tsc_base; } +#endif /* CONFIG_TIMER */ /* Get the speed of the TSC timer in MHz */ unsigned notrace long get_tbclk_mhz(void) { +#ifdef CONFIG_TIMER + return get_tbclk() / 100; +#else unsigned long fast_calibrate; if (gd->arch.tsc_mhz) @@ -320,12 +327,15 @@ unsigned notrace long get_tbclk_mhz(void) gd->arch.tsc_mhz = fast_calibrate; return fast_calibrate; +#endif } +#ifndef CONFIG_TIMER unsigned long get_tbclk(void) { return get_tbclk_mhz() * 1000 * 1000; } +#endif static ulong get_ms_timer(void) { @@ -375,3 +385,58 @@ int timer_init(void) return 0; } + +#ifdef CONFIG_TIMER +static int tsc_timer_get_count(struct udevice *dev, u64 *count) +{ + u64 now_tick = rdtsc(); + + *count = now_tick - gd->arch.tsc_base; + + return 0; +} + +static int tsc_timer_probe(struct udevice *dev) +{ + struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); + + gd->arch.tsc_base = rdtsc(); + + /* +* If there is no clock frequency specified in the device tree, +* calibrate it by ourselves. +*/ + if (!uc_priv->clock_rate) { + unsigned long fast_calibrate; + + fast_calibrate = try_msr_calibrate_tsc(); + if (!fast_calibrate) { + fast_calibrate = quick_pit_calibrate(); + if (!fast_calibrate) + panic("TSC frequency is ZERO"); + } + + uc_priv->clock_rate = fast_calibrate * 100; + } + + return 0; +} + +static const struct timer_ops tsc_timer_ops = { + .get_count = tsc_timer_get_count, +}; + +static const struct udevice_id tsc_timer_ids[] = { + { .compatible = "x86,tsc-timer", }, + { } +}; + +U_BOOT_DRIVER(tsc_timer) = { + .name = "tsc_timer", + .id = UCLASS_TIMER, + .of_match = tsc_timer_ids, + .probe = tsc_timer_probe, + .ops= &tsc_timer_ops, + .flags = DM_FLAG_PRE_RELOC, +}; +#endif /* CONFIG_TIMER */ -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 09/11] x86: Convert to use driver model timer
Convert all x86 boards to use driver model tsc timer. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: - Remove "counter-64bit" property arch/x86/cpu/baytrail/valleyview.c | 3 --- arch/x86/cpu/coreboot/timestamp.c | 22 -- arch/x86/cpu/efi/efi.c | 4 arch/x86/cpu/ivybridge/cpu.c| 1 - arch/x86/cpu/qemu/qemu.c| 3 --- arch/x86/cpu/quark/quark.c | 3 --- arch/x86/cpu/queensbay/tnc.c| 3 --- arch/x86/dts/bayleybay.dts | 1 + arch/x86/dts/broadwell_som-6896.dts | 1 + arch/x86/dts/chromebook_link.dts| 1 + arch/x86/dts/chromebox_panther.dts | 1 + arch/x86/dts/crownbay.dts | 1 + arch/x86/dts/efi.dts| 5 + arch/x86/dts/galileo.dts| 5 + arch/x86/dts/minnowmax.dts | 1 + arch/x86/dts/qemu-x86_i440fx.dts| 5 + arch/x86/dts/qemu-x86_q35.dts | 5 + arch/x86/dts/tsc_timer.dtsi | 7 +++ configs/bayleybay_defconfig | 1 + configs/chromebook_link_defconfig | 2 +- configs/chromebox_panther_defconfig | 2 +- configs/coreboot-x86_defconfig | 2 +- configs/crownbay_defconfig | 1 + configs/efi-x86_defconfig | 1 + configs/galileo_defconfig | 1 + configs/minnowmax_defconfig | 1 + configs/qemu-x86_defconfig | 1 + 27 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 arch/x86/dts/tsc_timer.dtsi diff --git a/arch/x86/cpu/baytrail/valleyview.c b/arch/x86/cpu/baytrail/valleyview.c index a009c14..9b30451 100644 --- a/arch/x86/cpu/baytrail/valleyview.c +++ b/arch/x86/cpu/baytrail/valleyview.c @@ -28,9 +28,6 @@ int arch_cpu_init(void) int ret; post_code(POST_CPU_INIT); -#ifdef CONFIG_SYS_X86_TSC_TIMER - timer_set_base(rdtsc()); -#endif ret = x86_cpu_init_f(); if (ret) diff --git a/arch/x86/cpu/coreboot/timestamp.c b/arch/x86/cpu/coreboot/timestamp.c index 0edee6b..b382795 100644 --- a/arch/x86/cpu/coreboot/timestamp.c +++ b/arch/x86/cpu/coreboot/timestamp.c @@ -27,28 +27,6 @@ static struct timestamp_table *ts_table __attribute__((section(".data"))); void timestamp_init(void) { -#ifdef CONFIG_SYS_X86_TSC_TIMER - uint64_t base_time; -#endif - - ts_table = lib_sysinfo.tstamp_table; -#ifdef CONFIG_SYS_X86_TSC_TIMER - /* -* If coreboot is built with CONFIG_COLLECT_TIMESTAMPS, use the value -* of base_time in coreboot's timestamp table as our timer base, -* otherwise TSC counter value will be used. -* -* Sometimes even coreboot is built with CONFIG_COLLECT_TIMESTAMPS, -* the value of base_time in the timestamp table is still zero, so -* we must exclude this case too (this is currently seen on booting -* coreboot in qemu) -*/ - if (ts_table && ts_table->base_time) - base_time = ts_table->base_time; - else - base_time = rdtsc(); - timer_set_base(base_time); -#endif timestamp_add_now(TS_U_BOOT_INITTED); } diff --git a/arch/x86/cpu/efi/efi.c b/arch/x86/cpu/efi/efi.c index 75ba0d4..993ab8d 100644 --- a/arch/x86/cpu/efi/efi.c +++ b/arch/x86/cpu/efi/efi.c @@ -10,10 +10,6 @@ int arch_cpu_init(void) { -#ifdef CONFIG_SYS_X86_TSC_TIMER - timer_set_base(rdtsc()); -#endif - return 0; } diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c index 0e6512c..0387444 100644 --- a/arch/x86/cpu/ivybridge/cpu.c +++ b/arch/x86/cpu/ivybridge/cpu.c @@ -118,7 +118,6 @@ static void set_spi_speed(void) int arch_cpu_init(void) { post_code(POST_CPU_INIT); - timer_set_base(rdtsc()); return x86_cpu_init_f(); } diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c index 84fb082..1f93f72 100644 --- a/arch/x86/cpu/qemu/qemu.c +++ b/arch/x86/cpu/qemu/qemu.c @@ -64,9 +64,6 @@ int arch_cpu_init(void) int ret; post_code(POST_CPU_INIT); -#ifdef CONFIG_SYS_X86_TSC_TIMER - timer_set_base(rdtsc()); -#endif ret = x86_cpu_init_f(); if (ret) diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index f737e19..c2bf497 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -233,9 +233,6 @@ int arch_cpu_init(void) int ret; post_code(POST_CPU_INIT); -#ifdef CONFIG_SYS_X86_TSC_TIMER - timer_set_base(rdtsc()); -#endif ret = x86_cpu_init_f(); if (ret) diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c index 933d189..fb81919 100644 --- a/arch/x86/cpu/queensbay/tnc.c +++ b/arch/x86/cpu/queensbay/tnc.c @@ -52,9 +52,6 @@ int arch_cpu_init(void) int ret; post_code(POST_CPU_INIT); -#ifdef CONFIG_SYS_X86_TSC_TIMER - timer_set_base(rdtsc()); -#endif ret = x86_cpu_init_f(); if (ret) diff --git a/arch/x86/dts/bayleybay.dts b/arch/x86/dts/bayle
[U-Boot] [PATCH v2 05/11] dm: timer: Support 64-bit counter
There are timers with a 64-bit counter value but current timer uclass driver assumes a 32-bit one. Introduce a device tree property "counter-64bit", and modify timer_get_count() in the timer uclass driver to handle the 32-bit/64-bit conversion automatically. Signed-off-by: Bin Meng --- Changes in v2: - Do not use "counter-64bit" property, instead create an inline function for 32-bit timer driver to construct a 64-bit timer value. drivers/timer/altera_timer.c | 4 ++-- drivers/timer/sandbox_timer.c | 2 +- drivers/timer/timer-uclass.c | 8 +++- include/timer.h | 23 --- lib/time.c| 9 ++--- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/drivers/timer/altera_timer.c b/drivers/timer/altera_timer.c index 6fe24f2..a7ed3cc 100644 --- a/drivers/timer/altera_timer.c +++ b/drivers/timer/altera_timer.c @@ -34,7 +34,7 @@ struct altera_timer_platdata { struct altera_timer_regs *regs; }; -static int altera_timer_get_count(struct udevice *dev, unsigned long *count) +static int altera_timer_get_count(struct udevice *dev, u64 *count) { struct altera_timer_platdata *plat = dev->platdata; struct altera_timer_regs *const regs = plat->regs; @@ -46,7 +46,7 @@ static int altera_timer_get_count(struct udevice *dev, unsigned long *count) /* Read timer value */ val = readl(®s->snapl) & 0x; val |= (readl(®s->snaph) & 0x) << 16; - *count = ~val; + *count = timer_conv_64(~val); return 0; } diff --git a/drivers/timer/sandbox_timer.c b/drivers/timer/sandbox_timer.c index 4b20af2..00a9944 100644 --- a/drivers/timer/sandbox_timer.c +++ b/drivers/timer/sandbox_timer.c @@ -18,7 +18,7 @@ void sandbox_timer_add_offset(unsigned long offset) sandbox_timer_offset += offset; } -static int sandbox_timer_get_count(struct udevice *dev, unsigned long *count) +static int sandbox_timer_get_count(struct udevice *dev, u64 *count) { *count = os_get_nsec() / 1000 + sandbox_timer_offset * 1000; diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index 0218591..1ef0012 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -9,18 +9,16 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - /* * Implement a timer uclass to work with lib/time.c. The timer is usually - * a 32 bits free-running up counter. The get_rate() method is used to get + * a 32/64 bits free-running up counter. The get_rate() method is used to get * the input clock frequency of the timer. The get_count() method is used - * to get the current 32 bits count value. If the hardware is counting down, + * to get the current 64 bits count value. If the hardware is counting down, * the value should be inversed inside the method. There may be no real * tick, and no timer interrupt. */ -int timer_get_count(struct udevice *dev, unsigned long *count) +int timer_get_count(struct udevice *dev, u64 *count) { const struct timer_ops *ops = device_get_ops(dev); diff --git a/include/timer.h b/include/timer.h index ed5c685..4eed504 100644 --- a/include/timer.h +++ b/include/timer.h @@ -7,6 +7,23 @@ #ifndef _TIMER_H_ #define _TIMER_H_ +DECLARE_GLOBAL_DATA_PTR; + +/* + * timer_conv_64 - convert 32-bit counter value to 64-bit + * + * @count: 32-bit counter value + * @return: 64-bit counter value + */ +static inline u64 timer_conv_64(u32 count) +{ + /* increment tbh if tbl has rolled over */ + if (count < gd->timebase_l) + gd->timebase_h++; + gd->timebase_l = count; + return ((u64)gd->timebase_h << 32) | gd->timebase_l; +} + /* * Get the current timer count * @@ -14,7 +31,7 @@ * @count: pointer that returns the current timer count * @return: 0 if OK, -ve on error */ -int timer_get_count(struct udevice *dev, unsigned long *count); +int timer_get_count(struct udevice *dev, u64 *count); /* * Get the timer input clock frequency @@ -35,10 +52,10 @@ struct timer_ops { * Get the current timer count * * @dev: The timer device -* @count: pointer that returns the current timer count +* @count: pointer that returns the current 64-bit timer count * @return: 0 if OK, -ve on error */ - int (*get_count)(struct udevice *dev, unsigned long *count); + int (*get_count)(struct udevice *dev, u64 *count); }; /* diff --git a/lib/time.c b/lib/time.c index b001745..f37a662 100644 --- a/lib/time.c +++ b/lib/time.c @@ -69,9 +69,9 @@ ulong notrace get_tbclk(void) return timer_get_rate(gd->timer); } -unsigned long notrace timer_read_counter(void) +uint64_t notrace get_ticks(void) { - unsigned long count; + u64 count; int ret; ret = dm_timer_init(); @@ -84,7 +84,8 @@ unsigned long notrace timer_read_counter(void) return count; } -#endif /* CONFIG_TIMER */ + +#else /* !CONFIG_TIMER */ uint64
[U-Boot] [PATCH v2 10/11] x86: tsc: Remove legacy timer codes
Now that we have converted all x86 boards to use driver model timer, remove these legacy timer codes in the tsc driver. Note this also removes the TSC_CALIBRATION_BYPASS Kconfig option, as it is not needed with driver model. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None arch/x86/Kconfig | 20 -- arch/x86/cpu/qemu/Kconfig | 1 - arch/x86/cpu/quark/Kconfig | 5 arch/x86/include/asm/global_data.h | 1 - arch/x86/lib/tsc_timer.c | 53 -- configs/coreboot-x86_defconfig | 1 - configs/efi-x86_defconfig | 1 - 7 files changed, 82 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8914be3..fef5601 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -279,26 +279,6 @@ config AP_STACK_SIZE the memory used by this initialisation process. Typically 4KB is enough space. -config TSC_CALIBRATION_BYPASS - bool "Bypass Time-Stamp Counter (TSC) calibration" - default n - help - By default U-Boot automatically calibrates Time-Stamp Counter (TSC) - running frequency via Model-Specific Register (MSR) and Programmable - Interval Timer (PIT). If the calibration does not work on your board, - select this option and provide a hardcoded TSC running frequency with - CONFIG_TSC_FREQ_IN_MHZ below. - - Normally this option should be turned on in a simulation environment - like qemu. - -config TSC_FREQ_IN_MHZ - int "Time-Stamp Counter (TSC) running frequency in MHz" - depends on TSC_CALIBRATION_BYPASS - default 1000 - help - The running frequency in MHz of Time-Stamp Counter (TSC). - config HAVE_VGA_BIOS bool "Add a VGA BIOS image" help diff --git a/arch/x86/cpu/qemu/Kconfig b/arch/x86/cpu/qemu/Kconfig index fb775d7..4f98621 100644 --- a/arch/x86/cpu/qemu/Kconfig +++ b/arch/x86/cpu/qemu/Kconfig @@ -6,7 +6,6 @@ config QEMU bool - select TSC_CALIBRATION_BYPASS if QEMU diff --git a/arch/x86/cpu/quark/Kconfig b/arch/x86/cpu/quark/Kconfig index bc961ef..163caac 100644 --- a/arch/x86/cpu/quark/Kconfig +++ b/arch/x86/cpu/quark/Kconfig @@ -7,7 +7,6 @@ config INTEL_QUARK bool select HAVE_RMU - select TSC_CALIBRATION_BYPASS if INTEL_QUARK @@ -119,8 +118,4 @@ config SYS_CAR_SIZE Space in bytes in eSRAM used as Cache-As-ARM (CAR). Note this size must not exceed eSRAM's total size. -config TSC_FREQ_IN_MHZ - int - default 400 - endif diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 5966b7c..0ca518c 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -54,7 +54,6 @@ struct arch_global_data { uint8_t x86_mask; uint32_t x86_device; uint64_t tsc_base; /* Initial value returned by rdtsc() */ - uint32_t tsc_mhz; /* TSC frequency in MHz */ void *new_fdt; /* Relocated FDT */ uint32_t bist; /* Built-in self test value */ enum pei_boot_mode_t pei_boot_mode; diff --git a/arch/x86/lib/tsc_timer.c b/arch/x86/lib/tsc_timer.c index 4a95959..6aa2437 100644 --- a/arch/x86/lib/tsc_timer.c +++ b/arch/x86/lib/tsc_timer.c @@ -280,63 +280,12 @@ success: return delta / 1000; } -#ifndef CONFIG_TIMER -void timer_set_base(u64 base) -{ - gd->arch.tsc_base = base; -} - -/* - * Get the number of CPU time counter ticks since it was read first time after - * restart. This yields a free running counter guaranteed to take almost 6 - * years to wrap around even at 100GHz clock rate. - */ -u64 notrace get_ticks(void) -{ - u64 now_tick = rdtsc(); - - /* We assume that 0 means the base hasn't been set yet */ - if (!gd->arch.tsc_base) - panic("No tick base available"); - return now_tick - gd->arch.tsc_base; -} -#endif /* CONFIG_TIMER */ - /* Get the speed of the TSC timer in MHz */ unsigned notrace long get_tbclk_mhz(void) { -#ifdef CONFIG_TIMER return get_tbclk() / 100; -#else - unsigned long fast_calibrate; - - if (gd->arch.tsc_mhz) - return gd->arch.tsc_mhz; - -#ifdef CONFIG_TSC_CALIBRATION_BYPASS - fast_calibrate = CONFIG_TSC_FREQ_IN_MHZ; -#else - fast_calibrate = try_msr_calibrate_tsc(); - if (!fast_calibrate) { - - fast_calibrate = quick_pit_calibrate(); - if (!fast_calibrate) - panic("TSC frequency is ZERO"); - } -#endif - - gd->arch.tsc_mhz = fast_calibrate; - return fast_calibrate; -#endif } -#ifndef CONFIG_TIMER -unsigned long get_tbclk(void) -{ - return get_tbclk_mhz() * 1000 * 1000; -} -#endif - static ulong get_ms_timer(void) { return (get_ticks() * 1000) / get_tbclk(); @@ -386,7 +335,6 @@ int
[U-Boot] [PATCH v2 11/11] x86: tsc: Move tsc_timer.c to drivers/timer
To group all dm timer drivers together, move tsc timer to drivers/timer directory. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None arch/x86/lib/Makefile | 1 - drivers/timer/Kconfig | 7 +++ drivers/timer/Makefile | 1 + {arch/x86/lib => drivers/timer}/tsc_timer.c | 0 include/configs/x86-common.h| 2 -- 5 files changed, 8 insertions(+), 3 deletions(-) rename {arch/x86/lib => drivers/timer}/tsc_timer.c (100%) diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index d676e2c..cd5ecb6 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -34,7 +34,6 @@ obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o obj-y += string.o obj-$(CONFIG_GENERATE_ACPI_TABLE) += acpi_table.o obj-y += tables.o -obj-$(CONFIG_SYS_X86_TSC_TIMER)+= tsc_timer.o obj-$(CONFIG_CMD_ZBOOT)+= zimage.o obj-$(CONFIG_HAVE_FSP) += fsp/ diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index 029af64..2b10d2b 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -23,4 +23,11 @@ config SANDBOX_TIMER Select this to enable an emulated timer for sandbox. It gets time from host os. +config X86_TSC_TIMER + bool "x86 Time-Stamp Counter (TSC) timer support" + depends on TIMER && X86 + default y if X86 + help + Select this to enable Time-Stamp Counter (TSC) timer for x86. + endmenu diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile index 300946e..fe954ec 100644 --- a/drivers/timer/Makefile +++ b/drivers/timer/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_TIMER)+= timer-uclass.o obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o obj-$(CONFIG_SANDBOX_TIMER)+= sandbox_timer.o +obj-$(CONFIG_X86_TSC_TIMER)+= tsc_timer.o diff --git a/arch/x86/lib/tsc_timer.c b/drivers/timer/tsc_timer.c similarity index 100% rename from arch/x86/lib/tsc_timer.c rename to drivers/timer/tsc_timer.c diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h index ab9fa0b..7c3b673 100644 --- a/include/configs/x86-common.h +++ b/include/configs/x86-common.h @@ -154,8 +154,6 @@ * CPU Features */ -#define CONFIG_SYS_X86_TSC_TIMER - #define CONFIG_SYS_STACK_SIZE (32 * 1024) #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MALLOC_LEN 0x20 -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 04/11] timer: sandbox: Use device tree to pass the clock frequency
We should use device tree to pass the clock frequency of the timer instead of hardcoded in the driver codes. Signed-off-by: Bin Meng --- Changes in v2: - New patch to use device tree to pass the clock frequency arch/sandbox/dts/sandbox.dts | 1 + drivers/timer/sandbox_timer.c | 4 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts index 720ef93..d2addb4 100644 --- a/arch/sandbox/dts/sandbox.dts +++ b/arch/sandbox/dts/sandbox.dts @@ -179,6 +179,7 @@ timer { compatible = "sandbox,timer"; + clock-frequency = <100>; }; tpm { diff --git a/drivers/timer/sandbox_timer.c b/drivers/timer/sandbox_timer.c index 38de763..4b20af2 100644 --- a/drivers/timer/sandbox_timer.c +++ b/drivers/timer/sandbox_timer.c @@ -27,10 +27,6 @@ static int sandbox_timer_get_count(struct udevice *dev, unsigned long *count) static int sandbox_timer_probe(struct udevice *dev) { - struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); - - uc_priv->clock_rate = 100; - return 0; } -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 06/11] x86: Reomve MIN_PORT80_KCLOCKS_DELAY
This is not referenced anywhere. Remove it, as well as tsc_base_kclocks and tsc_prev in the global data. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None arch/x86/cpu/cpu.c | 18 -- arch/x86/include/asm/global_data.h | 2 -- 2 files changed, 20 deletions(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 812c5e4..1707993 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -641,24 +641,6 @@ int cpu_jump_to_64bit(ulong setup_base, ulong target) void show_boot_progress(int val) { -#if MIN_PORT80_KCLOCKS_DELAY - /* -* Scale the time counter reading to avoid using 64 bit arithmetics. -* Can't use get_timer() here becuase it could be not yet -* initialized or even implemented. -*/ - if (!gd->arch.tsc_prev) { - gd->arch.tsc_base_kclocks = rdtsc() / 1000; - gd->arch.tsc_prev = 0; - } else { - uint32_t now; - - do { - now = rdtsc() / 1000 - gd->arch.tsc_base_kclocks; - } while (now < (gd->arch.tsc_prev + MIN_PORT80_KCLOCKS_DELAY)); - gd->arch.tsc_prev = now; - } -#endif outb(val, POST_PORT); } diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 35148ab..5966b7c 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -54,8 +54,6 @@ struct arch_global_data { uint8_t x86_mask; uint32_t x86_device; uint64_t tsc_base; /* Initial value returned by rdtsc() */ - uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */ - uint32_t tsc_prev; /* For show_boot_progress() */ uint32_t tsc_mhz; /* TSC frequency in MHz */ void *new_fdt; /* Relocated FDT */ uint32_t bist; /* Built-in self test value */ -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 03/11] timer: altera: Remove the codes to get clock frequency
Since we have timer uclass to get clock frequency for us, remove the custom version in the altera timer driver. Signed-off-by: Bin Meng Acked-by: Thomas Chou Acked-by: Simon Glass --- Changes in v2: None drivers/timer/altera_timer.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/timer/altera_timer.c b/drivers/timer/altera_timer.c index 46a598a..6fe24f2 100644 --- a/drivers/timer/altera_timer.c +++ b/drivers/timer/altera_timer.c @@ -32,7 +32,6 @@ struct altera_timer_regs { struct altera_timer_platdata { struct altera_timer_regs *regs; - unsigned long clock_rate; }; static int altera_timer_get_count(struct udevice *dev, unsigned long *count) @@ -54,12 +53,9 @@ static int altera_timer_get_count(struct udevice *dev, unsigned long *count) static int altera_timer_probe(struct udevice *dev) { - struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct altera_timer_platdata *plat = dev->platdata; struct altera_timer_regs *const regs = plat->regs; - uc_priv->clock_rate = plat->clock_rate; - writel(0, ®s->status); writel(0, ®s->control); writel(ALTERA_TIMER_STOP, ®s->control); @@ -77,8 +73,6 @@ static int altera_timer_ofdata_to_platdata(struct udevice *dev) plat->regs = ioremap(dev_get_addr(dev), sizeof(struct altera_timer_regs)); - plat->clock_rate = fdtdec_get_int(gd->fdt_blob, dev->of_offset, - "clock-frequency", 0); return 0; } -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 01/11] dm: timer: Fix several nits
This changes 'Timer' to 'timer' at several places. Signed-off-by: Bin Meng Acked-by: Thomas Chou Reviewed-by: Simon Glass --- Changes in v2: - Rebase on u-boot-dm/master - Change 'Timer' to 'timer' in the sandbox timer Kconfig drivers/timer/Kconfig| 12 ++-- drivers/timer/timer-uclass.c | 4 ++-- include/timer.h | 11 ++- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index 601e493..029af64 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -1,23 +1,23 @@ menu "Timer Support" config TIMER - bool "Enable Driver Model for Timer drivers" + bool "Enable driver model for timer drivers" depends on DM help - Enable driver model for Timer access. It uses the same API as - lib/time.c. But now implemented by the uclass. The first timer + Enable driver model for timer access. It uses the same API as + lib/time.c, but now implemented by the uclass. The first timer will be used. The timer is usually a 32 bits free-running up counter. There may be no real tick, and no timer interrupt. config ALTERA_TIMER - bool "Altera Timer support" + bool "Altera timer support" depends on TIMER help - Select this to enable an timer for Altera devices. Please find + Select this to enable a timer for Altera devices. Please find details on the "Embedded Peripherals IP User Guide" of Altera. config SANDBOX_TIMER - bool "Sandbox Timer support" + bool "Sandbox timer support" depends on SANDBOX && TIMER help Select this to enable an emulated timer for sandbox. It gets diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index 12aee5b..82c6897 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -10,10 +10,10 @@ #include /* - * Implement a Timer uclass to work with lib/time.c. The timer is usually + * Implement a timer uclass to work with lib/time.c. The timer is usually * a 32 bits free-running up counter. The get_rate() method is used to get * the input clock frequency of the timer. The get_count() method is used - * get the current 32 bits count value. If the hardware is counting down, + * to get the current 32 bits count value. If the hardware is counting down, * the value should be inversed inside the method. There may be no real * tick, and no timer interrupt. */ diff --git a/include/timer.h b/include/timer.h index cdf385d..ed5c685 100644 --- a/include/timer.h +++ b/include/timer.h @@ -10,30 +10,31 @@ /* * Get the current timer count * - * @dev: The Timer device + * @dev: The timer device * @count: pointer that returns the current timer count * @return: 0 if OK, -ve on error */ int timer_get_count(struct udevice *dev, unsigned long *count); + /* * Get the timer input clock frequency * - * @dev: The Timer device + * @dev: The timer device * @return: the timer input clock frequency */ unsigned long timer_get_rate(struct udevice *dev); /* - * struct timer_ops - Driver model Timer operations + * struct timer_ops - Driver model timer operations * - * The uclass interface is implemented by all Timer devices which use + * The uclass interface is implemented by all timer devices which use * driver model. */ struct timer_ops { /* * Get the current timer count * -* @dev: The Timer device +* @dev: The timer device * @count: pointer that returns the current timer count * @return: 0 if OK, -ve on error */ -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 07/11] x86: tsc: Use notrace from
Replace __attribute__((no_instrument_function)) with notrace from . Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None arch/x86/lib/tsc_timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/lib/tsc_timer.c b/arch/x86/lib/tsc_timer.c index e02b918..5a962ce 100644 --- a/arch/x86/lib/tsc_timer.c +++ b/arch/x86/lib/tsc_timer.c @@ -288,7 +288,7 @@ void timer_set_base(u64 base) * restart. This yields a free running counter guaranteed to take almost 6 * years to wrap around even at 100GHz clock rate. */ -u64 __attribute__((no_instrument_function)) get_ticks(void) +u64 notrace get_ticks(void) { u64 now_tick = rdtsc(); @@ -299,7 +299,7 @@ u64 __attribute__((no_instrument_function)) get_ticks(void) } /* Get the speed of the TSC timer in MHz */ -unsigned __attribute__((no_instrument_function)) long get_tbclk_mhz(void) +unsigned notrace long get_tbclk_mhz(void) { unsigned long fast_calibrate; @@ -337,7 +337,7 @@ ulong get_timer(ulong base) return get_ms_timer() - base; } -ulong __attribute__((no_instrument_function)) timer_get_us(void) +ulong notrace timer_get_us(void) { return get_ticks() / get_tbclk_mhz(); } -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 02/11] dm: timer: Implement pre_probe()
Every timer device needs to have a valid clock frequency and it can be specified in the device tree. Use pre_probe() to get this in the timer uclass driver. Signed-off-by: Bin Meng Acked-by: Thomas Chou Acked-by: Simon Glass --- Changes in v2: None drivers/timer/timer-uclass.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index 82c6897..0218591 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -9,6 +9,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + /* * Implement a timer uclass to work with lib/time.c. The timer is usually * a 32 bits free-running up counter. The get_rate() method is used to get @@ -35,8 +37,19 @@ unsigned long timer_get_rate(struct udevice *dev) return uc_priv->clock_rate; } +static int timer_pre_probe(struct udevice *dev) +{ + struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); + + uc_priv->clock_rate = fdtdec_get_int(gd->fdt_blob, dev->of_offset, +"clock-frequency", 0); + + return 0; +} + UCLASS_DRIVER(timer) = { .id = UCLASS_TIMER, .name = "timer", + .pre_probe = timer_pre_probe, .per_device_auto_alloc_size = sizeof(struct timer_dev_priv), }; -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 00/11] dm: timer: x86: 64-bit counter support and tsc timer dm conversion
This series enhances timer uclass driver to support 64-bit counter value, and convert tsc timer to driver model to be used by all x86 boards. As a result of dm conversion, the TSC_CALIBRATION_BYPASS Kconfig option is no longer needed, and the TSC frequency can be specified in the board device tree. This v2 is rebased on top of u-boot-dm/master, to resolve conflicts with Altera timer updates and the new Sandbox timer driver. Changes in v2: - Rebase on u-boot-dm/master - Change 'Timer' to 'timer' in the sandbox timer Kconfig - New patch to use device tree to pass the clock frequency - Do not use "counter-64bit" property, instead create an inline function for 32-bit timer driver to construct a 64-bit timer value. - Remove "counter-64bit" property Bin Meng (11): dm: timer: Fix several nits dm: timer: Implement pre_probe() timer: altera: Remove the codes to get clock frequency timer: sandbox: Use device tree to pass the clock frequency dm: timer: Support 64-bit counter x86: Reomve MIN_PORT80_KCLOCKS_DELAY x86: tsc: Use notrace from x86: tsc: Add driver model timer support x86: Convert to use driver model timer x86: tsc: Remove legacy timer codes x86: tsc: Move tsc_timer.c to drivers/timer arch/sandbox/dts/sandbox.dts| 1 + arch/x86/Kconfig| 20 -- arch/x86/cpu/baytrail/valleyview.c | 3 - arch/x86/cpu/coreboot/timestamp.c | 22 -- arch/x86/cpu/cpu.c | 18 - arch/x86/cpu/efi/efi.c | 4 -- arch/x86/cpu/ivybridge/cpu.c| 1 - arch/x86/cpu/qemu/Kconfig | 1 - arch/x86/cpu/qemu/qemu.c| 3 - arch/x86/cpu/quark/Kconfig | 5 -- arch/x86/cpu/quark/quark.c | 3 - arch/x86/cpu/queensbay/tnc.c| 3 - arch/x86/dts/bayleybay.dts | 1 + arch/x86/dts/broadwell_som-6896.dts | 1 + arch/x86/dts/chromebook_link.dts| 1 + arch/x86/dts/chromebox_panther.dts | 1 + arch/x86/dts/crownbay.dts | 1 + arch/x86/dts/efi.dts| 5 ++ arch/x86/dts/galileo.dts| 5 ++ arch/x86/dts/minnowmax.dts | 1 + arch/x86/dts/qemu-x86_i440fx.dts| 5 ++ arch/x86/dts/qemu-x86_q35.dts | 5 ++ arch/x86/dts/tsc_timer.dtsi | 7 ++ arch/x86/include/asm/global_data.h | 3 - arch/x86/lib/Makefile | 1 - configs/bayleybay_defconfig | 1 + configs/chromebook_link_defconfig | 2 +- configs/chromebox_panther_defconfig | 2 +- configs/coreboot-x86_defconfig | 3 +- configs/crownbay_defconfig | 1 + configs/efi-x86_defconfig | 2 +- configs/galileo_defconfig | 1 + configs/minnowmax_defconfig | 1 + configs/qemu-x86_defconfig | 1 + drivers/timer/Kconfig | 19 +++-- drivers/timer/Makefile | 1 + drivers/timer/altera_timer.c| 10 +-- drivers/timer/sandbox_timer.c | 6 +- drivers/timer/timer-uclass.c| 19 +++-- {arch/x86/lib => drivers/timer}/tsc_timer.c | 104 include/configs/x86-common.h| 2 - include/timer.h | 34 ++--- lib/time.c | 9 ++- 43 files changed, 165 insertions(+), 174 deletions(-) create mode 100644 arch/x86/dts/tsc_timer.dtsi rename {arch/x86/lib => drivers/timer}/tsc_timer.c (87%) -- 1.8.2.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: socfpga: reset: FIX address of tstscratch register
On Friday, November 13, 2015 at 07:11:18 AM, Stefan Roese wrote: > Hi Philipp, > > On 12.11.2015 18:23, Philipp Rosenberger wrote: > > The Cyclone V Hard Processor System Technical Reference Manual in the > > chapter about the Reset Manager Module Address Map stats that the offset > > of the tstscratch register ist 0x54 not 0x24. > > > > Cyclone V Hard Processor System Technical Reference Manual cv_5v4 > > 2015.11.02 page 3-17 Reset Manager Module Address Map > > > > Signed-off-by: Philipp Rosenberger > > --- > > > > arch/arm/mach-socfpga/include/mach/reset_manager.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager.h > > b/arch/arm/mach-socfpga/include/mach/reset_manager.h index > > 8e59578..6eb6011 100644 > > --- a/arch/arm/mach-socfpga/include/mach/reset_manager.h > > +++ b/arch/arm/mach-socfpga/include/mach/reset_manager.h > > @@ -25,6 +25,7 @@ struct socfpga_reset_manager { > > > > u32 per2_mod_reset; > > u32 brg_mod_reset; > > u32 misc_mod_reset; > > > > + u32 padding2[12]; > > > > u32 tstscratch; > > > > }; > > Thanks. But usually such padding things are added as "u8" (1 byte) > variables. This makes it easier to calculate the offsets. In this > case: > > + u8 padding2[0x30]; > > which I would prefer. I don't mind either way, I can amend the patch (if you don't mind), so let's hear Dinh's final word. 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 v1] armv8: fsl-layerscale: Rewrite reserving memory for MC and debug server
On Thu, 2015-11-12 at 14:20 -0800, York Sun wrote: > Introduce a new function to calculate reserved memory to replace macro > CONFIG_SYS_MEM_TOP_HIDE for more flexibility. Legacy use of this macro is > still supported. MC and debug server are not board-specific. Move the > reservation function to SoC file. Reduce debug server memory by 2MB to > make room for secure memory. I would make sure "pram" is first to reserve memory, is it? Jocke > > Signed-off-by: York Sun > > --- > > README |6 +++--- > arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 18 ++ > board/freescale/ls2085a/ls2085a.c | 17 - > board/freescale/ls2085aqds/ls2085aqds.c | 17 - > board/freescale/ls2085ardb/ls2085ardb.c | 17 - > common/board_f.c| 14 +++--- > include/configs/ls2085a_common.h|5 ++--- > 7 files changed, 34 insertions(+), 60 deletions(-) > > diff --git a/README b/README > index 61cbc82..390ee10 100644 > --- a/README > +++ b/README > @@ -3889,7 +3889,7 @@ Configuration Settings: > the RAM base is not zero, or RAM is divided into banks, > this variable needs to be recalcuated to get the address. > > -- CONFIG_SYS_MEM_TOP_HIDE (PPC only): > +- CONFIG_SYS_MEM_TOP_HIDE: > If CONFIG_SYS_MEM_TOP_HIDE is defined in the board config > header, > this specified memory area will get subtracted from the top > (end) of RAM and won't get "touched" at all by U-Boot. By > @@ -5068,8 +5068,8 @@ This firmware often needs to be loaded during U-Boot > booting. > - CONFIG_SYS_DEBUG_SERVER_DRAM_BLOCK_MIN_SIZE > Define minimum DDR size required for debug server image > > -- CONFIG_SYS_MEM_TOP_HIDE_MIN > - Define minimum DDR size to be hided from top of the DDR memory > +- CONFIG_SYS_MC_RESERV_MEM_ALIGN > + Define alignment of reserved memory MC requires > > Reproducible builds > --- > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c > b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c > index cda8d9b..72cb9d9 100644 > --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c > +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c > @@ -663,3 +663,21 @@ void reset_cpu(ulong addr) > val |= 0x02; > scfg_out32(rstcr, val); > } > + > +unsigned long board_reserve_ram_top(unsigned long ram_size) > +{ > + unsigned long ram_top = ram_size; > + > +/* Carve the Debug Server private DRAM block from the end of DRAM */ > +#ifdef CONFIG_FSL_DEBUG_SERVER > + ram_top -= debug_server_get_dram_block_size(); > +#endif > + > +/* Carve the MC private DRAM block from the end of DRAM */ > +#ifdef CONFIG_FSL_MC_ENET > + ram_top -= mc_get_dram_block_size(); > + ram_top &= ~(CONFIG_SYS_MC_RESERV_MEM_ALIGN - 1); > +#endif > + > + return ram_size - ram_top; > +} > diff --git a/board/freescale/ls2085a/ls2085a.c > b/board/freescale/ls2085a/ls2085a.c > index 27481e2..6f4c3d4 100644 > --- a/board/freescale/ls2085a/ls2085a.c > +++ b/board/freescale/ls2085a/ls2085a.c > @@ -66,23 +66,6 @@ int arch_misc_init(void) > } > #endif > > -unsigned long get_dram_size_to_hide(void) > -{ > - unsigned long dram_to_hide = 0; > - > -/* Carve the Debug Server private DRAM block from the end of DRAM */ > -#ifdef CONFIG_FSL_DEBUG_SERVER > - dram_to_hide += debug_server_get_dram_block_size(); > -#endif > - > -/* Carve the MC private DRAM block from the end of DRAM */ > -#ifdef CONFIG_FSL_MC_ENET > - dram_to_hide += mc_get_dram_block_size(); > -#endif > - > - return roundup(dram_to_hide, CONFIG_SYS_MEM_TOP_HIDE_MIN); > -} > - > int board_eth_init(bd_t *bis) > { > int error = 0; > diff --git a/board/freescale/ls2085aqds/ls2085aqds.c > b/board/freescale/ls2085aqds/ls2085aqds.c > index b02d6e8..8898cc3 100644 > --- a/board/freescale/ls2085aqds/ls2085aqds.c > +++ b/board/freescale/ls2085aqds/ls2085aqds.c > @@ -251,23 +251,6 @@ int arch_misc_init(void) > } > #endif > > -unsigned long get_dram_size_to_hide(void) > -{ > - unsigned long dram_to_hide = 0; > - > -/* Carve the Debug Server private DRAM block from the end of DRAM */ > -#ifdef CONFIG_FSL_DEBUG_SERVER > - dram_to_hide += debug_server_get_dram_block_size(); > -#endif > - > -/* Carve the MC private DRAM block from the end of DRAM */ > -#ifdef CONFIG_FSL_MC_ENET > - dram_to_hide += mc_get_dram_block_size(); > -#endif > - > - return roundup(dram_to_hide, CONFIG_SYS_MEM_TOP_HIDE_MIN); > -} > - > #ifdef CONFIG_FSL_MC_ENET > void fdt_fixup_board_enet(void *fdt) > { > diff --git a/board/freescale/ls2085ardb/ls2085ardb.c > b/board/freescale/ls2085ardb/ls2085ardb.c > index 18953b8..efddf74 100644 > --- a/board/freescale/ls2085ardb/ls2085ardb.c > +++ b/board/freescale/ls2085ardb/ls2085ardb.c > @@ -217,23 +217,6 @@ int arch_misc_init(void) > } > #endif > > -unsigned long get_dram_size_to_hide(void) > -{ > - unsigned long d
Re: [U-Boot] [PATCH 13/14] dm: pci: Convert 'pci' command to driver model
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > Adjust this command to use the correct PCI functions, instead of the > compatibility layer. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 126 > --- > include/common.h | 1 - > 2 files changed, 121 insertions(+), 6 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 6303bed..4f71e57 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -40,6 +41,19 @@ static int pci_field_width(enum pci_size_t size) > } > } > > +#ifdef CONFIG_DM_PCI > +static void pci_show_regs(struct udevice *dev, struct pci_reg_info *regs) > +{ > + for (; regs->name; regs++) { > + unsigned long val; > + > + dm_pci_read_config(dev, regs->offset, &val, regs->size); > + printf(" %s =%*s%#.*lx\n", regs->name, > + (int)(28 - strlen(regs->name)), "", > + pci_field_width(regs->size), val); > + } > +} > +#else > static unsigned long pci_read_config(pci_dev_t dev, int offset, > enum pci_size_t size) > { > @@ -70,6 +84,7 @@ static void pci_show_regs(pci_dev_t dev, struct > pci_reg_info *regs) >pci_read_config(dev, regs->offset, regs->size)); > } > } > +#endif > > static struct pci_reg_info regs_start[] = { > { "vendor ID", PCI_SIZE_16, PCI_VENDOR_ID }, > @@ -170,15 +185,25 @@ static struct pci_reg_info regs_cardbus[] = { > * Return: None > * > */ > +#ifdef CONFIG_DM_PCI > +void pci_header_show(struct udevice *dev) > +#else > void pci_header_show(pci_dev_t dev) > +#endif > { > +#ifdef CONFIG_DM_PCI > + unsigned long _byte, header_type; > + > + dm_pci_read_config(dev, PCI_CLASS_CODE, &_byte, PCI_SIZE_8); > + dm_pci_read_config(dev, PCI_HEADER_TYPE, &header_type, PCI_SIZE_8); > +#else > u8 _byte, header_type; > > pci_read_config_byte(dev, PCI_CLASS_CODE, &_byte); > pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); > +#endif > pci_show_regs(dev, regs_start); > - > - printf(" class code = 0x%.2x (%s)\n", _byte, > + printf(" class code = 0x%.2x (%s)\n", (int)_byte, >pci_class_str(_byte)); > pci_show_regs(dev, regs_rest); > > @@ -209,6 +234,48 @@ void pciinfo_header(int busnum, bool short_listing) > } > } > > +#ifdef CONFIG_DM_PCI > +static void pci_header_show_brief(struct udevice *dev) > +{ > + ulong vendor, device; > + ulong class, subclass; > + > + dm_pci_read_config(dev, PCI_VENDOR_ID, &vendor, PCI_SIZE_16); > + dm_pci_read_config(dev, PCI_DEVICE_ID, &device, PCI_SIZE_16); > + dm_pci_read_config(dev, PCI_CLASS_CODE, &class, PCI_SIZE_8); > + dm_pci_read_config(dev, PCI_CLASS_SUB_CODE, &subclass, PCI_SIZE_8); > + > + printf("0x%.4lx 0x%.4lx %-23s 0x%.2lx\n", > + vendor, device, > + pci_class_str(class), subclass); > +} > + > +void pciinfo(struct udevice *bus, bool short_listing) This function should be static? > +{ > + struct udevice *dev; > + > + pciinfo_header(bus->seq, short_listing); > + > + for (device_find_first_child(bus, &dev); > +dev; > +device_find_next_child(&dev)) { > + struct pci_child_platdata *pplat; > + > + pplat = dev_get_parent_platdata(dev); > + if (short_listing) { > + printf("%02x.%02x.%02x ", bus->seq, > + PCI_DEV(pplat->devfn), PCI_FUNC(pplat->devfn)); > + pci_header_show_brief(dev); > + } else { > + printf("\nFound PCI device %02x.%02x.%02x:\n", > bus->seq, > + PCI_DEV(pplat->devfn), PCI_FUNC(pplat->devfn)); > + pci_header_show(dev); > + } > + } > +} > + > +#else > + > /* > * Subroutine: pci_header_show_brief > * > @@ -307,7 +374,7 @@ void pciinfo(int bus_num, int short_pci_listing) > error: > printf("Cannot read bus configuration: %d\n", ret); > } > - > +#endif > > /* Convert the "bus.device.function" identifier into a number. > */ > @@ -335,8 +402,13 @@ static pci_dev_t get_pci_dev(char* name) > return PCI_BDF(bdfs[0], bdfs[1], bdfs[2]); > } > > +#ifdef CONFIG_DM_PCI > +static int pci_cfg_display(struct udevice *dev, ulong addr, > + enum pci_size_t size, ulong length) > +#else > static int pci_cfg_display(pci_dev_t bdf, ulong addr, enum pci_size_t size, >ulong length) > +#endif > { > #define DISP_LINE_LEN 16 > ulong i, nbytes, linebytes; > @@ -355,7 +427,11 @@ static int pci_cfg_display(pci
Re: [U-Boot] [PATCH 14/14] dm: pci: Disable PCI compatibility functions by default
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > We eventually need to drop the compatibility functions for driver model. As > a first step, create a configuration option to enable them and hide them > when the option is disabled. > > Signed-off-by: Simon Glass > --- > > arch/arm/mach-tegra/Kconfig | 2 ++ > arch/x86/Kconfig| 3 +++ > configs/sandbox_defconfig | 10 +- > drivers/pci/Kconfig | 9 + > drivers/pci/Makefile| 3 ++- > include/pci.h | 21 + > 6 files changed, 38 insertions(+), 10 deletions(-) > > diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig > index e5215ab..3906fc1 100644 > --- a/arch/arm/mach-tegra/Kconfig > +++ b/arch/arm/mach-tegra/Kconfig > @@ -13,6 +13,7 @@ config TEGRA_ARMV7_COMMON > select DM_SPI > select DM_GPIO > select DM_PCI > + select DM_PCI_COMPAT > > choice > prompt "Tegra SoC select" > @@ -45,6 +46,7 @@ config TEGRA210 > select DM_SPI > select DM_GPIO > select DM_PCI > + select DM_PCI_COMPAT > > endchoice > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index f92082d..e972973 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -93,6 +93,9 @@ config SYS_X86_START16 > depends on X86_RESET_VECTOR > default 0xf800 > > +config DM_PCI_COMPAT > + default y # Until we finish moving over to the new API > + > config BOARD_ROMSIZE_KB_512 > bool > config BOARD_ROMSIZE_KB_1024 > diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig > index 94c8e68..92725d8 100644 > --- a/configs/sandbox_defconfig > +++ b/configs/sandbox_defconfig > @@ -6,6 +6,7 @@ CONFIG_FIT_SIGNATURE=y > # CONFIG_CMD_ELF is not set > # CONFIG_CMD_IMLS is not set > # CONFIG_CMD_FLASH is not set > +CONFIG_CMD_REMOTEPROC=y > # CONFIG_CMD_SETEXPR is not set > CONFIG_CMD_SOUND=y > CONFIG_BOOTSTAGE=y > @@ -19,6 +20,8 @@ CONFIG_OF_HOSTFILE=y > CONFIG_REGMAP=y > CONFIG_SYSCON=y > CONFIG_DEVRES=y > +CONFIG_ADC=y > +CONFIG_ADC_SANDBOX=y > CONFIG_CLK=y > CONFIG_SANDBOX_GPIO=y > CONFIG_SYS_I2C_SANDBOX=y > @@ -34,6 +37,7 @@ CONFIG_SPI_FLASH_SANDBOX=y > CONFIG_SPI_FLASH=y > CONFIG_DM_ETH=y > CONFIG_DM_PCI=y > +CONFIG_DM_PCI_COMPAT=y > CONFIG_PCI_SANDBOX=y > CONFIG_PINCTRL=y > CONFIG_PINCONF=y > @@ -43,12 +47,12 @@ CONFIG_DM_PMIC_SANDBOX=y > CONFIG_DM_REGULATOR=y > CONFIG_DM_REGULATOR_SANDBOX=y > CONFIG_RAM=y > +CONFIG_REMOTEPROC_SANDBOX=y > CONFIG_DM_RTC=y > CONFIG_SANDBOX_SERIAL=y > CONFIG_SOUND=y > CONFIG_SOUND_SANDBOX=y > CONFIG_SANDBOX_SPI=y > -CONFIG_DM_TPM=y > CONFIG_TPM_TIS_SANDBOX=y > CONFIG_USB=y > CONFIG_DM_USB=y > @@ -63,7 +67,3 @@ CONFIG_UNIT_TEST=y > CONFIG_UT_TIME=y > CONFIG_UT_DM=y > CONFIG_UT_ENV=y > -CONFIG_REMOTEPROC_SANDBOX=y > -CONFIG_CMD_REMOTEPROC=y > -CONFIG_ADC=y > -CONFIG_ADC_SANDBOX=y > diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig > index c219c19..26aa2b0 100644 > --- a/drivers/pci/Kconfig > +++ b/drivers/pci/Kconfig > @@ -9,6 +9,15 @@ config DM_PCI > available PCI devices, allows scanning of PCI buses and provides > device configuration support. > > +config DM_PCI_COMPAT > + bool "Enable compatible functions for PCI" > + depends on DM_PCI > + help > + Enable compatibility functions for PCI so that old code can be used > + with CONFIG_DM_PCI enabled. This should be used as an interim > + measure when porting a board to use driver model for PCI. Once the > + board is fully supported, this option should be disabled. > + > config PCI_SANDBOX > bool "Sandbox PCI support" > depends on SANDBOX && DM_PCI > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > index 1f8f86f..6b761b4 100644 > --- a/drivers/pci/Makefile > +++ b/drivers/pci/Makefile > @@ -6,7 +6,8 @@ > # > > ifneq ($(CONFIG_DM_PCI),) > -obj-$(CONFIG_PCI) += pci-uclass.o pci_compat.o > +obj-$(CONFIG_PCI) += pci-uclass.o > +obj-$(CONFIG_DM_PCI_COMPAT) += pci_compat.o > obj-$(CONFIG_PCI_SANDBOX) += pci_sandbox.o > obj-$(CONFIG_SANDBOX) += pci-emul-uclass.o > obj-$(CONFIG_X86) += pci_x86.o > diff --git a/include/pci.h b/include/pci.h > index c4f6577..fc7d494 100644 > --- a/include/pci.h > +++ b/include/pci.h > @@ -656,6 +656,7 @@ extern pci_addr_t pci_hose_phys_to_bus(struct > pci_controller* hose, > pci_bus_to_virt((dev), (addr), PCI_REGION_IO, (len), (map_flags)) > > /* For driver model these are defined in macros in pci_compat.c */ > +#if !defined(CONFIG_DM_PCI) || defined(CONFIG_DM_PCI_COMPAT) > extern int pci_hose_read_config_byte(struct pci_controller *hose, > pci_dev_t dev, int where, u8 *val); > extern int pci_hose_read_config_word(struct pci_controller *hose, > @@ -668,6 +669,7 @@ extern int pci_hose_write_config_word(struct > pci_controller *hose, > pci_dev_t dev,
Re: [U-Boot] [PATCH 12/14] pci: Move PCI header output code into its own function
On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > We want to share this code with the driver model version, so put it in a > separate function. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 17 +++-- > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 3d09beb..6303bed 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -199,6 +199,16 @@ void pci_header_show(pci_dev_t dev) > } > } > > +void pciinfo_header(int busnum, bool short_listing) > +{ > + printf("Scanning PCI devices on bus %d\n", busnum); > + > + if (short_listing) { > + printf("BusDevFun VendorId DeviceId Device Class > Sub-Class\n"); > + > printf("_\n"); > + } > +} > + > /* > * Subroutine: pci_header_show_brief > * > @@ -250,12 +260,7 @@ void pciinfo(int bus_num, int short_pci_listing) > if (!hose) > return; > > - printf("Scanning PCI devices on bus %d\n", bus_num); > - > - if (short_pci_listing) { > - printf("BusDevFun VendorId DeviceId Device Class > Sub-Class\n"); > - > printf("_\n"); > - } > + pciinfo_header(bus_num, short_pci_listing); > > for (Device = 0; Device < PCI_MAX_PCI_DEVICES; Device++) { > HeaderType = 0; > -- Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 11/14] pci: Use a separate 'dev' variable for the PCI device
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > In the 'pci' command, add a separate variable to hold the PCI device. When > this code is converted to driver model, this variable will be used to hold a > struct udevice instead. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 747d6b9..3d09beb 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -442,6 +442,7 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > { > ulong addr = 0, value = 0, cmd_size = 0; > enum pci_size_t size; > + pci_dev_t dev; > int busnum = 0; > pci_dev_t bdf = 0; > char cmd = 's'; > @@ -482,16 +483,18 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > if (argc > 1) > busnum = simple_strtoul(argv[1], NULL, 16); > } > - cmd = 's'; > + pciinfo(busnum, value); This looks wrong to me, as patch#1 in this series did the changes to move "pciinfo" call to the switch..case below. > break; > } > > + dev = bdf; > + > switch (cmd) { > case 'h': /* header */ > - pci_header_show(bdf); > + pci_header_show(dev); > break; > case 'd': /* display */ > - return pci_cfg_display(bdf, addr, size, value); > + return pci_cfg_display(dev, addr, size, value); > #ifdef CONFIG_CMD_PCI_ENUM > case 'e': > # ifdef CONFIG_DM_PCI > @@ -504,20 +507,17 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > case 'n': /* next */ > if (argc < 4) > goto usage; > - ret = pci_cfg_modify(bdf, addr, size, value, 0); > + ret = pci_cfg_modify(dev, addr, size, value, 0); > break; > case 'm': /* modify */ > if (argc < 4) > goto usage; > - ret = pci_cfg_modify(bdf, addr, size, value, 1); > - break; > - case 's': > - pciinfo(busnum, value); > + ret = pci_cfg_modify(dev, addr, size, value, 1); Ditto. > break; > case 'w': /* write */ > if (argc < 5) > goto usage; > - ret = pci_cfg_write(bdf, addr, size, value); > + ret = pci_cfg_write(dev, addr, size, value); > break; > default: > ret = CMD_RET_USAGE; > -- Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 09/14] pci: Use common functions to read/write config
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > Currently we using switch() and access PCI configuration via several using -> use > functions, one for each data size. Adjust the code to use generic functions, > where the data size is a parameter. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 49 +++-- > 1 file changed, 15 insertions(+), 34 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 53b0f42..306e734 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -330,7 +330,8 @@ static pci_dev_t get_pci_dev(char* name) > return PCI_BDF(bdfs[0], bdfs[1], bdfs[2]); > } > > -static int pci_cfg_display(pci_dev_t bdf, ulong addr, ulong size, ulong > length) > +static int pci_cfg_display(pci_dev_t bdf, ulong addr, enum pci_size_t size, > + ulong length) > { > #define DISP_LINE_LEN 16 > ulong i, nbytes, linebytes; > @@ -344,23 +345,13 @@ static int pci_cfg_display(pci_dev_t bdf, ulong addr, > ulong size, ulong length) > */ > nbytes = length * size; > do { > - uintval4; > - ushort val2; > - u_char val1; > - > printf("%08lx:", addr); > linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes; > for (i=0; i - if (size == 4) { > - pci_read_config_dword(bdf, addr, &val4); > - printf(" %08x", val4); > - } else if (size == 2) { > - pci_read_config_word(bdf, addr, &val2); > - printf(" %04x", val2); > - } else { > - pci_read_config_byte(bdf, addr, &val1); > - printf(" %02x", val1); > - } > + unsigned long val; > + > + val = pci_read_config(bdf, addr, size); > + printf(" %*lx", pci_field_width(size), val); I think this should be "%.*x" > addr += size; > } > printf("\n"); > @@ -390,32 +381,20 @@ static int pci_cfg_write (pci_dev_t bdf, ulong addr, > ulong size, ulong value) > return 0; > } > > -static int > -pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int > incrflag) > +static int pci_cfg_modify(pci_dev_t bdf, ulong addr, enum pci_size_t size, > + ulong value, int incrflag) > { > ulong i; > int nbytes; > - uintval4; > - ushort val2; > - u_char val1; > + ulong val; > > /* Print the address, followed by value. Then accept input for > * the next value. A non-converted value exits. > */ > do { > printf("%08lx:", addr); > - if (size == 4) { > - pci_read_config_dword(bdf, addr, &val4); > - printf(" %08x", val4); > - } > - else if (size == 2) { > - pci_read_config_word(bdf, addr, &val2); > - printf(" %04x", val2); > - } > - else { > - pci_read_config_byte(bdf, addr, &val1); > - printf(" %02x", val1); > - } > + val = pci_read_config(bdf, addr, size); > + printf(" %*lx", pci_field_width(size), val); "%.*x"? > > nbytes = cli_readline(" ? "); > if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) > { > @@ -461,7 +440,8 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, > ulong value, int incrflag > */ > static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > { > - ulong addr = 0, value = 0, size = 0; > + ulong addr = 0, value = 0, cmd_size = 0; > + enum pci_size_t size; > int busnum = 0; > pci_dev_t bdf = 0; > char cmd = 's'; > @@ -476,7 +456,8 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > case 'm': /* modify */ > case 'w': /* write */ > /* Check for a size specification. */ > - size = cmd_get_data_size(argv[1], 4); > + cmd_size = cmd_get_data_size(argv[1], 4); > + size = (cmd_size == 4) ? PCI_SIZE_32 : size - 1; > if (argc > 3) > addr = simple_strtoul(argv[3], NULL, 16); > if (argc > 4) > -- Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 10/14] pci: Fix pci_field_width() for 32-bit values
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > This should return 8, not 32. Fix it. > > Signed-off-by: Simon Glass > --- > This patch should be squashed into the patch#4 where this bug was introduced in the first place. > common/cmd_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 306e734..747d6b9 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -36,7 +36,7 @@ static int pci_field_width(enum pci_size_t size) > return 4; > case PCI_SIZE_32: > default: > - return 32; > + return 8; > } > } > > -- Regards, Bin ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 08/14] dm: pci: Reorder functions in cmd_pci.c
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > Before converting this to driver model, reorder the code to avoid forward > function declarations. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 216 > +++ > 1 file changed, 106 insertions(+), 110 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index debcd1c..53b0f42 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -21,115 +21,6 @@ > #include > #include > > -/* > - * Follows routines for the output of infos about devices on PCI bus. > - */ > - > -void pci_header_show(pci_dev_t dev); > -void pci_header_show_brief(pci_dev_t dev); > - > -/* > - * Subroutine: pciinfo > - * > - * Description: Show information about devices on PCI bus. > - * Depending on the define > CONFIG_SYS_SHORT_PCI_LISTING > - * the output will be more or less exhaustive. > - * > - * Inputs: bus_no the number of the bus to be scanned. > - * > - * Return: None > - * > - */ > -void pciinfo(int BusNum, int ShortPCIListing) > -{ > - struct pci_controller *hose = pci_bus_to_hose(BusNum); > - int Device; > - int Function; > - unsigned char HeaderType; > - unsigned short VendorID; > - pci_dev_t dev; > - int ret; > - > - if (!hose) > - return; > - > - printf("Scanning PCI devices on bus %d\n", BusNum); > - > - if (ShortPCIListing) { > - printf("BusDevFun VendorId DeviceId Device Class > Sub-Class\n"); > - > printf("_\n"); > - } > - > - for (Device = 0; Device < PCI_MAX_PCI_DEVICES; Device++) { > - HeaderType = 0; > - VendorID = 0; > - for (Function = 0; Function < PCI_MAX_PCI_FUNCTIONS; > Function++) { > - /* > -* If this is not a multi-function device, we skip > the rest. > -*/ > - if (Function && !(HeaderType & 0x80)) > - break; > - > - dev = PCI_BDF(BusNum, Device, Function); > - > - if (pci_skip_dev(hose, dev)) > - continue; > - > - ret = pci_read_config_word(dev, PCI_VENDOR_ID, > - &VendorID); > - if (ret) > - goto error; > - if ((VendorID == 0x) || (VendorID == 0x)) > - continue; > - > - if (!Function) pci_read_config_byte(dev, > PCI_HEADER_TYPE, &HeaderType); > - > - if (ShortPCIListing) > - { > - printf("%02x.%02x.%02x ", BusNum, Device, > Function); > - pci_header_show_brief(dev); > - } > - else > - { > - printf("\nFound PCI device %02x.%02x.%02x:\n", > - BusNum, Device, Function); > - pci_header_show(dev); > - } > - } > - } > - > - return; > -error: > - printf("Cannot read bus configuration: %d\n", ret); > -} > - > - > -/* > - * Subroutine: pci_header_show_brief > - * > - * Description: Reads and prints the header of the > - * specified PCI device in short form. > - * > - * Inputs: dev Bus+Device+Function number > - * > - * Return: None > - * > - */ > -void pci_header_show_brief(pci_dev_t dev) > -{ > - u16 vendor, device; > - u8 class, subclass; > - > - pci_read_config_word(dev, PCI_VENDOR_ID, &vendor); > - pci_read_config_word(dev, PCI_DEVICE_ID, &device); > - pci_read_config_byte(dev, PCI_CLASS_CODE, &class); > - pci_read_config_byte(dev, PCI_CLASS_SUB_CODE, &subclass); > - > - printf("0x%.4x 0x%.4x %-23s 0x%.2x\n", > - vendor, device, > - pci_class_str(class), subclass); > -} > - > struct pci_reg_info { > const char *name; > enum pci_size_t size; > @@ -283,10 +174,10 @@ void pci_header_show(pci_dev_t dev) > { > u8 _byte, header_type; > > + pci_read_config_byte(dev, PCI_CLASS_CODE, &_byte); > pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); > pci_show_regs(dev, regs_start); > > - pci_read_config_byte(dev, PCI_CLASS_CODE, &_byte); > printf(" class code = 0x%.2x (%s)\n", _byte, >pci_class_str(_byte)); > pci_show_regs(dev, regs_rest); > @@ -308,6 +199,111 @@ void pci_header_show(pci_dev_t dev) > } > } > > +/* > + * Subroutine: pci_header_
[U-Boot] [PATCH 2/6] gpt: command: cosmetic: Replace printf with puts
This code is not processing any data to serial console output and hence can be replaced with puts. Signed-off-by: Lukasz Majewski --- common/cmd_gpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c index 4da2de7..4c71125 100644 --- a/common/cmd_gpt.c +++ b/common/cmd_gpt.c @@ -281,11 +281,11 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part) &str_disk_guid, &partitions, &part_count); if (ret) { if (ret == -1) - printf("No partition list provided\n"); + puts("No partition list provided\n"); if (ret == -2) - printf("Missing disk guid\n"); + puts("Missing disk guid\n"); if ((ret == -3) || (ret == -4)) - printf("Partition list incomplete\n"); + puts("Partition list incomplete\n"); return -1; } -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/6] gpt: doc: Update gpt command's help description
Signed-off-by: Lukasz Majewski --- common/cmd_gpt.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c index 4c71125..be54eae 100644 --- a/common/cmd_gpt.c +++ b/common/cmd_gpt.c @@ -350,7 +350,10 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt, "GUID Partition Table", " \n" - " - GUID partition table restoration\n" - " Restore GPT information on a device connected\n" + " - GUID partition table restoration and validity check\n" + " Restore or verify GPT information on a device connected\n" " to interface\n" + " Example usage:\n" + " gpt write mmc 0 $partitions\n" + " gpt verify mmc 0 $partitions\n" ); -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/6] gpt: command: Add support for "gpt verify" command
Up till now "gpt" command was only able to write (i.e. restore) GPT partition on specified medium with information provided at "$partitions" env variable. This patch series adds complementary feature - namely "gpt verify", which allows checking (at e.g. boot time) if previously created GPT layout is still correct. This patch series clearly applies on top of u-boot/master: SHA1: cad04990715f7eaecd45196e84cf10e9e3248dae It has been tested on Beaglebone Black development board (Sitara AM335x CPU). Lukasz Majewski (6): gpt: command: Remove duplicated check for empty partition description gpt: command: cosmetic: Replace printf with puts gpt: doc: README: Update README entry for gpt verify extension gpt: doc: Update gpt command's help description gpt: part: Definition and declaration of GPT verification functions gpt: command: Extend gpt command to support GPT table verification common/cmd_gpt.c | 106 ++- disk/part_efi.c | 101 doc/README.gpt | 26 +- include/part.h | 35 ++ 4 files changed, 235 insertions(+), 33 deletions(-) -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/6] gpt: command: Extend gpt command to support GPT table verification
This commit adds support for "gpt verify" command, which verifies correctness of on-board stored GPT partition table. As the optional parameter one can provide '$partitons' environment variable to check if partition data (size, offset, name) is correct. This command should be regarded as complementary one to "gpt restore". Signed-off-by: Lukasz Majewski --- common/cmd_gpt.c | 90 +--- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c index be54eae..ddad4b2 100644 --- a/common/cmd_gpt.c +++ b/common/cmd_gpt.c @@ -1,6 +1,9 @@ /* * cmd_gpt.c -- GPT (GUID Partition Table) handling command * + * Copyright (C) 2015 + * Lukasz Majewski + * * Copyright (C) 2012 Samsung Electronics * author: Lukasz Majewski * author: Piotr Wilczek @@ -15,6 +18,7 @@ #include #include #include +#include #ifndef CONFIG_PARTITION_UUIDS #error CONFIG_PARTITION_UUIDS must be enabled for CONFIG_CMD_GPT to be enabled @@ -297,6 +301,43 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part) return ret; } +static int gpt_verify(block_dev_desc_t *blk_dev_desc, const char *str_part) +{ + ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, +blk_dev_desc->blksz); + disk_partition_t *partitions = NULL; + gpt_entry *gpt_pte = NULL; + char *str_disk_guid; + u8 part_count = 0; + int ret = 0; + + /* fill partitions */ + ret = set_gpt_info(blk_dev_desc, str_part, + &str_disk_guid, &partitions, &part_count); + if (ret) { + if (ret == -1) { + puts("No partition list provided - only basic check\n"); + ret = gpt_verify_headers(blk_dev_desc, gpt_head, +&gpt_pte); + goto out; + } + if (ret == -2) + printf("Missing disk guid\n"); + if ((ret == -3) || (ret == -4)) + printf("Partition list incomplete\n"); + return -1; + } + + /* Check partition layout with provided pattern */ + ret = gpt_verify_partitions(blk_dev_desc, partitions, part_count, + gpt_head, &gpt_pte); + free(str_disk_guid); + free(partitions); + out: + free(gpt_pte); + return ret; +} + /** * do_gpt(): Perform GPT operations * @@ -312,39 +353,40 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int ret = CMD_RET_SUCCESS; int dev = 0; char *ep; - block_dev_desc_t *blk_dev_desc; + block_dev_desc_t *blk_dev_desc = NULL; - if (argc < 5) + if (argc < 4 || argc > 5) return CMD_RET_USAGE; - /* command: 'write' */ - if ((strcmp(argv[1], "write") == 0) && (argc == 5)) { - dev = (int)simple_strtoul(argv[3], &ep, 10); - if (!ep || ep[0] != '\0') { - printf("'%s' is not a number\n", argv[3]); - return CMD_RET_USAGE; - } - blk_dev_desc = get_dev(argv[2], dev); - if (!blk_dev_desc) { - printf("%s: %s dev %d NOT available\n", - __func__, argv[2], dev); - return CMD_RET_FAILURE; - } + dev = (int)simple_strtoul(argv[3], &ep, 10); + if (!ep || ep[0] != '\0') { + printf("'%s' is not a number\n", argv[3]); + return CMD_RET_USAGE; + } + blk_dev_desc = get_dev(argv[2], dev); + if (!blk_dev_desc) { + printf("%s: %s dev %d NOT available\n", + __func__, argv[2], dev); + return CMD_RET_FAILURE; + } + if ((strcmp(argv[1], "write") == 0) && (argc == 5)) { puts("Writing GPT: "); - ret = gpt_default(blk_dev_desc, argv[4]); - if (!ret) { - puts("success!\n"); - return CMD_RET_SUCCESS; - } else { - puts("error!\n"); - return CMD_RET_FAILURE; - } + } else if ((strcmp(argv[1], "verify") == 0)) { + ret = gpt_verify(blk_dev_desc, argv[4]); + puts("Verify GPT: "); } else { return CMD_RET_USAGE; } - return ret; + + if (ret) { + puts("error!\n"); + return CMD_RET_FAILURE; + } + + puts("success!\n"); + return CMD_RET_SUCCESS; } U_BOOT_CMD(gpt, CONFIG_SYS_MAXARGS, 1, do_gpt, -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/6] gpt: doc: README: Update README entry for gpt verify extension
./doc/README.gpt entry has been updated to explain usage of "gpt verify" command. Signed-off-by: Lukasz Majewski --- doc/README.gpt | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/README.gpt b/doc/README.gpt index 59fdeeb..9fe97b0 100644 --- a/doc/README.gpt +++ b/doc/README.gpt @@ -167,9 +167,33 @@ To restore GUID partition table one needs to: 2. Define 'CONFIG_EFI_PARTITION' and 'CONFIG_CMD_GPT' -2. From u-boot prompt type: +3. From u-boot prompt type: gpt write mmc 0 $partitions +Checking (validating) GPT partitions in U-Boot: +=== + +Procedure is the same as above. The only change is at point 3. + +At u-boot prompt one needs to write: + gpt verify mmc 0 [$partitions] + +where [$partitions] is an optional parameter. + +When it is not provided, only basic checks based on CRC32 calculation for GPT +header and PTEs are performed. +When provided, additionally partition data - name, size and starting +offset (last two in LBA) - are compared with data defined in '$partitions' +environment variable. + +After running this command, return code is set to 0 if no errors found in +on non-volatile medium stored GPT. + +Following line can be used to assess if GPT verification has succeed: + +U-BOOT> gpt verify mmc 0 $partitions +U-BOOT> if test $? = 0; then echo "GPT OK"; else echo "GPT ERR"; fi + Useful info: -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/6] gpt: part: Definition and declaration of GPT verification functions
This commit provides definition and declaration of GPT verification functions - namely gpt_verify_headers() and gpt_verify_partitions(). The former is used to only check CRC32 of GPT's header and PTEs. The latter examines each partition entry and compare attributes such as: name, start offset and size with ones provided at '$partitions' env variable. Signed-off-by: Lukasz Majewski --- disk/part_efi.c | 101 include/part.h | 35 2 files changed, 136 insertions(+) diff --git a/disk/part_efi.c b/disk/part_efi.c index 15627f2..59edf38 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -549,6 +549,107 @@ err: return ret; } +static void gpt_convert_efi_name_to_char(char *s, efi_char16_t *es, int n) +{ + char *ess = (char *)es; + int i, j; + + memset(s, '\0', n); + + for (i = 0, j = 0; j < n; i += 2, j++) { + s[j] = ess[i]; + if (!ess[i]) + return; + } +} + +int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head, + gpt_entry **gpt_pte) +{ + /* +* This function validates AND +* fills in the GPT header and PTE +*/ + if (is_gpt_valid(dev_desc, +GPT_PRIMARY_PARTITION_TABLE_LBA, +gpt_head, gpt_pte) != 1) { + printf("%s: *** ERROR: Invalid GPT ***\n", + __func__); + return -1; + } + if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), +gpt_head, gpt_pte) != 1) { + printf("%s: *** ERROR: Invalid Backup GPT ***\n", + __func__); + return -1; + } + + return 0; +} + +int gpt_verify_partitions(block_dev_desc_t *dev_desc, + disk_partition_t *partitions, int parts, + gpt_header *gpt_head, gpt_entry **gpt_pte) +{ + char efi_str[PARTNAME_SZ + 1]; + u64 gpt_part_size; + gpt_entry *gpt_e; + int ret, i; + + ret = gpt_verify_headers(dev_desc, gpt_head, gpt_pte); + if (ret) + return ret; + + gpt_e = *gpt_pte; + + for (i = 0; i < parts; i++) { + if (i == gpt_head->num_partition_entries) { + error("More partitions than allowed!\n"); + return -1; + } + + /* Check if GPT and ENV partition names match */ + gpt_convert_efi_name_to_char(efi_str, gpt_e[i].partition_name, +PARTNAME_SZ + 1); + + debug("%s: part: %2d name - GPT: %16s, ENV: %16s ", + __func__, i, efi_str, partitions[i].name); + + if (strncmp(efi_str, (char *)partitions[i].name, + sizeof(partitions->name))) { + error("Partition name: %s does not match %s!\n", + efi_str, (char *)partitions[i].name); + return -1; + } + + /* Check if GPT and ENV start LBAs match */ + debug("start LBA - GPT: %8llu, ENV: %8llu ", + le64_to_cpu(gpt_e[i].starting_lba), + (u64) partitions[i].start); + + if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) { + error("Partition %s start: %llu does not match %llu!\n", + efi_str, le64_to_cpu(gpt_e[i].starting_lba), + (u64) partitions[i].start); + return -1; + } + + /* Check if GPT and ENV sizes match */ + gpt_part_size = le64_to_cpu(gpt_e[i].ending_lba) - + le64_to_cpu(gpt_e[i].starting_lba) + 1; + debug("size(LBA) - GPT: %8llu, ENV: %8llu\n", + gpt_part_size, (u64) partitions[i].size); + + if (le64_to_cpu(gpt_part_size) != partitions[i].size) { + error("Partition %s size: %llu does not match %llu!\n", + efi_str, gpt_part_size, (u64) partitions[i].size); + return -1; + } + } + + return 0; +} + int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf) { gpt_header *gpt_h; diff --git a/include/part.h b/include/part.h index 8ea9b30..4152052 100644 --- a/include/part.h +++ b/include/part.h @@ -264,6 +264,41 @@ int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf); * @return - '0' on success, otherwise error */ int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf); + +/** + * gpt_verify_headers() - Function to read and CRC32 check of the GPT's header + *and partition table entries (PTE) + * + * As a side effect if sets gpt_head and gpt_pte so they point to GPT data.
[U-Boot] [PATCH 1/6] gpt: command: Remove duplicated check for empty partition description
Exactly the same check is performed in set_gpt_info() function executed just after this check. Signed-off-by: Lukasz Majewski --- common/cmd_gpt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c index c56fe15..4da2de7 100644 --- a/common/cmd_gpt.c +++ b/common/cmd_gpt.c @@ -276,9 +276,6 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part) u8 part_count = 0; disk_partition_t *partitions = NULL; - if (!str_part) - return -1; - /* fill partitions */ ret = set_gpt_info(blk_dev_desc, str_part, &str_disk_guid, &partitions, &part_count); -- 2.1.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] Fix board init code to use a valid C runtime environment
Hello Thomas, On Thu, 12 Nov 2015 13:59:28 +0800, Thomas Chou wrote: > Hi Albert, > - /* Update stack- and frame-pointers */ > - mov sp, r2 > - mov fp, sp Just a sec here on second thought. I understand the 'mov sp, r2' must be removed as it is replaced by a 'sub sp, sp, r2' a few lines earlier. But doesn't the 'mov fp, sp' need to remain? Without it, fp is not set any more, is it? > Best regards, > Thomas Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] QSPI XIP boot on am437x
Hello Vignesh, On Fri, 13 Nov 2015 11:22:19 +0530, Vignesh R wrote: > Hi, > > On 11/11/2015 02:33 PM, Albert ARIBAUD wrote: > > [...] > > > Alternatively, you could test the patch at > > > > http://patchwork.ozlabs.org/patch/542558/ > > > > Let us know if this solves your issue. If it does, then it will confirm > > the issue is with arch_setup_gd not being able to set up your GD for > > some reason. > > > > IMPORTANT: patch 542558 is *not* a final patch (there will be at least > > a v3), and may even never land in u-boot/master; but some equivalent will > > eventually do. Right now, patch 542558 is only a way to test if your > > issue is a GD one. > > > > The above patch affects the code that executes after s_init(), therefore > I don't think above patch matters (_main is run after s_init()). See (1) below. > As you said in your first reply "If s_init() runs before > board_init_f_mem(), then you must move it to > run after board_init_f_mem().", this is the problem with my case. > s_init() is running *before* setting up of global_data in > arch/arm/lib/crt0.S (in _main), hence IMO, calling serial_init() in > s_init() is wrong. This has to be moved to board_init_f() (in > arch/arm/cpu/armv7/am33xx/board.c). > The comment in arch/arm/cpu/armv7/lowlevel_init.S that calls s_init() > also says *not* to access global_data and not to try to start console. > Therefore, I intend to do something like this: > > diff --git a/arch/arm/cpu/armv7/am33xx/board.c > b/arch/arm/cpu/armv7/am33xx/board.c > index bd14326cf479..351fc37b0483 100644 > --- a/arch/arm/cpu/armv7/am33xx/board.c > +++ b/arch/arm/cpu/armv7/am33xx/board.c > @@ -256,6 +256,11 @@ void board_init_f(ulong dummy) > { > board_early_init_f(); > sdram_init(); > +#if defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT) > + gd->baudrate = CONFIG_BAUDRATE; > + serial_init(); > + gd->have_console = 1; > +#endif > } > #endif /* end CONFIG_SPL_BUILD */ > > @@ -273,12 +278,6 @@ void s_init(void) > set_uart_mux_conf(); > setup_clocks_for_console(); > uart_soft_reset(); > -#if defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT) > - /* TODO: This does not work, gd is not available yet */ > - gd->baudrate = CONFIG_BAUDRATE; > - serial_init(); > - gd->have_console = 1; > -#endif > #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC) > /* Enable RTC32K clock */ > rtc32k_enable(); > > Do you see any issues with above change? (1) So your s_init runs even before board_init_f_mem(), right? Your working fix seems to imply that as long as s_init() is run after board_init_f_mem (and any time before board_init_f) it will work. If so, then another, fix, preferable to the above, would be that the call to s_init be moved between those to board_init_f_mem and board_init_f. Can you test that? Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] arm: socfpga: reset: FIX address of tstscratch register
Hi Philipp, On 12.11.2015 18:23, Philipp Rosenberger wrote: The Cyclone V Hard Processor System Technical Reference Manual in the chapter about the Reset Manager Module Address Map stats that the offset of the tstscratch register ist 0x54 not 0x24. Cyclone V Hard Processor System Technical Reference Manual cv_5v4 2015.11.02 page 3-17 Reset Manager Module Address Map Signed-off-by: Philipp Rosenberger --- arch/arm/mach-socfpga/include/mach/reset_manager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager.h b/arch/arm/mach-socfpga/include/mach/reset_manager.h index 8e59578..6eb6011 100644 --- a/arch/arm/mach-socfpga/include/mach/reset_manager.h +++ b/arch/arm/mach-socfpga/include/mach/reset_manager.h @@ -25,6 +25,7 @@ struct socfpga_reset_manager { u32 per2_mod_reset; u32 brg_mod_reset; u32 misc_mod_reset; + u32 padding2[12]; u32 tstscratch; }; Thanks. But usually such padding things are added as "u8" (1 byte) variables. This makes it easier to calculate the offsets. In this case: + u8 padding2[0x30]; which I would prefer. Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] MPC83xx maintainership
On 28.10.2015 16:17, Sinan Akman wrote: On 28/10/15 07:53 AM, Stefan Roese wrote: Hi Dirk, On 28.10.2015 12:03, Dirk Eibach wrote: is Kim Philipps still active as MPC83xx maintainer? Is he active at freescale at all? His mails are bouncing with "User unknown"... No. He is working for ARM now. I've added him with his private mail address to Cc. Kim, I hope you don't mind. Please let us know if you will continue with your MPC83xx custodianship. Or would like to step down, now that you don't work for FSL any more. We have set of 83xx FSL boards (actually I think we have all of them) if this helps us to maintain MPC83xx further. Thanks for the offer. BTW, I think you bcc'ed to Kim so he won't receive this message. I did cc Kim, but the ML removed the address - this happens in some cases. I've added Kim again to Cc, and here Kims mail address in the mail body. In case the Cc'ed address gets removed again: Kim Phillips Thanks, Stefan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH RESEND V2 04/12] board: freescale: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/freescale common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Minghuan Lian Cc: Ying Zhang Cc: Pavel Machek Cc: "Łukasz Majewski" Cc: Scott Wood Cc: Masahiro Yamada Cc: Zhao Qiang Cc: Jan Kiszka Cc: Tom Warren Cc: tang yuantian Cc: Gong Qianyu Cc: Suresh Gupta Cc: Nishanth Menon Cc: Simon Glass Cc: Anatolij Gustschin Cc: Shaveta Leekha Cc: Chunhe Lan Cc: Shaohui Xie Cc: Priyanka Jain Cc: Poonam Aggrwal Cc: Shengzhou Liu Cc: Timur Tabi Cc: Adrian Alonso Cc: Peng Fan Cc: Fabio Estevam Cc: York Sun Cc: Dave Liu Cc: Prabhakar Kushwaha Cc: Mingkai Hu Cc: Alison Wang Cc: Naveen Burmi Signed-off-by: Nishanth Menon --- Too Many folks in Cc, so I am reposting with with --suppress-cc=all. Apologies on the spam board/freescale/b4860qds/b4860qds.c | 8 board/freescale/b4860qds/eth_b4860qds.c | 6 +++--- board/freescale/b4860qds/spl.c| 2 +- board/freescale/bsc9132qds/bsc9132qds.c | 2 +- board/freescale/common/arm_sleep.c| 2 +- board/freescale/common/cds_pci_ft.c | 2 +- board/freescale/common/ics307_clk.c | 6 +++--- board/freescale/common/idt8t49n222a_serdes_clk.c | 2 +- board/freescale/common/{ => include/board-common}/cadmus.h| 0 board/freescale/common/{ => include/board-common}/dcu_sii9022a.h | 0 board/freescale/common/{ => include/board-common}/diu_ch7301.h| 0 board/freescale/common/{ => include/board-common}/eeprom.h| 0 board/freescale/common/{ => include/board-common}/fman.h | 0 .../common/{ => include/board-common}/idt8t49n222a_serdes_clk.h | 0 board/freescale/common/{ => include/board-common}/ngpixis.h | 0 board/freescale/common/{ => include/board-common}/pfuze.h | 0 board/freescale/common/{ => include/board-common}/pixis.h | 0 board/freescale/common/{ => include/board-common}/pq-mds-pib.h| 0 board/freescale/common/{ => include/board-common}/qixis.h | 0 board/freescale/common/{ => include/board-common}/sgmii_riser.h | 0 board/freescale/common/{ => include/board-common}/sleep.h | 0 board/freescale/common/{ => include/board-common}/via.h | 0 board/freescale/common/{ => include/board-common}/vid.h | 0 board/freescale/common/{ => include/board-common}/vsc3316_3308.h | 0 board/freescale/common/{ => include/board-common}/zm7300.h| 0 board/freescale/common/mpc85xx_sleep.c| 2 +- board/freescale/common/ngpixis.c | 2 +- board/freescale/common/pq-mds-pib.c | 2 +- board/freescale/common/qixis.c| 2 +- board/freescale/common/sys_eeprom.c | 2 +- board/freescale/common/vid.c | 2 +- board/freescale/common/vsc3316_3308.c | 2 +- board/freescale/common/zm7300.c | 2 +- board/freescale/corenet_ds/corenet_ds.c | 2 +- board/freescale/corenet_ds/eth_hydra.c| 4 ++-- board/freescale/corenet_ds/eth_p4080.c| 4 ++-- board/freescale/corenet_ds/eth_superhydra.c | 4 ++-- board/freescale/ls1021aqds/dcu.c | 2 +- board/freescale/ls1021aqds/eth.c | 4 ++-- board/freescale/ls1021aqds/ls1021aqds.c | 4 ++-- board/freescale/ls1021atwr/dcu.c | 2 +- board/freescale/ls1021atwr/ls1021atwr.c | 2 +- board/freescale/ls1043ardb/eth.c | 2 +- board/freescale/ls2085aqds/eth.c | 2 +- board/freescale/ls2085aqds/ls2085aqds.c | 2 +- board/freescale/ls2085ardb/ls2085ardb.c | 2 +- board/freescale/mpc832xemds/mpc832xemds.c | 2 +- board/freescale/mpc832xemds/pci.c | 2 +- board/freescale/mpc837xemds/mpc837xemds.c | 2 +- b
[U-Boot] [PATCH V2 06/12] board: keymile: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/keymile common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Valentin Longchamp Cc: Holger Brunck Signed-off-by: Nishanth Menon --- board/keymile/common/common.c| 2 +- board/keymile/common/{ => include/board-common}/common.h | 0 board/keymile/common/ivm.c | 2 +- board/keymile/km82xx/km82xx.c| 2 +- board/keymile/km83xx/km83xx.c| 2 +- board/keymile/km83xx/km83xx_i2c.c| 2 +- board/keymile/km_arm/km_arm.c| 2 +- board/keymile/kmp204x/kmp204x.c | 2 +- board/keymile/kmp204x/qrio.c | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) rename board/keymile/common/{ => include/board-common}/common.h (100%) diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index b9aff1a84dcb..4f8b68ee5ccd 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -21,7 +21,7 @@ #if defined(CONFIG_POST) #include "post.h" #endif -#include "common.h" +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/keymile/common/common.h b/board/keymile/common/include/board-common/common.h similarity index 100% rename from board/keymile/common/common.h rename to board/keymile/common/include/board-common/common.h diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c index 42db54221bb3..4d2963ad5f84 100644 --- a/board/keymile/common/ivm.c +++ b/board/keymile/common/ivm.c @@ -8,7 +8,7 @@ #include #include #include -#include "common.h" +#include #define MAC_STR_SZ 20 diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index c599b4093626..73d22dc6ac19 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -16,7 +16,7 @@ #endif #include -#include "../common/common.h" +#include static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN]; diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 89e9e1e57c38..83deca56aebc 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -26,7 +26,7 @@ #include #include -#include "../common/common.h" +#include static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN]; diff --git a/board/keymile/km83xx/km83xx_i2c.c b/board/keymile/km83xx/km83xx_i2c.c index c961937530ac..e702a5cf86e2 100644 --- a/board/keymile/km83xx/km83xx_i2c.c +++ b/board/keymile/km83xx/km83xx_i2c.c @@ -9,7 +9,7 @@ #include #include #include -#include "../common/common.h" +#include static void i2c_write_start_seq(void) { diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index 2938861f368f..82fa31c2208d 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -23,7 +23,7 @@ #include #include -#include "../common/common.h" +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c index eebb47fc21f1..fbe6d98af6ce 100644 --- a/board/keymile/kmp204x/kmp204x.c +++ b/board/keymile/kmp204x/kmp204x.c @@ -21,7 +21,7 @@ #include #include -#include "../common/common.h" +#include #include "kmp204x.h" DECLARE_GLOBAL_DATA_PTR; diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c index edf3bf11a894..a4c25e084846 100644 --- a/board/keymile/kmp204x/qrio.c +++ b/board/keymile/kmp204x/qrio.c @@ -7,7 +7,7 @@ #include -#include "../common/common.h" +#include #include "kmp204x.h" /* QRIO GPIO register offsets */ -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 03/12] board: compulab: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/compulab common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Dmitry Lifshitz Cc: Igor Grinberg Cc: Nikita Kiryanov Signed-off-by: Nishanth Menon --- board/compulab/cm_fx6/cm_fx6.c| 4 ++-- board/compulab/cm_t335/cm_t335.c | 2 +- board/compulab/cm_t35/cm_t35.c| 4 ++-- board/compulab/cm_t3517/cm_t3517.c| 4 ++-- board/compulab/cm_t54/cm_t54.c| 2 +- board/compulab/common/common.c| 4 ++-- board/compulab/common/eeprom.c| 2 +- board/compulab/common/{ => include/board-common}/common.h | 0 board/compulab/common/{ => include/board-common}/eeprom.h | 0 board/compulab/common/omap3_smc911x.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename board/compulab/common/{ => include/board-common}/common.h (100%) rename board/compulab/common/{ => include/board-common}/eeprom.h (100%) diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 01871e100af3..ef50ce948f61 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -29,8 +29,8 @@ #include #include #include "common.h" -#include "../common/eeprom.h" -#include "../common/common.h" +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c index 428aee6d242f..b3d62472cdf2 100644 --- a/board/compulab/cm_t335/cm_t335.c +++ b/board/compulab/cm_t335/cm_t335.c @@ -18,7 +18,7 @@ #include #include -#include "../common/eeprom.h" +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index ccefc40eb013..45452acf0323 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -33,8 +33,8 @@ #include #include -#include "../common/common.h" -#include "../common/eeprom.h" +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c index d1c74db0ade4..476cfdbbc1f6 100644 --- a/board/compulab/cm_t3517/cm_t3517.c +++ b/board/compulab/cm_t3517/cm_t3517.c @@ -24,8 +24,8 @@ #include #include -#include "../common/common.h" -#include "../common/eeprom.h" +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c index 6d3b18ac1896..eefd813f7bae 100644 --- a/board/compulab/cm_t54/cm_t54.c +++ b/board/compulab/cm_t54/cm_t54.c @@ -22,7 +22,7 @@ #include #include -#include "../common/eeprom.h" +#include #define DIE_ID_REG_BASE(OMAP54XX_L4_CORE_BASE + 0x2000) #define DIE_ID_REG_OFFSET 0x200 diff --git a/board/compulab/common/common.c b/board/compulab/common/common.c index b25d9a20b403..7b64e40304c0 100644 --- a/board/compulab/common/common.c +++ b/board/compulab/common/common.c @@ -10,8 +10,8 @@ #include #include -#include "common.h" -#include "eeprom.h" +#include +#include void cl_print_pcb_info(void) { diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index 630446820cc5..30aaf74d422f 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -9,7 +9,7 @@ #include #include -#include "eeprom.h" +#include #ifndef CONFIG_SYS_I2C_EEPROM_ADDR # define CONFIG_SYS_I2C_EEPROM_ADDR0x50 diff --git a/board/compulab/common/common.h b/board/compulab/common/include/board-common/common.h similarity index 100% rename from board/compulab/common/common.h rename to board/compulab/common/include/board-common/common.h diff --git a/board/compulab/common/eeprom.h b/board/compulab/common/include/board-common/eeprom.h similarity index 100% rename from board/compulab/common/eeprom.h rename to board/compulab/common/include/board-common/eeprom.h diff --git a/board/compulab/common/omap3_smc911x.c b/board/compulab/common/omap3_smc911x.c index 45616619877a..46564632db15 100644 --- a/board/compulab/common/omap3_smc911x.c +++ b/board/compulab/common/omap3_smc911x.c @@ -16,7 +16,7 @@ #include #include -#include "common.h" +#include static u32 cl_omap3_smc911x_gpmc_net_config[GPMC_MAX_REG] = { NET_GPMC_CONFIG1, -- 2.6.2.402.g2635c2b __
[U-Boot] [PATCH V2 11/12] board: varisys: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/varisys common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Alison Wang Cc: Pavel Machek Cc: Masahiro Yamada Cc: York Sun Cc: Andy Fleming Signed-off-by: Nishanth Menon --- board/varisys/common/{ => include/board-common}/eeprom.h | 0 board/varisys/common/sys_eeprom.c| 2 +- board/varisys/cyrus/cyrus.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename board/varisys/common/{ => include/board-common}/eeprom.h (100%) diff --git a/board/varisys/common/eeprom.h b/board/varisys/common/include/board-common/eeprom.h similarity index 100% rename from board/varisys/common/eeprom.h rename to board/varisys/common/include/board-common/eeprom.h diff --git a/board/varisys/common/sys_eeprom.c b/board/varisys/common/sys_eeprom.c index b55ab818e698..cee0bbcf0bfb 100644 --- a/board/varisys/common/sys_eeprom.c +++ b/board/varisys/common/sys_eeprom.c @@ -16,7 +16,7 @@ #include #include -#include "eeprom.h" +#include #ifdef CONFIG_SYS_I2C_EEPROM_NXID_MAC #define MAX_NUM_PORTS CONFIG_SYS_I2C_EEPROM_NXID_MAC diff --git a/board/varisys/cyrus/cyrus.c b/board/varisys/cyrus/cyrus.c index 79c363cf841a..6ce7814cb3b9 100644 --- a/board/varisys/cyrus/cyrus.c +++ b/board/varisys/cyrus/cyrus.c @@ -20,7 +20,7 @@ #include #include "cyrus.h" -#include "../common/eeprom.h" +#include DECLARE_GLOBAL_DATA_PTR; -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 05/12] board: gdsys: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/gdsys common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Stefan Roese Cc: Dirk Eibach Signed-off-by: Nishanth Menon --- board/gdsys/405ep/dlvision-10g.c | 2 +- board/gdsys/405ep/iocon.c | 6 +++--- board/gdsys/common/{ => include/board-common}/dp501.h | 0 board/gdsys/common/{ => include/board-common}/mclink.h | 0 board/gdsys/common/{ => include/board-common}/osd.h| 0 board/gdsys/common/{ => include/board-common}/phy.h| 0 board/gdsys/common/osd.c | 2 +- board/gdsys/mpc8308/hrcon.c| 6 +++--- board/gdsys/p1022/controlcenterd.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename board/gdsys/common/{ => include/board-common}/dp501.h (100%) rename board/gdsys/common/{ => include/board-common}/mclink.h (100%) rename board/gdsys/common/{ => include/board-common}/osd.h (100%) rename board/gdsys/common/{ => include/board-common}/phy.h (100%) diff --git a/board/gdsys/405ep/dlvision-10g.c b/board/gdsys/405ep/dlvision-10g.c index 35dfbbc577aa..c8eed0aacd90 100644 --- a/board/gdsys/405ep/dlvision-10g.c +++ b/board/gdsys/405ep/dlvision-10g.c @@ -15,7 +15,7 @@ #include "405ep.h" #include -#include "../common/osd.h" +#include #define LATCH0_BASE (CONFIG_SYS_LATCH_BASE) #define LATCH1_BASE (CONFIG_SYS_LATCH_BASE + 0x100) diff --git a/board/gdsys/405ep/iocon.c b/board/gdsys/405ep/iocon.c index 3a51d864cdb1..04799769b353 100644 --- a/board/gdsys/405ep/iocon.c +++ b/board/gdsys/405ep/iocon.c @@ -15,9 +15,9 @@ #include "405ep.h" #include -#include "../common/osd.h" -#include "../common/mclink.h" -#include "../common/phy.h" +#include +#include +#include #include #include diff --git a/board/gdsys/common/dp501.h b/board/gdsys/common/include/board-common/dp501.h similarity index 100% rename from board/gdsys/common/dp501.h rename to board/gdsys/common/include/board-common/dp501.h diff --git a/board/gdsys/common/mclink.h b/board/gdsys/common/include/board-common/mclink.h similarity index 100% rename from board/gdsys/common/mclink.h rename to board/gdsys/common/include/board-common/mclink.h diff --git a/board/gdsys/common/osd.h b/board/gdsys/common/include/board-common/osd.h similarity index 100% rename from board/gdsys/common/osd.h rename to board/gdsys/common/include/board-common/osd.h diff --git a/board/gdsys/common/phy.h b/board/gdsys/common/include/board-common/phy.h similarity index 100% rename from board/gdsys/common/phy.h rename to board/gdsys/common/include/board-common/phy.h diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c index 55ecdf10127e..f528a40e0c41 100644 --- a/board/gdsys/common/osd.c +++ b/board/gdsys/common/osd.c @@ -9,7 +9,7 @@ #include #include -#include "dp501.h" +#include #include #define CH7301_I2C_ADDR 0x75 diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c index e4434b3b6b71..3cbef71d5503 100644 --- a/board/gdsys/mpc8308/hrcon.c +++ b/board/gdsys/mpc8308/hrcon.c @@ -22,9 +22,9 @@ #include -#include "../common/osd.h" -#include "../common/mclink.h" -#include "../common/phy.h" +#include +#include +#include #include #include diff --git a/board/gdsys/p1022/controlcenterd.c b/board/gdsys/p1022/controlcenterd.c index 64d90dd3fde0..2b1d8bafc51f 100644 --- a/board/gdsys/p1022/controlcenterd.c +++ b/board/gdsys/p1022/controlcenterd.c @@ -41,7 +41,7 @@ #include #include #include -#include "../common/dp501.h" +#include #include "controlcenterd-id.h" DECLARE_GLOBAL_DATA_PTR; -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 12/12] board: xes: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/xes common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Peter Tyser Signed-off-by: Nishanth Menon --- board/xes/common/board.c| 2 +- board/xes/common/{ => include/board-common}/fsl_8xxx_misc.h | 0 board/xes/xpedite517x/xpedite517x.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename board/xes/common/{ => include/board-common}/fsl_8xxx_misc.h (100%) diff --git a/board/xes/common/board.c b/board/xes/common/board.c index 4ed6f50e5cf8..ca156e60bec0 100644 --- a/board/xes/common/board.c +++ b/board/xes/common/board.c @@ -5,7 +5,7 @@ */ #include -#include "fsl_8xxx_misc.h" +#include int checkboard(void) { diff --git a/board/xes/common/fsl_8xxx_misc.h b/board/xes/common/include/board-common/fsl_8xxx_misc.h similarity index 100% rename from board/xes/common/fsl_8xxx_misc.h rename to board/xes/common/include/board-common/fsl_8xxx_misc.h diff --git a/board/xes/xpedite517x/xpedite517x.c b/board/xes/xpedite517x/xpedite517x.c index 0028870db077..38c25ccf46b9 100644 --- a/board/xes/xpedite517x/xpedite517x.c +++ b/board/xes/xpedite517x/xpedite517x.c @@ -11,7 +11,7 @@ #include #include #include -#include "../common/fsl_8xxx_misc.h" +#include #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_PCI) extern void ft_board_pci_setup(void *blob, bd_t *bd); -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 10/12] board: siemens: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/siemens common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Paul Kocialkowski Cc: Joe Hershberger Cc: Simon Glass Cc: Samuel Egli Cc: Heiko Schocher Cc: Roger Meier Signed-off-by: Nishanth Menon --- board/siemens/common/board.c | 2 +- board/siemens/common/factoryset.c| 2 +- board/siemens/common/{ => include/board-common}/factoryset.h | 0 board/siemens/draco/board.c | 2 +- board/siemens/pxm2/board.c | 2 +- board/siemens/rut/board.c| 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/siemens/common/{ => include/board-common}/factoryset.h (100%) diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c index c127f6ca271d..00f4e355720a 100644 --- a/board/siemens/common/board.c +++ b/board/siemens/common/board.c @@ -28,7 +28,7 @@ #include #include #include -#include "../common/factoryset.h" +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/siemens/common/factoryset.c b/board/siemens/common/factoryset.c index 6c869ed2b035..827e2a17eb8f 100644 --- a/board/siemens/common/factoryset.c +++ b/board/siemens/common/factoryset.c @@ -17,7 +17,7 @@ #include #include #include -#include "factoryset.h" +#include #define EEPR_PG_SZ 0x80 #define EEPROM_FATORYSET_OFFSET0x400 diff --git a/board/siemens/common/factoryset.h b/board/siemens/common/include/board-common/factoryset.h similarity index 100% rename from board/siemens/common/factoryset.h rename to board/siemens/common/include/board-common/factoryset.h diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c index 48823141daa3..05b10a93a342 100644 --- a/board/siemens/draco/board.c +++ b/board/siemens/draco/board.c @@ -32,7 +32,7 @@ #include #include #include "board.h" -#include "../common/factoryset.h" +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c index 750f33889742..9998a3f52bf4 100644 --- a/board/siemens/pxm2/board.c +++ b/board/siemens/pxm2/board.c @@ -33,7 +33,7 @@ #include #include #include "board.h" -#include "../common/factoryset.h" +#include #include "pmic.h" #include #include diff --git a/board/siemens/rut/board.c b/board/siemens/rut/board.c index f94e3e5736f3..cafcfbd3358f 100644 --- a/board/siemens/rut/board.c +++ b/board/siemens/rut/board.c @@ -32,7 +32,7 @@ #include #include #include "board.h" -#include "../common/factoryset.h" +#include #include "../../../drivers/video/da8xx-fb.h" DECLARE_GLOBAL_DATA_PTR; -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 08/12] board: mpl: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/mpl common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Bin Meng Cc: "David Müller" Cc: Denis Peter Signed-off-by: Nishanth Menon --- board/mpl/common/common_util.c| 2 +- board/mpl/common/{ => include/board-common}/common_util.h | 0 board/mpl/common/{ => include/board-common}/isa.h | 0 board/mpl/common/isa.c| 2 +- board/mpl/common/kbd.c| 2 +- board/mpl/common/pci.c| 2 +- board/mpl/mip405/cmd_mip405.c | 2 +- board/mpl/mip405/mip405.c | 2 +- board/mpl/pip405/cmd_pip405.c | 2 +- board/mpl/pip405/pip405.c | 4 ++-- board/mpl/vcma9/cmd_vcma9.c | 2 +- board/mpl/vcma9/vcma9.c | 2 +- 12 files changed, 11 insertions(+), 11 deletions(-) rename board/mpl/common/{ => include/board-common}/common_util.h (100%) rename board/mpl/common/{ => include/board-common}/isa.h (100%) diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c index 6b96bd526e80..5626ecdf8b48 100644 --- a/board/mpl/common/common_util.c +++ b/board/mpl/common/common_util.c @@ -8,7 +8,7 @@ #include #include #include -#include "common_util.h" +#include #include #include #include diff --git a/board/mpl/common/common_util.h b/board/mpl/common/include/board-common/common_util.h similarity index 100% rename from board/mpl/common/common_util.h rename to board/mpl/common/include/board-common/common_util.h diff --git a/board/mpl/common/isa.h b/board/mpl/common/include/board-common/isa.h similarity index 100% rename from board/mpl/common/isa.h rename to board/mpl/common/include/board-common/isa.h diff --git a/board/mpl/common/isa.c b/board/mpl/common/isa.c index 54ec66bd45b0..83628bba5d58 100644 --- a/board/mpl/common/isa.c +++ b/board/mpl/common/isa.c @@ -10,7 +10,7 @@ #include #include #include -#include "isa.h" +#include #include "piix4_pci.h" #include "kbd.h" #include "video.h" diff --git a/board/mpl/common/kbd.c b/board/mpl/common/kbd.c index 1da72c53989c..cdcee1907dca 100644 --- a/board/mpl/common/kbd.c +++ b/board/mpl/common/kbd.c @@ -10,7 +10,7 @@ #include #include #include -#include "isa.h" +#include #include "kbd.h" diff --git a/board/mpl/common/pci.c b/board/mpl/common/pci.c index cd969cb5182d..ff1822d1cc6f 100644 --- a/board/mpl/common/pci.c +++ b/board/mpl/common/pci.c @@ -10,7 +10,7 @@ #include #include -#include "isa.h" +#include #ifdef CONFIG_405GP #ifdef CONFIG_PCI diff --git a/board/mpl/mip405/cmd_mip405.c b/board/mpl/mip405/cmd_mip405.c index ca6f0affe48f..d71e6dbd3fbc 100644 --- a/board/mpl/mip405/cmd_mip405.c +++ b/board/mpl/mip405/cmd_mip405.c @@ -10,7 +10,7 @@ #include #include #include "mip405.h" -#include "../common/common_util.h" +#include extern void print_mip405_info(void); diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index 4a0d6966a6fa..e762f57ea1a1 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -51,7 +51,7 @@ #include #include #include -#include "../common/common_util.h" +#include #include #include #include diff --git a/board/mpl/pip405/cmd_pip405.c b/board/mpl/pip405/cmd_pip405.c index 43b182e57ebb..5a6e49ef07dd 100644 --- a/board/mpl/pip405/cmd_pip405.c +++ b/board/mpl/pip405/cmd_pip405.c @@ -10,7 +10,7 @@ #include #include #include "pip405.h" -#include "../common/common_util.h" +#include extern void print_pip405_info(void); diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index 7c7690ff555b..e46e8be9d9dd 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -12,8 +12,8 @@ #include #include #include -#include "../common/isa.h" -#include "../common/common_util.h" +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/mpl/vcma9/cmd_vcma9.c b/board/mpl/vcma9/cmd_vcma9.c index c2d62e4aaf4b..c70ae90e0b06 100644 --- a/board/mpl/vcma9/cmd_vcma9.c +++ b/board/mpl/vcma9/cmd_vcma9.c @@ -12,7 +12,7 @@ #include #include #include "vcma9.h" -#include "../common/common_util.h" +#include #if defined(CONFIG_CS8900) #include <../drivers/net/cs8900.
[U-Boot] [PATCH V2 09/12] board: seco: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/seco common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Boris Brezillon Signed-off-by: Nishanth Menon --- board/seco/common/{ => include/board-common}/mx6.h | 0 board/seco/mx6quq7/mx6quq7.c | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename board/seco/common/{ => include/board-common}/mx6.h (100%) diff --git a/board/seco/common/mx6.h b/board/seco/common/include/board-common/mx6.h similarity index 100% rename from board/seco/common/mx6.h rename to board/seco/common/include/board-common/mx6.h diff --git a/board/seco/mx6quq7/mx6quq7.c b/board/seco/mx6quq7/mx6quq7.c index ea1d4b8e4972..fd8104c29398 100644 --- a/board/seco/mx6quq7/mx6quq7.c +++ b/board/seco/mx6quq7/mx6quq7.c @@ -31,7 +31,7 @@ #include #include -#include "../common/mx6.h" +#include DECLARE_GLOBAL_DATA_PTR; -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 02/12] board: BuR: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/BuR common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Joe Hershberger Cc: Simon Glass Cc: Hannes Petermaier Cc: Hannes Schmelzer Signed-off-by: Nishanth Menon --- board/BuR/common/common.c| 2 +- board/BuR/common/{ => include/board-common}/bur_common.h | 0 board/BuR/kwb/board.c| 2 +- board/BuR/tseries/board.c| 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename board/BuR/common/{ => include/board-common}/bur_common.h (100%) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 441465c005ec..9ef7f3444758 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -31,7 +31,7 @@ #ifdef CONFIG_USE_FDT #include #endif -#include "bur_common.h" +#include #include "../../../drivers/video/am335x-fb.h" #include #include diff --git a/board/BuR/common/bur_common.h b/board/BuR/common/include/board-common/bur_common.h similarity index 100% rename from board/BuR/common/bur_common.h rename to board/BuR/common/include/board-common/bur_common.h diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c index 039ec207c26d..45b71a1ba811 100644 --- a/board/BuR/kwb/board.c +++ b/board/BuR/kwb/board.c @@ -25,7 +25,7 @@ #include #include #include -#include "../common/bur_common.h" +#include #include /* -*/ diff --git a/board/BuR/tseries/board.c b/board/BuR/tseries/board.c index bc119e69736e..8cd23aed52aa 100644 --- a/board/BuR/tseries/board.c +++ b/board/BuR/tseries/board.c @@ -26,7 +26,7 @@ #include #include #include -#include "../common/bur_common.h" +#include #include #include -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 07/12] board: LaCie: Move common headers to board-common directory
Header files can be located in a generic location without needing to reference them with ../common/ Generated with the following script #!/bin/bash vendor=board/LaCie common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Cc: Simon Guinot Cc: Albert ARIBAUD Signed-off-by: Nishanth Menon --- board/LaCie/common/cpld-gpio-bus.c| 2 +- board/LaCie/common/{ => include/board-common}/common.h| 0 board/LaCie/common/{ => include/board-common}/cpld-gpio-bus.h | 0 board/LaCie/edminiv2/edminiv2.c | 2 +- board/LaCie/net2big_v2/net2big_v2.c | 4 ++-- board/LaCie/netspace_v2/netspace_v2.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename board/LaCie/common/{ => include/board-common}/common.h (100%) rename board/LaCie/common/{ => include/board-common}/cpld-gpio-bus.h (100%) diff --git a/board/LaCie/common/cpld-gpio-bus.c b/board/LaCie/common/cpld-gpio-bus.c index 9b24dc535c04..92a80243c5e0 100644 --- a/board/LaCie/common/cpld-gpio-bus.c +++ b/board/LaCie/common/cpld-gpio-bus.c @@ -13,7 +13,7 @@ */ #include -#include "cpld-gpio-bus.h" +#include static void cpld_gpio_bus_set_addr(struct cpld_gpio_bus *bus, unsigned addr) { diff --git a/board/LaCie/common/common.h b/board/LaCie/common/include/board-common/common.h similarity index 100% rename from board/LaCie/common/common.h rename to board/LaCie/common/include/board-common/common.h diff --git a/board/LaCie/common/cpld-gpio-bus.h b/board/LaCie/common/include/board-common/cpld-gpio-bus.h similarity index 100% rename from board/LaCie/common/cpld-gpio-bus.h rename to board/LaCie/common/include/board-common/cpld-gpio-bus.h diff --git a/board/LaCie/edminiv2/edminiv2.c b/board/LaCie/edminiv2/edminiv2.c index edf6281797bf..66d0e8502256 100644 --- a/board/LaCie/edminiv2/edminiv2.c +++ b/board/LaCie/edminiv2/edminiv2.c @@ -11,7 +11,7 @@ #include #include #include -#include "../common/common.h" +#include #include #include diff --git a/board/LaCie/net2big_v2/net2big_v2.c b/board/LaCie/net2big_v2/net2big_v2.c index 263bb5426c0d..0bfe76fde334 100644 --- a/board/LaCie/net2big_v2/net2big_v2.c +++ b/board/LaCie/net2big_v2/net2big_v2.c @@ -18,8 +18,8 @@ #include #include "net2big_v2.h" -#include "../common/common.h" -#include "../common/cpld-gpio-bus.h" +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index 17e629622ff7..4ea76d152e6b 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -17,7 +17,7 @@ #include #include "netspace_v2.h" -#include "../common/common.h" +#include DECLARE_GLOBAL_DATA_PTR; -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 00/12] Series to move headers to a consistent include location
Hi, This series is hopefully to setup the stage for consolidation of board/vendor/common include header organization in u-boot. Discussion thread: https://patchwork.ozlabs.org/patch/540280/ https://patchwork.ozlabs.org/patch/541068/ https://patchwork.ozlabs.org/patch/542424/ In short, we: a) Dont want to have symlinks for include headers b) Want to be able to reference headers in reuse by doing #include So, we follow the "option #6" discussed in the last of the threads above. Only the first patch in this series was pasted and discussed previously. The remaining 11 in the series is natural cleanups as a result. The series is Based on: master ade766acfb27 Merge branch 'next' of git://git.denx.de/u-boot-blackfin Script 1: identifying the board/vendors impacted: #!/bin/bash for common in `git grep "../common" board|grep "#include"|cut -d ':' -f1|cut -d '/' -f1,2|sort -u` do cfiles=`git grep "../common" $common|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $common|grep "#include"|cut -d '"' -f2|sort -u|grep h$` if [ -z "$headers" ]; then continue; fi echo $common : $headers : $cfiles done Output: board/BuR : ../common/bur_common.h : board/compulab : ../common/common.h ../common/eeprom.h : board/freescale : ../common/cadmus.h ../common/dcu_sii9022a.h ../common/diu_ch7301.h ../common/eeprom.h ../common/fman.h ../common/idt8t49n222a_serdes_clk.h ../common/ngpixis.h ../common/pfuze.h ../common/pixis.h ../common/pq-mds-pib.h ../common/qixis.h ../common/sgmii_riser.h ../common/sleep.h ../common/via.h ../common/vid.h ../common/vsc3316_3308.h ../common/zm7300.h : board/gdsys : ../common/dp501.h ../common/mclink.h ../common/osd.h ../common/phy.h : board/keymile : ../common/common.h : board/LaCie : ../common/common.h ../common/cpld-gpio-bus.h : board/mpl : ../common/common_util.h ../common/isa.h : board/seco : ../common/mx6.h : board/siemens : ../common/factoryset.h : ../common/board.c board/varisys : ../common/eeprom.h : board/xes : ../common/fsl_8xxx_misc.h : Script2: this is used to move the headers to relevant locations: #!/bin/bash vendor=$1 common=$vendor/common cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$` headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$` mkdir -p $common/include/board-common set -x for header in $headers do echo "processing $header in $common" hbase=`basename $header` git mv $common/$hbase $common/include/board-common sed -i -e "s/\"..\/common\/$hbase\"//g" $vendor/*/*.[chS] sed -i -e "s/\"$hbase\"//g" $vendor/common/*.[chS] done Build tested with the following with at least the ARM platforms: MAKEALL -v compulab -v BuR -v LaCie -v seco -v siemens NOTE: I know this series impacts a lot of platforms.. other than patch #1, they are probably nice to have.. but upto you guys if you'd like it or not.. it will be good to standardize things a bit here. I am *NOT* trying to fix the following code: $ git grep "\.\./common" board/*/*/*.[chS]|sort -u board/amcc/bamboo/flash.c:#include "../common/flash.c" board/amcc/bubinga/flash.c:#include "../common/flash.c" board/amcc/luan/flash.c:#include "../common/flash.c" board/amcc/walnut/flash.c:#include "../common/flash.c" board/esd/cpci2dp/flash.c:#include "../common/flash.c" board/esd/cpci405/cpci405.c:#include "../common/fpga.c" board/esd/cpci405/flash.c:#include "../common/flash.c" board/esd/plu405/flash.c:#include "../common/flash.c" board/esd/plu405/plu405.c:#include "../common/fpga.c" board/esd/vom405/flash.c:#include "../common/flash.c" board/siemens/draco/board.c:#include "../common/board.c" board/siemens/pxm2/board.c:#include "../common/board.c" board/siemens/rut/board.c:#include "../common/board.c" Nishanth Menon (12): Makefile: Include vendor common library in include search path board: BuR: Move common headers to board-common directory board: compulab: Move common headers to board-common directory board: freescale: Move common headers to board-common directory board: gdsys: Move common headers to board-common directory board: keymile: Move common headers to board-common directory board: LaCie: Move common headers to board-common directory board: mpl: Move common headers to board-common directory board: seco: Move common headers to board-common directory board: siemens: Move common headers to board-common directory board: varisys: Move common headers to board-common directory board: xes: Move common headers to board-common directory Makefile | 3 +++ board/BuR/common/common.c | 2 +- board/BuR/common/{ => include/board-common}/bur_common.h | 0 board/BuR/kwb/board.c | 2 +- board/BuR/tseries/board.c
[U-Boot] [PATCH V2 01/12] Makefile: Include vendor common library in include search path
When the vendor common libraries exists, then board should be able to reference headers located from a generic base, rather than having to do weird logic such as '#include "../common/xyz.h"'. There are multiple options of implementation, the current strategy expects that: a) Vendor boards that need generic files will define build in: board/$(VENDOR)/common b) Vendor boards that expose generic functions from (a) for usage from other board specific files will provide these headers in: board/$(VENDOR)/common/include/board-common c) Vendor board files that need these function services will refer #include Where, xyz.h is an example header exposing generic vendor common functions. Cc: Simon Glass Cc: Tom Rini Cc: Masahiro Yamada Cc: Daniel Schwierzeck Cc: Michal Marek Cc: Stefan Roese Cc: Bin Meng Signed-off-by: Nishanth Menon --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 61050adb13f5..e7a3e2b4de51 100644 --- a/Makefile +++ b/Makefile @@ -626,6 +626,9 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags) # U-Boot objectsorder is important (i.e. start must be first) HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) +# Include vendor headers - they should be in the following location. +# board/$(VENDOR)/common/include/board-common +UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common/include) libs-y += lib/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ -- 2.6.2.402.g2635c2b ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 06/14] dm: pci: Rename pci_auto.c to pci_auto_old.c
On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > This file should not be used with driver model as it has lots of legacy/ > compatibility functions. Rename it to make this clear. > > Signed-off-by: Simon Glass > --- > > drivers/pci/Makefile | 2 +- > drivers/pci/{pci_auto.c => pci_auto_old.c} | 0 > 2 files changed, 1 insertion(+), 1 deletion(-) > rename drivers/pci/{pci_auto.c => pci_auto_old.c} (100%) > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > index bcf8127..dee844f 100644 > --- a/drivers/pci/Makefile > +++ b/drivers/pci/Makefile > @@ -13,7 +13,7 @@ obj-$(CONFIG_X86) += pci_x86.o > else > obj-$(CONFIG_PCI) += pci.o > endif > -obj-$(CONFIG_PCI) += pci_common.o pci_auto.o pci_rom.o > +obj-$(CONFIG_PCI) += pci_common.o pci_auto_old.o pci_rom.o > > obj-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o > obj-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o > diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto_old.c > similarity index 100% > rename from drivers/pci/pci_auto.c > rename to drivers/pci/pci_auto_old.c > -- Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 05/14] dm: pci: Add a comment about how to find struct pci_controller
On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > With driver mode, struct pci_controller is stored as uclass-private data. > Add a comment to that effect. > > Signed-off-by: Simon Glass > --- > > include/pci.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/pci.h b/include/pci.h > index 9c19482..c4f6577 100644 > --- a/include/pci.h > +++ b/include/pci.h > @@ -537,6 +537,8 @@ extern void pci_cfgfunc_config_device(struct > pci_controller* hose, pci_dev_t dev > > /* > * Structure of a PCI controller (host bridge) > + * > + * With driver model this is dev_get_uclass_priv(bus) > */ > struct pci_controller { > #ifdef CONFIG_DM_PCI > -- Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 07/14] dm: pci: Move common auto-config functions to a common file
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > Some functions will be used by driver model and legacy PCI code. To avoid > duplication, put these in a separate, shared file. > > Signed-off-by: Simon Glass > --- > > drivers/pci/Makefile | 2 +- > drivers/pci/pci_auto_common.c | 128 > ++ > drivers/pci/pci_auto_old.c| 122 > 3 files changed, 129 insertions(+), 123 deletions(-) > create mode 100644 drivers/pci/pci_auto_common.c > > diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile > index dee844f..1f8f86f 100644 > --- a/drivers/pci/Makefile > +++ b/drivers/pci/Makefile > @@ -13,7 +13,7 @@ obj-$(CONFIG_X86) += pci_x86.o > else > obj-$(CONFIG_PCI) += pci.o > endif > -obj-$(CONFIG_PCI) += pci_common.o pci_auto_old.o pci_rom.o > +obj-$(CONFIG_PCI) += pci_auto_common.o pci_auto_old.o pci_common.o pci_rom.o > > obj-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o > obj-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o > diff --git a/drivers/pci/pci_auto_common.c b/drivers/pci/pci_auto_common.c > new file mode 100644 > index 000..faf904e > --- /dev/null > +++ b/drivers/pci/pci_auto_common.c > @@ -0,0 +1,128 @@ > +/* > + * PCI autoconfiguration library nits: auto configuration > + * > + * Author: Matt Porter > + * > + * Copyright 2000 MontaVista Software Inc. > + * > + * Modifications for driver model: > + * Copyright 2015 Google, Inc > + * Written by Simon Glass > + * > + * SPDX-License-Identifier:GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > + > +void pciauto_region_init(struct pci_region *res) > +{ > + /* > +* Avoid allocating PCI resources from address 0 -- this is illegal > +* according to PCI 2.1 and moreover, this is known to cause Linux IDE > +* drivers to fail. Use a reasonable starting value of 0x1000 instead. > +*/ > + res->bus_lower = res->bus_start ? res->bus_start : 0x1000; > +} > + > +void pciauto_region_align(struct pci_region *res, pci_size_t size) > +{ > + res->bus_lower = ((res->bus_lower - 1) | (size - 1)) + 1; > +} > + > +int pciauto_region_allocate(struct pci_region *res, pci_size_t size, > + pci_addr_t *bar) > +{ > + pci_addr_t addr; > + > + if (!res) { > + debug("No resource"); > + goto error; > + } > + > + addr = ((res->bus_lower - 1) | (size - 1)) + 1; > + > + if (addr - res->bus_start + size > res->size) { > + debug("No room in resource"); > + goto error; > + } > + > + res->bus_lower = addr + size; > + > + debug("address=0x%llx bus_lower=0x%llx", (unsigned long long)addr, > + (unsigned long long)res->bus_lower); > + > + *bar = addr; > + return 0; > + > + error: > + *bar = (pci_addr_t)-1; > + return -1; > +} > + > +void pciauto_config_init(struct pci_controller *hose) > +{ > + int i; > + > + hose->pci_io = NULL; > + hose->pci_mem = NULL; > + hose->pci_prefetch = NULL; > + > + for (i = 0; i < hose->region_count; i++) { > + switch (hose->regions[i].flags) { > + case PCI_REGION_IO: > + if (!hose->pci_io || > + hose->pci_io->size < hose->regions[i].size) > + hose->pci_io = hose->regions + i; > + break; > + case PCI_REGION_MEM: > + if (!hose->pci_mem || > + hose->pci_mem->size < hose->regions[i].size) > + hose->pci_mem = hose->regions + i; > + break; > + case (PCI_REGION_MEM | PCI_REGION_PREFETCH): > + if (!hose->pci_prefetch || > + hose->pci_prefetch->size < hose->regions[i].size) > + hose->pci_prefetch = hose->regions + i; > + break; > + } > + } > + > + > + if (hose->pci_mem) { > + pciauto_region_init(hose->pci_mem); > + > + debug("PCI Autoconfig: Bus Memory region: [0x%llx-0x%llx],\n" > + "\t\tPhysical Memory [%llx-%llxx]\n", > + (u64)hose->pci_mem->bus_start, > + (u64)(hose->pci_mem->bus_start + hose->pci_mem->size - 1), > + (u64)hose->pci_mem->phys_start, > + (u64)(hose->pci_mem->phys_start + hose->pci_mem->size - > 1)); > + } > + > + if (hose->pci_prefetch) { > + pciauto_region_init(hose->pci_prefetch); > + > + debug("PCI Autoconfig: Bus Prefetchable Mem: > [0x%llx-0x%llx],\n" > + "\t\tPhysical Memory [%llx-%llx]\n", > + (u64)hose->pci_prefetch->bus_start, > + (u64)(hose->pci_prefetch->bus_start + > +
Re: [U-Boot] [PATCH 04/14] pci: Refactor the pciinfo() function
Hi Simon, On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > This function uses macros to output data. It seems better to use a table of > registers rather than macro-based code generation. It also reduces the > code/data size by 2KB on ARM. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 235 > ++- > 1 file changed, 147 insertions(+), 88 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 6e28b70..debcd1c 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -130,6 +130,145 @@ void pci_header_show_brief(pci_dev_t dev) >pci_class_str(class), subclass); > } > > +struct pci_reg_info { > + const char *name; > + enum pci_size_t size; > + u8 offset; > +}; > + > +static int pci_field_width(enum pci_size_t size) > +{ > + switch (size) { > + case PCI_SIZE_8: > + return 2; > + case PCI_SIZE_16: > + return 4; > + case PCI_SIZE_32: > + default: > + return 32; This should be 8. > + } > +} > + > +static unsigned long pci_read_config(pci_dev_t dev, int offset, > +enum pci_size_t size) > +{ > + u32 val32; > + u16 val16; > + u8 val8; > + > + switch (size) { > + case PCI_SIZE_8: > + pci_read_config_byte(dev, offset, &val8); > + return val8; > + case PCI_SIZE_16: > + pci_read_config_word(dev, offset, &val16); > + return val16; > + case PCI_SIZE_32: > + default: > + pci_read_config_dword(dev, offset, &val32); > + return val32; > + } > +} > + > +static void pci_show_regs(pci_dev_t dev, struct pci_reg_info *regs) > +{ > + for (; regs->name; regs++) { > + printf(" %s =%*s%#.*lx\n", regs->name, > + (int)(28 - strlen(regs->name)), "", > + pci_field_width(regs->size), > + pci_read_config(dev, regs->offset, regs->size)); > + } > +} > + > +static struct pci_reg_info regs_start[] = { > + { "vendor ID", PCI_SIZE_16, PCI_VENDOR_ID }, > + { "device ID", PCI_SIZE_16, PCI_DEVICE_ID }, > + { "command register ID", PCI_SIZE_16, PCI_COMMAND }, > + { "status register", PCI_SIZE_16, PCI_STATUS }, > + { "revision ID", PCI_SIZE_8, PCI_REVISION_ID }, > + {}, > +}; > + > +static struct pci_reg_info regs_rest[] = { > + { "sub class code", PCI_SIZE_8, PCI_CLASS_SUB_CODE }, > + { "programming interface", PCI_SIZE_8, PCI_CLASS_PROG }, > + { "cache line", PCI_SIZE_8, PCI_CACHE_LINE_SIZE }, > + { "latency time", PCI_SIZE_8, PCI_LATENCY_TIMER }, > + { "header type", PCI_SIZE_8, PCI_HEADER_TYPE }, > + { "BIST", PCI_SIZE_8, PCI_BIST }, > + { "base address 0", PCI_SIZE_32, PCI_BASE_ADDRESS_0 }, > + {}, > +}; > + > +static struct pci_reg_info regs_normal[] = { > + { "base address 1", PCI_SIZE_32, PCI_BASE_ADDRESS_1 }, > + { "base address 2", PCI_SIZE_32, PCI_BASE_ADDRESS_2 }, > + { "base address 3", PCI_SIZE_32, PCI_BASE_ADDRESS_3 }, > + { "base address 4", PCI_SIZE_32, PCI_BASE_ADDRESS_4 }, > + { "base address 5", PCI_SIZE_32, PCI_BASE_ADDRESS_5 }, > + { "cardBus CIS pointer", PCI_SIZE_32, PCI_CARDBUS_CIS }, > + { "sub system vendor ID", PCI_SIZE_16, PCI_SUBSYSTEM_VENDOR_ID }, > + { "sub system ID", PCI_SIZE_16, PCI_SUBSYSTEM_ID }, > + { "expansion ROM base address", PCI_SIZE_32, PCI_ROM_ADDRESS }, > + { "interrupt line", PCI_SIZE_8, PCI_INTERRUPT_LINE }, > + { "interrupt pin", PCI_SIZE_8, PCI_INTERRUPT_PIN }, > + { "min Grant", PCI_SIZE_8, PCI_MIN_GNT }, > + { "max Latency", PCI_SIZE_8, PCI_MAX_LAT }, > + {}, > +}; > + > +static struct pci_reg_info regs_bridge[] = { > + { "base address 1", PCI_SIZE_32, PCI_BASE_ADDRESS_1 }, > + { "primary bus number", PCI_SIZE_8, PCI_PRIMARY_BUS }, > + { "secondary bus number", PCI_SIZE_8, PCI_SECONDARY_BUS }, > + { "subordinate bus number", PCI_SIZE_8, PCI_SUBORDINATE_BUS }, > + { "secondary latency timer", PCI_SIZE_8, PCI_SEC_LATENCY_TIMER }, > + { "IO base", PCI_SIZE_8, PCI_IO_BASE }, > + { "IO limit", PCI_SIZE_8, PCI_IO_LIMIT }, > + { "secondary status", PCI_SIZE_16, PCI_SEC_STATUS }, > + { "memory base", PCI_SIZE_16, PCI_MEMORY_BASE }, > + { "memory limit", PCI_SIZE_16, PCI_MEMORY_LIMIT }, > + { "prefetch memory base", PCI_SIZE_16, PCI_PREF_MEMORY_BASE }, > + { "prefetch memory limit", PCI_SIZE_16, PCI_PREF_MEMORY_LIMIT }, > + { "prefetch memory base upper", PCI_SIZE_32, PCI_PREF_BASE_UPPER32 }, > + { "prefetch memory limit upper", PCI_SIZE_32, PCI_PREF_LIMIT_UPPER32 > }, > + { "IO base upper 16 bits", PCI_SIZE_16, PCI_IO_BASE_UPPER16 }, > + { "IO limit upper 16 bits", PCI_SIZE_16, PCI_
Re: [U-Boot] [PATCH 03/14] pci: Use a separate variable for the bus number
On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > At present in do_pci(), bdf can either mean a bus number or a PCI bus number. > Use separate variables instead to reduce confusion. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 5762769..6e28b70 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -407,6 +407,7 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, > ulong value, int incrflag > static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > { > ulong addr = 0, value = 0, size = 0; > + int busnum = 0; > pci_dev_t bdf = 0; > char cmd = 's'; > int ret = 0; > @@ -437,14 +438,13 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > #endif > default:/* scan bus */ > value = 1; /* short listing */ > - bdf = 0; /* bus number */ > if (argc > 1) { > if (argv[argc-1][0] == 'l') { > value = 0; > argc--; > } > if (argc > 1) > - bdf = simple_strtoul(argv[1], NULL, 16); > + busnum = simple_strtoul(argv[1], NULL, 16); > } > cmd = 's'; > break; > @@ -476,7 +476,7 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > ret = pci_cfg_modify(bdf, addr, size, value, 1); > break; > case 's': > - pciinfo(bdf, value); > + pciinfo(busnum, value); > break; > case 'w': /* write */ > if (argc < 5) > -- Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 02/14] pci: Use a common return in command processing
On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > Adjust the commands to return from the same place. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 21 ++--- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 4f4c341..5762769 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -409,6 +409,7 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > ulong addr = 0, value = 0, size = 0; > pci_dev_t bdf = 0; > char cmd = 's'; > + int ret = 0; > > if (argc > 1) > cmd = argv[1][0]; > @@ -452,7 +453,7 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > switch (cmd) { > case 'h': /* header */ > pci_header_show(bdf); > - return 0; > + break; > case 'd': /* display */ > return pci_cfg_display(bdf, addr, size, value); > #ifdef CONFIG_CMD_PCI_ENUM > @@ -462,26 +463,32 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > # else > pci_init(); > # endif > - return 0; > + break; > #endif > case 'n': /* next */ > if (argc < 4) > goto usage; > - return pci_cfg_modify(bdf, addr, size, value, 0); > + ret = pci_cfg_modify(bdf, addr, size, value, 0); > + break; > case 'm': /* modify */ > if (argc < 4) > goto usage; > - return pci_cfg_modify(bdf, addr, size, value, 1); > + ret = pci_cfg_modify(bdf, addr, size, value, 1); > + break; > case 's': > pciinfo(bdf, value); > - return 0; > + break; > case 'w': /* write */ > if (argc < 5) > goto usage; > - return pci_cfg_write(bdf, addr, size, value); > + ret = pci_cfg_write(bdf, addr, size, value); > + break; > + default: > + ret = CMD_RET_USAGE; > + break; > } > > - return 1; > + return ret; > usage: > return CMD_RET_USAGE; > } > -- Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 01/14] pci: Move 'pci scan' code in with other commands
On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass wrote: > At present the 'pci scan' code has its own code path. Adjust it so that it > can be placed with the rest of the command processing code. This will allow > us to use common set code for all commands. > > Signed-off-by: Simon Glass > --- > > common/cmd_pci.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/common/cmd_pci.c b/common/cmd_pci.c > index 69c5332..4f4c341 100644 > --- a/common/cmd_pci.c > +++ b/common/cmd_pci.c > @@ -445,11 +445,11 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > if (argc > 1) > bdf = simple_strtoul(argv[1], NULL, 16); > } > - pciinfo(bdf, value); > - return 0; > + cmd = 's'; > + break; > } > > - switch (argv[1][0]) { > + switch (cmd) { > case 'h': /* header */ > pci_header_show(bdf); > return 0; > @@ -472,6 +472,9 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, > char * const argv[]) > if (argc < 4) > goto usage; > return pci_cfg_modify(bdf, addr, size, value, 1); > + case 's': > + pciinfo(bdf, value); > + return 0; > case 'w': /* write */ > if (argc < 5) > goto usage; > -- Reviewed-by: Bin Meng ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3] board_init: Change the logic to setup malloc_base
On Thu, Nov 12, 2015 at 12:30:19PM -0200, Fabio Estevam wrote: > Prior to commit 5ba534d247d418 ("arm: Switch 32-bit ARM to using generic > global_data setup") we used to have assembly code that configured the > malloc_base address. > > Since this commit we use the board_init_f_mem() function in C to setup > malloc_base address. > > In board_init_f_mem() there was a deliberate choice to support only > early malloc() or full malloc() in SPL, but not both. > > Adapt this logic to allow both to be used, one after the other, in SPL. > > This issue has been observed in a Congatec board, where we need to > retrieve the manufacturing information from the SPI NOR (the SPI API > calls malloc) prior to configuring the DRAM. In this case as malloc_base > was not configured we always see malloc to fail. > > With this change we are able to use malloc in SPL prior to DRAM gets > initialized. > > Also update the CONFIG_SYS_SPL_MALLOC_START entry in the README file. > > Signed-off-by: Fabio Estevam > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2] fdt_support: Check for bank size before updating memory node
On Sat, Oct 24, 2015 at 04:52:24PM +0530, Lokesh Vutla wrote: > In case if one of the bank that is passed is of size zero, then u-boot > will be updating memory node with a bank of size zero. There is no need > to update memory node if size is zero, so check for bank size before > updating. > > Reviewed-by: Tom Rini > Signed-off-by: Lokesh Vutla > Acked-by: Simon Glass So, I thought about this more, and looked at device trees, more, and concluded, we're stuck with the interface we have. Today there's still many boards (such as the whole Beaglebone family!) that are setting incorrect sizes in the DTS but being correctly fixed up. We'll need to continue with the other tricks that can be done to pass in more memory in the memory node. -- 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] Fix trini email in the get_maintainer.pl script
On Wed, Nov 04, 2015 at 03:55:27PM -0600, Andy Fleming wrote: > Looks like one spot got missed. Probably due to the backslash. > > Signed-off-by: Andy Fleming Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2] am43xx_evm: Add DFU support for qspi flash
On Thu, Oct 22, 2015 at 11:30:53AM +0530, Vignesh R wrote: > This adds support to update firmware on qspi flash present on > am437x-sk-evm and am43xx-epos-evm via DFU. > > On device: > => setenv dfu_alt_info ${dfu_alt_info_qspi} > => dfu 0 sf 0:0 > > On host: > $ sudo dfu-util -l > $ sudo dfu-util -D u-boot.bin -a u-boot.bin > > Signed-off-by: Vignesh R Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] spl: Add support for CONFIG_OF_EMBED=y
On Mon, Nov 09, 2015 at 10:45:07AM +0100, Michal Simek wrote: > CONFIG_OF_EMBED=y is the option which is here only for testing purpose > and shouldn't be enabled by default as is describe at: > "dts: Add a comment about CONFIG_OF_EMBED being for local use" > (sha1: 3d3f60cb7a6bb6c338e00a9769fa918a8536096c) > > But still enabling this option locally shouldn't end up with compilation > error when you build SPL. This patch fix it. > > Compilation error: > lib/built-in.o: In function `fdtdec_setup': > /mnt/disk/u-boot/lib/fdtdec.c:1246: undefined reference to > `__dtb_dt_begin' > > Signed-off-by: Michal Simek > Reported-by: Tom Rini > Reviewed-by: Tom Rini > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] openrisc: updating build tools naming convention
On Sun, Nov 08, 2015 at 02:37:15PM +, Guillaume REMBERT wrote: > Dear u-boot community, > > I just made a small change on the openrisc-generic platform > configuration to take in account the new naming convention (or1k instead > of or32, so the build process gets fine). > > Could you take care to review and approve the following patch, please? > > Kind regards, > > diff --git a/arch/openrisc/config.mk b/arch/openrisc/config.mk > index cd95f24..bfdb71f 100644 Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,V2] common: Simplify get_clocks() #ifdef
On Fri, Oct 30, 2015 at 05:30:02PM +0800, Peng Fan wrote: > get_clocks is wrapped by CONFIG_FSL_CLK and CONFIG_M68K in seperate > piece code. They can be merged into one snippet. > > Signed-off-by: Peng Fan > Cc: Tom Rini > Cc: Simon Glass > Cc: Bin Meng > Cc: Alexey Brodkin > Cc: "ang...@sysam.it" > Cc: Daniel Schwierzeck > Cc: Stephen Warren > Cc: "Andreas Bießmann" > Reviewed-by: Simon Glass > Acked-by: Angelo Dureghello Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] i2c: Fix pca953x endianess issue
On Thu, Oct 29, 2015 at 01:51:27PM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > By reading 2 consecutive bytes from i2c to an u16 value > we have an endianess issue. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] block: ahci: Remove dead code
On Sun, Nov 01, 2015 at 01:18:27PM -0200, Fabio Estevam wrote: > From: Fabio Estevam > > CONFIG_AHCI_SETFEATURES_XFER is not selected by any user, so delete > the dead code. > > Signed-off-by: Fabio Estevam > Reviewed-by: Bin Meng > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] configs: Use config_distro_defaults.h in ti_armv7_common.h
On Thu, Oct 29, 2015 at 09:54:15PM +0300, matwey.korni...@gmail.com wrote: > CONFIG_BOOTDELAY is defined in config_distro_defaults.h > > Signed-off-by: Matwey V. Kornilov Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] pengwyn: nand and ethernet fixes
On Mon, Nov 02, 2015 at 06:50:23PM +0100, Vincent BENOIT wrote: > -> Add National instrument ethernet transceiver configuration used (DP83848) > -> Change cpsw slave phy address > -> modify nand configuration to use the correct ECC and correct nand features Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,18/18] i2c: soft_i2c: Fix bus indizes
On Wed, Oct 28, 2015 at 11:46:39AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Since busses are sorted in alphabetical order, introducing more > than nine busses led to unexpected behaviour. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 17/18] board: gdsys: Enable osd on output only
On Wed, Oct 28, 2015 at 11:46:38AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,15/18] hrcon: Add fan controllers
On Wed, Oct 28, 2015 at 11:46:36AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,13/18] hrcon: Fix videoboard i2c setup
On Wed, Oct 28, 2015 at 11:46:34AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > - i2c addresses for the videoboard port expanders were > wrong. > - the fpga reset signal was not initialized. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 14/18] hrcon: Add support for the DH variant
On Wed, Oct 28, 2015 at 11:46:35AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > hrcon DH(dual head) has two video outputs per FPGA. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,16/18] board: gdsys: Add osdsize command
On Wed, Oct 28, 2015 at 11:46:37AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > osdsize adjusts the gdsys IHS osd dimensions in characters. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 12/18] hrcon: Use generic ioep-fpga support
On Wed, Oct 28, 2015 at 11:46:33AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > The strider platform moved some generic code into ioep-fpga.c. > Make use of that on hrcon platform. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 09/18] iocon: reset FPGAs in last_stage_init()
On Wed, Oct 28, 2015 at 11:46:30AM +0100, Dirk Eibach wrote: > From: Reinhard Pfau > > - Reset FPGAs in last_stage_init() > > Signed-off-by: Reinhard Pfau > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,10/18] hrcon: Remove CH7301 configuration
On Wed, Oct 28, 2015 at 11:46:31AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > hrcon has no CH7301 DVI-transmitter. > Probably not removed when copying from iocon. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 09/18] iocon: reset FPGAs in last_stage_init()
On Wed, Oct 28, 2015 at 11:46:30AM +0100, Dirk Eibach wrote: > From: Reinhard Pfau > > - Reset FPGAs in last_stage_init() > > Signed-off-by: Reinhard Pfau > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,11/18] mpc83xx: Add strider board
On Wed, Oct 28, 2015 at 11:46:32AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > The gdsys strider board is based on a Freescale MPC8308 SOC. > It boots from NOR-Flash, kernel and rootfs are stored on > SD-Card. > > On board peripherals include: > - 1x 10/100 Mbit/s Ethernet (optional) > - Lattice ECP3 FPGA connected via eLBC > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 04/18] board: gdsys: Configure DP501 SPDIF input
On Wed, Oct 28, 2015 at 11:46:25AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Signed-off-by: Dirk Eibach > Reviewed-by: Heiko Schocher Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 06/18] board: gdsys: Consider DP501 limits on link training
On Wed, Oct 28, 2015 at 11:46:27AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > DP501 only supports DP 1.1a. > Limit settings for link bandwidth and lane count to > values allowed by DP 1.1a. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,07/18] dlvision-10g: Support displayport
On Wed, Oct 28, 2015 at 11:46:28AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Support dlvision-10g hardware with displayport output. > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 08/18] controlcenterd: Disable sideband clocks
On Wed, Oct 28, 2015 at 11:46:29AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Signed-off-by: Dirk Eibach Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 05/18] board: gdsys: Increase DP501 I2C retry interval
On Wed, Oct 28, 2015 at 11:46:26AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > With Club 3D dual link adapter there are AUX-channel timeouts > when EDID is read. Increasing retry interval time to max (400us) > fixes this. > > Signed-off-by: Dirk Eibach > Reviewed-by: Heiko Schocher Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,01/18] i2c: ihs_i2c: Dual channel support
On Wed, Oct 28, 2015 at 11:46:22AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Support two i2c masters per FPGA. > > Signed-off-by: Dirk Eibach > Acked-by: Heiko Schocher Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v1,03/18] i2c: ihs_i2c: Fix hold_bus control
On Wed, Oct 28, 2015 at 11:46:24AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Bus has to be held for repeated start regardless of > read/write access. > > Signed-off-by: Dirk Eibach > Acked-by: Heiko Schocher Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 4/5] driver: net: Fix pointer conversion warnings for xilinx_zynqmp_ep
On Sun, Oct 25, 2015 at 01:18:54PM +0530, Prabhakar Kushwaha wrote: > Fix below warnings happening for xilinx_zynqmp_ep_defconfig > > drivers/net/zynq_gem.c: In function ‘zynq_gem_init’: > drivers/net/zynq_gem.c:330:7: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > ((u32)(priv->rxbuffers) + >^ > In file included from drivers/net/zynq_gem.c:19:0: > drivers/net/zynq_gem.c:336:10: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] >writel((u32)priv->rx_bd, ®s->rxqbase); > ^ > ./arch/arm/include/asm/io.h:146:34: note: in definition of macro ‘writel’ > #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) > ^ > drivers/net/zynq_gem.c: In function ‘zynq_gem_send’: > drivers/net/zynq_gem.c:399:9: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > writel((u32)priv->tx_bd, ®s->txqbase); > ^ > ./arch/arm/include/asm/io.h:146:34: note: in definition of macro ‘writel’ > #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; }) > ^ > drivers/net/zynq_gem.c:404:22: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > priv->tx_bd->addr = (u32)ptr; > ^ > drivers/net/zynq_gem.c:409:9: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > addr = (u32) ptr; > ^ > drivers/net/zynq_gem.c:414:9: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > addr = (u32)priv->rxbuffers; > ^ > drivers/net/zynq_gem.c: In function ‘zynq_gem_recv’: > drivers/net/zynq_gem.c:454:31: warning: cast to pointer from integer > of different size [-Wint-to-pointer-cast] >net_process_received_packet((u8 *)addr, frame_len); >^ > drivers/net/zynq_gem.c: In function ‘zynq_gem_initialize’: > drivers/net/zynq_gem.c:533:35: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > priv->rx_bd = (struct emac_bd *)((u32)bd_space + BD_SEPRN_SPACE); >^ > drivers/net/zynq_gem.c:533:16: warning: cast to pointer from integer > of different size [-Wint-to-pointer-cast] > priv->rx_bd = (struct emac_bd *)((u32)bd_space + BD_SEPRN_SPACE); > > Signed-off-by: Prabhakar Kushwaha Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 3/5] driver: usb: Fix pointer conversion warnings for hikey
On Sun, Oct 25, 2015 at 01:18:41PM +0530, Prabhakar Kushwaha wrote: > Fix below compilation warings happening for hikey_defconfig > > drivers/usb/eth/smsc95xx.c:698:56: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); > ^ > include/common.h:109:26: note: in definition of macro ‘debug_cond’ > printf(pr_fmt(fmt), ##args); \ > ^ > drivers/usb/eth/smsc95xx.c:698:2: note: in expansion of macro ‘debug’ > debug("** %s(), len %d, buf %#x\n", __func__, length, (int)msg); > ^ > drivers/usb/eth/smsc95xx.c:718:2: warning: format ‘%u’ expects argument of > type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] > debug("Tx: len = %u, actual = %u, err = %d\n", > ^ > drivers/usb/eth/smsc95xx.c: In function ‘smsc95xx_recv’: > drivers/usb/eth/smsc95xx.c:802:19: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] >cur_buf_align = (int)buf_ptr - (int)recv_buf; >^ > drivers/usb/eth/smsc95xx.c:802:34: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] >cur_buf_align = (int)buf_ptr - (int)recv_buf; > > Signed-off-by: Prabhakar Kushwaha Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v1, 02/18] i2c: ihs_i2c: Use macro bestpractices
On Wed, Oct 28, 2015 at 11:46:23AM +0100, Dirk Eibach wrote: > From: Dirk Eibach > > Reinhard Pfau complained that macros in ihs_i2c do not follow best practices. > > Signed-off-by: Dirk Eibach > Acked-by: Heiko Schocher Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 2/5] driver: dwmmc: Fix pointer conversion warnings for hikey
On Sun, Oct 25, 2015 at 01:18:25PM +0530, Prabhakar Kushwaha wrote: > Fix below compilation warings happening for hikey_defconfig > > drivers/mmc/dw_mmc.c: In function ‘dwmci_set_idma_desc’: > drivers/mmc/dw_mmc.c:43:20: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > desc->next_addr = (unsigned int)desc + sizeof(struct dwmci_idmac); > ^ > drivers/mmc/dw_mmc.c: In function ‘dwmci_prepare_data’: > drivers/mmc/dw_mmc.c:61:35: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > dwmci_writel(host, DWMCI_DBADDR, (unsigned int)cur_idmac); >^ > drivers/mmc/dw_mmc.c:73:9: warning: cast from pointer to integer > of different size [-Wpointer-to-int-cast] > (u32)bounce_buffer + (i * PAGE_SIZE)); > ^ > CC drivers/mmc/hi6220_dw_mmc.o > drivers/mmc/hi6220_dw_mmc.c: In function ‘hi6220_dwmci_add_port’: > drivers/mmc/hi6220_dw_mmc.c:51:17: warning: cast to pointer from integer > of different size [-Wint-to-pointer-cast] > host->ioaddr = (void *)regbase; > > Signed-off-by: Prabhakar Kushwaha Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, 1/5] driver: gpio: hikey: Fix pointer conversion warnings for hikey
On Sun, Oct 25, 2015 at 01:18:12PM +0530, Prabhakar Kushwaha wrote: > Fix below compilation warnings- > drivers/gpio/hi6220_gpio.c: In function ‘hi6220_gpio_probe’: > drivers/gpio/hi6220_gpio.c:82:15: warning: cast to pointer from integer > of different size [-Wint-to-pointer-cast] > bank->base = (u8 *)plat->base; > > Signed-off-by: Prabhakar Kushwaha Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 3/3] uuid: add selection by string for known partition type GUID
On Tue, Oct 27, 2015 at 11:00:28AM +0100, Patrick Delaunay wrote: > short strings can be used in type parameter of gpt command > to replace the guid string for the types known by u-boot > > partitions = name=boot,size=0x6bc00,type=data; \ >name=root,size=0x7538ba00,type=linux; > gpt write mmc 0 $partitions > > and they are also used to display the type of partition > in "part list" command > > Partition Map for MMC device 0 -- Partition Type: EFI > > PartStart LBA End LBA Name > Attributes > Type GUID > Partition GUID > 1 0x0022 0x037f "boot" > attrs: 0x > type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 > type: data > guid: d117f98e-6f2c-d04b-a5b2-331a19f91cb2 > 2 0x0380 0x003a9fdc "root" > attrs: 0x > type: 0fc63daf-8483-4772-8e79-3d69d8477de4 > type: linux > guid: 25718777-d0ad-7443-9e60-02cb591c9737 > > Signed-off-by: Patrick Delaunay Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] mmc: Use lldiv() for 64-bit division in write_raw_image()
On Wed, Oct 28, 2015 at 06:24:16AM +0200, Siarhei Siamashka wrote: > This fixes compilation problems when using a hardfloat toolchain on > ARM, which manifest themselves as "libgcc.a(_udivmoddi4.o) uses > VFP register arguments, u-boot does not". > > These problems have been reported in the U-Boot mailing list: > http://lists.denx.de/pipermail/u-boot/2015-October/230314.html > http://lists.denx.de/pipermail/u-boot/2015-October/231908.html > > Signed-off-by: Siarhei Siamashka > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 2/3] gpt: add optional parameter type in gpt command
On Tue, Oct 27, 2015 at 11:00:27AM +0100, Patrick Delaunay wrote: > code under flag CONFIG_PARTITION_TYPE_GUID > add parameter "type" to select partition type guid > > example of use with gpt command : > > partitions = uuid_disk=${uuid_gpt_disk}; \ > name=boot,size=0x6bc00,uuid=${uuid_gpt_boot}; \ > name=root,size=0x7538ba00,uuid=${uuid_gpt_root}, \ > type=0fc63daf-8483-4772-8e79-3d69d8477de4; > > gpt write mmc 0 $partitions > > Signed-off-by: Patrick Delaunay Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v3, 1/3] part:efi: add GUID for linux file system data
On Tue, Oct 27, 2015 at 11:00:26AM +0100, Patrick Delaunay wrote: > Previously, Linux used the same GUID for the data partitions as Windows > (Basic data partition: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7). > This created problems when dual-booting Linux and Windows in UEFI-GPT > Setup, so a new GUID (Linux filesystem data: > 0FC63DAF-8483-4772-8E79-3D69D8477DE4) was defined jointly by GPT fdisk > and GNU Parted developers. > > Signed-off-by: Patrick Delaunay Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, 14/14] sunxi: cubietruck: Enable the USB OTG controller
On Thu, Oct 15, 2015 at 02:34:22PM +0200, Maxime Ripard wrote: > The Cubietruck has a mini-USB connector that can be used to power up the > board and as an OTG connector. > > Since we have already some USB host-only ports right beside this one, > enable it in gadget mode > > Signed-off-by: Maxime Ripard Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] include/linux/mtd: Update copyright notices
On Fri, Oct 23, 2015 at 09:37:47AM -0400, Tom Rini wrote: > Condense these updates down to SPDX tags too while doing this. This is > a port of a1452a3771c4eb85bd779790b040efdc36f4274e from the Linux > Kernel. > > Signed-off-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, 13/14] sunxi: A13-Olinuxino: Enable the USB OTG controller
On Thu, Oct 15, 2015 at 02:34:21PM +0200, Maxime Ripard wrote: > The A13-Olinuxino has a mini-USB connector that can be used to power up > the board and as an OTG connector. > > Since we have already some USB host-only ports right beside this one, > enable it in gadget mode > > Signed-off-by: Maxime Ripard Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] pci: fix checking PCI_REGION_MEM in pci_hose_phys_to_bus()
On Fri, Oct 23, 2015 at 09:48:01PM +, Cheng Gu wrote: > When converting between PCI bus and phys addresses, a two pass search > was introduced with preference to non-PCI_REGION_SYS_MEMORY regions. > See commit 2d43e873a29ca4959ba6a30fc7fb396d3fd0dccf. > > However, since PCI_REGION_MEM is defined as 0, the if statement was > always asserted true: ((flags & PCI_REGION_MEM) == PCI_REGION_MEM) > > This patch uses PCI_REGION_TYPE bit to check if the region is > PCI_REGION_MEM: ((flags & PCI_REGION_TYPE) == PCI_REGION_MEM) > > Signed-off-by: Cheng Gu > Reviewed-by: Bin Meng Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] board/ti/am335x: beaglebone stop muxing i2c1_pin_mux
On Wed, Oct 21, 2015 at 09:25:55AM -0500, robertcnel...@gmail.com wrote: > On the BeagleBone these i2c1 pins are routed to the expanasion header, where > they can be defined as either pr1_usart0_Xxd/pwm0/spi0/i2c1, dont assume i2c1 > > Fixes: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/313894/1387696 > > Signed-off-by: Robert Nelson > Reported-by: Matthijs van Duin > CC: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v2,11/14] sparse: Rename the file and header
On Thu, Oct 15, 2015 at 02:34:19PM +0200, Maxime Ripard wrote: > The Android sparse image format is currently supported through a file > called aboot, which isn't really such a great name, since the sparse image > format is only used for transferring data with fastboot. > > Rename the file and header to a file called "sparse", which also makes it > consistent with the header defining the image structures. > > Signed-off-by: Maxime Ripard > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, 08/14] sparse: Implement several chunks flashing
On Thu, Oct 15, 2015 at 02:34:16PM +0200, Maxime Ripard wrote: > The fastboot client will split the sparse images into several chunks if the > image that it tries to flash is bigger than what the device can handle. > > In such a case, the bootloader is supposed to retain the last offset to > which it wrote to, so that it can resume the writes at the right offset > when flashing the next chunk. > > Retain the last offset we used, and use the session ID to know if we need > it or not. > > Signed-off-by: Maxime Ripard > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, 07/14] fastboot: Implement flashing session counter
On Thu, Oct 15, 2015 at 02:34:15PM +0200, Maxime Ripard wrote: > The fastboot flash command that writes an image to a partition works in > several steps: > > 1 - Retrieve the maximum size the device can download through the > "max-download-size" variable > > 2 - Retrieve the partition type through the "partition-type:%s" variable, > that indicates whether or not the partition needs to be erased (even > though the fastboot client has minimal support for that) > > 3a - If the image is smaller than what the device can handle, send the image > and flash it. > > 3b - If the image is larger than what the device can handle, create a > sparse image, and split it in several chunks that would fit. Send the > chunk, flash it, repeat until we have no more data to send. > > However, in the 3b case, the subsequent transfers have no particular > identifiers, the protocol just assumes that you would resume the writes > where you left it. > > While doing so works well, it also means that flashing two subsequent > images on the same partition (for example because the user made a mistake) > would not work withouth flashing another partition or rebooting the board, > which is not really intuitive. > > Since we have always the same pattern, we can however maintain a counter > that will be reset every time the client will retrieve max-download-size, > and incremented after each buffer will be flashed, that will allow us to > tell whether we should simply resume the flashing where we were, or start > back at the beginning of the partition. > > Signed-off-by: Maxime Ripard > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot,v2,09/14] fastboot: Implement NAND backend
On Thu, Oct 15, 2015 at 02:34:17PM +0200, Maxime Ripard wrote: > So far the fastboot code was only supporting MMC-backed devices for its > flashing operations (flash and erase). > > Add a storage backend for NAND-backed devices. > > Signed-off-by: Maxime Ripard Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-Boot, v2, 10/14] fastboot: nand: Add pre erase and write hooks
On Thu, Oct 15, 2015 at 02:34:18PM +0200, Maxime Ripard wrote: > Some devices might need to do some per-partition initialization > (ECC/Randomizer settings change for example) before actually accessing it. > > Add some hooks before the write and erase operations to let the boards > define what they need to do if needed. > > Signed-off-by: Maxime Ripard > Reviewed-by: Tom Rini Applied to u-boot/master, thanks! -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot