[U-Boot] [PATCH v3 4/6] linux/kernel.h: import more macros
These macros seem to be useful for U-Boot too (or at least harmless). Imported from Linux 3.18-rc2. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None include/linux/kernel.h | 92 ++ 1 file changed, 92 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 527ed40..f84a764 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -4,16 +4,41 @@ #include +#define USHRT_MAX ((u16)(~0U)) +#define SHRT_MAX ((s16)(USHRT_MAX>>1)) +#define SHRT_MIN ((s16)(-SHRT_MAX - 1)) #define INT_MAX((int)(~0U>>1)) #define INT_MIN(-INT_MAX - 1) +#define UINT_MAX (~0U) +#define LONG_MAX ((long)(~0UL>>1)) +#define LONG_MIN (-LONG_MAX - 1) +#define ULONG_MAX (~0UL) #define LLONG_MAX ((long long)(~0ULL>>1)) +#define LLONG_MIN (-LLONG_MAX - 1) +#define ULLONG_MAX (~0ULL) +#define SIZE_MAX (~(size_t)0) #define U8_MAX ((u8)~0U) +#define S8_MAX ((s8)(U8_MAX>>1)) +#define S8_MIN ((s8)(-S8_MAX - 1)) +#define U16_MAX((u16)~0U) +#define S16_MAX((s16)(U16_MAX>>1)) +#define S16_MIN((s16)(-S16_MAX - 1)) #define U32_MAX((u32)~0U) +#define S32_MAX((s32)(U32_MAX>>1)) +#define S32_MIN((s32)(-S32_MAX - 1)) #define U64_MAX((u64)~0ULL) +#define S64_MAX((s64)(U64_MAX>>1)) +#define S64_MIN((s64)(-S64_MAX - 1)) + +#define STACK_MAGIC0xdeadbeef + +#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) #define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1) #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) +#define PTR_ALIGN(p, a)((typeof(p))ALIGN((unsigned long)(p), (a))) +#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) @@ -27,10 +52,24 @@ #define round_up(x, y) x)-1) | __round_mask(x, y))+1) #define round_down(x, y) ((x) & ~__round_mask(x, y)) +#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#if BITS_PER_LONG == 32 +# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d) +#else +# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d) +#endif + #define roundup(x, y) x) + ((y) - 1)) / (y)) * (y)) +#define rounddown(x, y) ( \ +{ \ + typeof(x) __x = (x);\ + __x - (__x % (y)); \ +} \ +) + /* * Divide positive or negative dividend by positive divisor and round * to closest integer. Result is undefined for negative divisors and @@ -127,6 +166,27 @@ _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \ (_max2 > _max3 ? _max2 : _max3); }) +/** + * min_not_zero - return the minimum that is _not_ zero, unless both are zero + * @x: value1 + * @y: value2 + */ +#define min_not_zero(x, y) ({ \ + typeof(x) __x = (x);\ + typeof(y) __y = (y);\ + __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) + +/** + * clamp - return a value clamped to a given range with strict typechecking + * @val: current value + * @lo: lowest allowable value + * @hi: highest allowable value + * + * This macro does strict typechecking of lo/hi to make sure they are of the + * same type as val. See the unnecessary pointer comparisons. + */ +#define clamp(val, lo, hi) min((typeof(val))max(val, lo), hi) + /* * ..and if you can't take the strict * types, you can specify one yourself. @@ -144,6 +204,38 @@ __max1 > __max2 ? __max1: __max2; }) /** + * clamp_t - return a value clamped to a given range using a given type + * @type: the type of variable to use + * @val: current value + * @lo: minimum allowable value + * @hi: maximum allowable value + * + * This macro does no typechecking and uses temporary variables of type + * 'type' to make all the comparisons. + */ +#define clamp_t(type, val, lo, hi) min_t(type, max_t(type, val, lo), hi) + +/** + * clamp_val - return a value clamped to a given range using val's type + * @val: current value + * @lo: minimum allowable value + * @hi: maximum allowable value + * + * This macro does no typechecking and uses temporary variables of whatever + * type the input argument 'val' is. This is useful when val is an unsigned + * type and min and max are literals that will otherwise be assigned a signed + * integer type. + */ +#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) + + +/* + * swap - swap value of @a and @b + */ +#define swap(a, b) \ + do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) + +/** * container_of - cast a member of
[U-Boot] [PATCH v3 3/6] include: move various macros to include/linux/kernel.h
U-Boot has imported various utility macros from Linux scattering them to various places without consistency. In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files. Moreover, we are suffering from too cluttered include/common.h. This commit moves various macros that originate in include/linux/kernel.h of Linux to their original position. Note: This commit simply moves the macros; the macros roundup, min, max, min2, max3, ARRAY_SIZE are different from those of Linux at this point. Signed-off-by: Masahiro Yamada --- Changes in v3: - Move also mult_frac Changes in v2: None arch/arm/cpu/armv7/bcm281xx/clk-core.h| 4 - arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 2 - arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 2 - arch/powerpc/cpu/ppc4xx/usb_ohci.c| 2 - drivers/usb/host/isp116x-hcd.c| 6 - drivers/usb/host/ohci-hcd.c | 3 - drivers/usb/host/ohci-s3c24xx.c | 3 - drivers/usb/host/r8a66597-hcd.c | 3 - drivers/usb/musb/musb_hcd.h | 3 - drivers/video/ati_radeon_fb.c | 5 - fs/ubifs/ubifs.h | 4 - include/common.h | 87 +- include/linux/compat.h| 54 - include/linux/kernel.h| 157 ++ lib/vsprintf.c| 3 - 15 files changed, 158 insertions(+), 180 deletions(-) create mode 100644 include/linux/kernel.h diff --git a/arch/arm/cpu/armv7/bcm281xx/clk-core.h b/arch/arm/cpu/armv7/bcm281xx/clk-core.h index 882a297..4a694d7 100644 --- a/arch/arm/cpu/armv7/bcm281xx/clk-core.h +++ b/arch/arm/cpu/armv7/bcm281xx/clk-core.h @@ -73,10 +73,6 @@ struct clk { struct refclk *refclk_str_to_clk(const char *name); -#define U8_MAX ((u8)~0U) -#define U32_MAX((u32)~0U) -#define U64_MAX((u64)~0U) - /* The common clock framework uses u8 to represent a parent index */ #define PARENT_COUNT_MAX ((u32)U8_MAX) diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c index a3dac70..74bdb77 100644 --- a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c +++ b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c @@ -54,8 +54,6 @@ #define readl(a) au_readl((long)(a)) #define writel(v,a) au_writel((v),(int)(a)) -#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) - #define DEBUG #ifdef DEBUG #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg) diff --git a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c index 3c8b2d9..b7c1b55 100644 --- a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c +++ b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c @@ -42,8 +42,6 @@ #define readl(a) (*((volatile u32 *)(a))) #define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a)) -#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) - #ifdef DEBUG #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg) #else diff --git a/arch/powerpc/cpu/ppc4xx/usb_ohci.c b/arch/powerpc/cpu/ppc4xx/usb_ohci.c index d1e78f6..65a0675 100644 --- a/arch/powerpc/cpu/ppc4xx/usb_ohci.c +++ b/arch/powerpc/cpu/ppc4xx/usb_ohci.c @@ -40,8 +40,6 @@ #define readl(a) (*((volatile u32 *)(a))) #define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a)) -#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) - #ifdef DEBUG #define dbg(format, arg...) printf("DEBUG: " format "\n", ## arg) #else diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 46e4cee..0556f32 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -103,12 +103,6 @@ static int rh_devnum; /* address of Root Hub endpoint */ /* - */ -#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL)) -#define min_t(type,x,y)\ - ({ type __x = (x); type __y = (y); __x < __y ? __x : __y; }) - -/* - */ - static int isp116x_reset(struct isp116x *isp116x); /* --- Debugging functions - */ diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index dc0a4e3..9bb1d48 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -65,9 +65,6 @@ #define OHCI_CONTROL_INIT \ (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE -#define min_t(type, x, y) \ - ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; }) - #ifdef CONFIG_PCI_OHCI static struct pci_device_id ohci_pci_ids[] = {
[U-Boot] [PATCH v3 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux
U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by: Masahiro Yamada Acked-by: Pavel Machek Acked-by: Lukasz Majewski Tested-by: Lukasz Majewski --- Changes in v3: None Changes in v2: - Fix a typo: s/introduing/introducing/ - Change arch/arm/cpu/arm1176/tnetv107x/clock.c #define MAXPOSTDIV8UL seems better than adding a cast. arch/arm/cpu/arm1176/tnetv107x/clock.c| 4 +- arch/arm/cpu/armv7/exynos/clock.c | 4 +- arch/arm/cpu/armv7/tegra20/display.c | 4 +- arch/avr32/cpu/at32ap700x/clk.c | 2 +- arch/blackfin/cpu/jtag-console.c | 2 +- arch/blackfin/lib/string.c| 2 +- arch/powerpc/cpu/mpc85xx/tlb.c| 2 +- arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c| 32 ++-- arch/powerpc/lib/bootm.c | 2 +- arch/sandbox/cpu/start.c | 2 +- arch/x86/cpu/coreboot/pci.c | 2 +- arch/x86/cpu/coreboot/sdram.c | 2 +- board/freescale/common/sys_eeprom.c | 6 +-- board/gdsys/p1022/controlcenterd-id.c | 5 ++- board/imgtec/malta/malta.c| 2 +- common/cmd_elf.c | 12 +++--- common/cmd_sf.c | 16 common/env_nand.c | 4 +- common/fdt_support.c | 3 +- common/lcd.c | 6 +-- common/usb_hub.c | 3 +- drivers/block/ahci.c | 2 +- drivers/ddr/fsl/ctrl_regs.c | 22 +-- drivers/ddr/fsl/lc_common_dimm_params.c | 62 ++- drivers/ddr/fsl/main.c| 3 +- drivers/dfu/dfu.c | 2 +- drivers/i2c/fsl_i2c.c | 2 +- drivers/misc/cros_ec_spi.c| 2 +- drivers/mmc/fsl_esdhc.c | 2 +- drivers/mmc/pxa_mmc_gen.c | 6 +-- drivers/mtd/nand/denali_spl.c | 2 +- drivers/mtd/spi/sandbox.c | 2 +- drivers/mtd/spi/sf_ops.c | 5 ++- drivers/net/netconsole.c | 2 +- drivers/pci/pci.c | 6 ++- drivers/pci/pci_auto.c| 2 +- drivers/serial/usbtty.c | 2 +- drivers/spi/fsl_espi.c| 4 +- drivers/spi/mxc_spi.c | 2 +- drivers/spi/spi-uclass.c | 2 +- drivers/tpm/tpm_tis_lpc.c | 2 +- drivers/usb/gadget/composite.c| 4 +- drivers/usb/gadget/designware_udc.c | 4 +- drivers/usb/gadget/pxa27x_udc.c | 3 +- drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 4 +- drivers/usb/host/dwc2.c | 14 +++ drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/xhci-ring.c | 2 +- drivers/usb/host/xhci.c | 2 +- drivers/video/cfb_console.c | 18 - fs/ext4/dev.c | 13 +++ fs/fat/fat.c | 2 +- include/linux/kernel.h| 17 ++--- 53 files changed, 178 insertions(+), 158 deletions(-) diff --git a/arch/arm/cpu/arm1176/tnetv107x/clock.c b/arch/arm/cpu/arm1176/tnetv107x/clock.c index 47c23bb..7ba28d3 100644 --- a/arch/arm/cpu/arm1176/tnetv107x/clock.c +++ b/arch/arm/cpu/arm1176/tnetv107x/clock.c @@ -16,7 +16,7 @@ #define BIT(x) (1 << (x)) #define MAX_PREDIV 64 -#define MAX_POSTDIV8 +#define MAX_POSTDIV8UL #define MAX_MULT 512 #define MAX_DIV(MAX_PREDIV * MAX_POSTDIV) @@ -362,7 +362,7 @@ static void init_pll(const struct pll_init_data *data) pllctl_reg_write(data->pll, ctl, tmp); mult = data->pll_freq / fpll; - for (mult = max(mult, 1); mult <= MAX_MULT; mult++) { + for (mult = max(mult, 1UL); mult <= MAX_MULT; mult++) { div = (fpll * mult) / data->pll_freq; if (div < 1 || div > MAX_DIV) continue; diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index 7558eff..c0c95fb 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -1422,8 +1422,8 @@ static int clock_calc_best_scalar(unsigned int main_scaler_bits, return 1; for (i = 1; i <= loops; i++) { - const unsigned int effective_div = max(min(input_rate / i / -
[U-Boot] [PATCH v3 5/6] linux/kernel.h: add typechecking to roundup macro
This commit replaces roundup macro with the one from Linux Kernel. DEFINE_ALIGN_BUFFER must be fixed because typechecking can not be used in this context. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None include/common.h | 2 +- include/linux/kernel.h | 9 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/common.h b/include/common.h index c1bdaec..ce0a734 100644 --- a/include/common.h +++ b/include/common.h @@ -967,7 +967,7 @@ static inline phys_addr_t map_to_sysmem(const void *ptr) * Usage of this macro shall be avoided or used with extreme care! */ #define DEFINE_ALIGN_BUFFER(type, name, size, align) \ - static char __##name[roundup(size * sizeof(type), align)] \ + static char __##name[ALIGN(size * sizeof(type), align)] \ __aligned(align); \ \ static type *name = (type *)__##name diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f84a764..0e838de 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -61,8 +61,13 @@ # define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d) #endif -#define roundup(x, y) x) + ((y) - 1)) / (y)) * (y)) - +/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ +#define roundup(x, y) (\ +{ \ + const typeof(y) __y = y;\ + (((x) + (__y - 1)) / __y) * __y;\ +} \ +) #define rounddown(x, y) ( \ { \ typeof(x) __x = (x);\ -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 2/6] include/common.h: remove DIV_ROUND definition
All the references of DIV_ROUND have been replaced with DIV_ROUND_CLOSEST. Remove DIV_ROUND. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None include/common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/common.h b/include/common.h index ecf7fca..c9fe386 100644 --- a/include/common.h +++ b/include/common.h @@ -950,7 +950,6 @@ static inline phys_addr_t map_to_sysmem(const void *ptr) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #define ROUND(a,b) (((a) + (b) - 1) & ~((b) - 1)) -#define DIV_ROUND(n,d) (((n) + ((d)/2)) / (d)) #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define roundup(x, y) x) + ((y) - 1)) / (y)) * (y)) -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v3 0/6] Collect utility macros to include/linux/kernel.h synced with Linux
We have imported useful macros from Linux scattering them to various places. In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, roundup, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files. I'd like to create include/linux/kernel.h and arrange sprinkled Linux-originated macros in order. I believe this work will be helpful when we import more macros or sync include/linux/kenrel.h in the future. I confirmed clean output of buildman. No section: 'make-flags' boards.cfg is up to date. Nothing to do. Summary of 7 commits for 1175 boards (8 threads, 1 job per thread) 01: arm: interrupt_init: set sp in IRQ/FIQ modes nios2: + nios2-generic sh: + rsk7269 rsk7264 rsk7203 blackfin: + bf609-ezkit arm: + maxbcm smdkv310 snow smdk5250 smdk5420 origen odroid db-mv784mp-gp s5pc210_universal trats peach-pit arndale trats2 powerpc: + TQM834x 02: replace DIV_ROUND with DIV_ROUND_CLOSEST 03: include/common.h: remove DIV_ROUND definition 04: include: move various macros to include/linux/kernel.h 05: linux/kernel.h: import more macros 06: linux/kernel.h: add typechecking to roundup macro 07: linux/kernel.h: sync min, max, min3, max3 macros with Linux Changes in v3: - Move also mult_frac Changes in v2: - Fix a typo: s/introduing/introducing/ - Change arch/arm/cpu/arm1176/tnetv107x/clock.c #define MAXPOSTDIV8UL seems better than adding a cast. Masahiro Yamada (6): replace DIV_ROUND with DIV_ROUND_CLOSEST include/common.h: remove DIV_ROUND definition include: move various macros to include/linux/kernel.h linux/kernel.h: import more macros linux/kernel.h: add typechecking to roundup macro linux/kernel.h: sync min, max, min3, max3 macros with Linux arch/arm/cpu/arm1176/tnetv107x/clock.c| 4 +- arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 3 +- arch/arm/cpu/armv7/bcm281xx/clk-core.h| 4 - arch/arm/cpu/armv7/exynos/clock.c | 4 +- arch/arm/cpu/armv7/omap-common/abb.c | 6 +- arch/arm/cpu/armv7/tegra20/display.c | 4 +- arch/avr32/cpu/at32ap700x/clk.c | 2 +- arch/blackfin/cpu/jtag-console.c | 2 +- arch/blackfin/lib/string.c| 2 +- arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c | 2 - arch/powerpc/cpu/mpc5xxx/usb_ohci.c | 2 - arch/powerpc/cpu/mpc85xx/tlb.c| 2 +- arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c| 32 ++-- arch/powerpc/cpu/ppc4xx/usb_ohci.c| 2 - arch/powerpc/lib/bootm.c | 2 +- arch/sandbox/cpu/start.c | 2 +- arch/x86/cpu/coreboot/pci.c | 2 +- arch/x86/cpu/coreboot/sdram.c | 2 +- board/freescale/common/sys_eeprom.c | 6 +- board/gdsys/p1022/controlcenterd-id.c | 5 +- board/imgtec/malta/malta.c| 2 +- common/cmd_elf.c | 12 +- common/cmd_sf.c | 16 +- common/env_nand.c | 4 +- common/fdt_support.c | 3 +- common/lcd.c | 6 +- common/usb_hub.c | 3 +- drivers/block/ahci.c | 2 +- drivers/ddr/fsl/ctrl_regs.c | 22 +-- drivers/ddr/fsl/lc_common_dimm_params.c | 62 --- drivers/ddr/fsl/main.c| 3 +- drivers/dfu/dfu.c | 2 +- drivers/i2c/fsl_i2c.c | 2 +- drivers/misc/cros_ec_spi.c| 2 +- drivers/misc/mxc_ocotp.c | 4 +- drivers/mmc/fsl_esdhc.c | 2 +- drivers/mmc/pxa_mmc_gen.c | 6 +- drivers/mtd/nand/denali_spl.c | 2 +- drivers/mtd/spi/sandbox.c | 2 +- drivers/mtd/spi/sf_ops.c | 5 +- drivers/net/netconsole.c | 2 +- drivers/pci/pci.c | 6 +- drivers/pci/pci_auto.c| 2 +- drivers/serial/usbtty.c | 2 +- drivers/spi/fsl_espi.c| 4 +- drivers/spi/mxc_spi.c | 2 +- drivers/spi/spi-uclass.c | 2 +- drivers/tpm/tpm_tis_lpc.c | 2 +- drivers/usb/gadget/composite.c| 4 +- drivers/usb/gadget/designware_udc.c | 4 +- drivers/usb/gadget/pxa27x_udc.c | 3 +- drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 4 +- drivers/usb/host/dwc2.c | 14 +- drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/isp116x-hcd.c| 6 - drivers/usb/host/ohci-hcd.c | 3 - drivers/usb/h
[U-Boot] [PATCH v3 1/6] replace DIV_ROUND with DIV_ROUND_CLOSEST
The Linux-compatible macro DIV_ROUND_CLOSEST is a bit more flexible and safer than DIV_ROUND. For example, foo = DIV_ROUND_CLOSEST(x, y++) works expectedly, but foo = DIV_ROUND(x, y++) does not. (y is incremented twice.) Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 3 ++- arch/arm/cpu/armv7/omap-common/abb.c| 6 +++--- drivers/misc/mxc_ocotp.c| 4 ++-- lib/strmhz.c| 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index d25019a..1c54ab7 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c @@ -1002,7 +1002,8 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg, uint32_t powered_by_linreg = 0; int adjust_up, tmp; - new_brownout = DIV_ROUND(new_target - new_brownout, cfg->step_mV); + new_brownout = DIV_ROUND_CLOSEST(new_target - new_brownout, +cfg->step_mV); cur_target = readl(cfg->reg); cur_target &= cfg->trg_mask; diff --git a/arch/arm/cpu/armv7/omap-common/abb.c b/arch/arm/cpu/armv7/omap-common/abb.c index 423aeb9..a0add66 100644 --- a/arch/arm/cpu/armv7/omap-common/abb.c +++ b/arch/arm/cpu/armv7/omap-common/abb.c @@ -48,9 +48,9 @@ static void abb_setup_timings(u32 setup) */ /* calculate SR2_WTCNT_VALUE */ - sys_rate = DIV_ROUND(V_OSCK, 100); - clk_cycles = DIV_ROUND(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate); - sr2_cnt = DIV_ROUND(OMAP_ABB_SETTLING_TIME * 10, clk_cycles); + sys_rate = DIV_ROUND_CLOSEST(V_OSCK, 100); + clk_cycles = DIV_ROUND_CLOSEST(OMAP_ABB_CLOCK_CYCLES * 10, sys_rate); + sr2_cnt = DIV_ROUND_CLOSEST(OMAP_ABB_SETTLING_TIME * 10, clk_cycles); setbits_le32(setup, sr2_cnt << (ffs(OMAP_ABB_SETUP_SR2_WTCNT_VALUE_MASK) - 1)); diff --git a/drivers/misc/mxc_ocotp.c b/drivers/misc/mxc_ocotp.c index 3de1245..89737af 100644 --- a/drivers/misc/mxc_ocotp.c +++ b/drivers/misc/mxc_ocotp.c @@ -122,8 +122,8 @@ static void set_timing(struct ocotp_regs *regs) relax = DIV_ROUND_UP(ipg_clk * BV_TIMING_RELAX_NS, 10) - 1; strobe_read = DIV_ROUND_UP(ipg_clk * BV_TIMING_STROBE_READ_NS, 10) + 2 * (relax + 1) - 1; - strobe_prog = DIV_ROUND(ipg_clk * BV_TIMING_STROBE_PROG_US, 100) + - 2 * (relax + 1) - 1; + strobe_prog = DIV_ROUND_CLOSEST(ipg_clk * BV_TIMING_STROBE_PROG_US, + 100) + 2 * (relax + 1) - 1; timing = BF(strobe_read, TIMING_STROBE_READ) | BF(relax, TIMING_RELAX) | diff --git a/lib/strmhz.c b/lib/strmhz.c index f9a1772..5c16cc4 100644 --- a/lib/strmhz.c +++ b/lib/strmhz.c @@ -11,11 +11,11 @@ char *strmhz (char *buf, unsigned long hz) long l, n; long m; - n = DIV_ROUND(hz, 1000) / 1000L; + n = DIV_ROUND_CLOSEST(hz, 1000) / 1000L; l = sprintf (buf, "%ld", n); hz -= n * 100L; - m = DIV_ROUND(hz, 1000L); + m = DIV_ROUND_CLOSEST(hz, 1000L); if (m != 0) sprintf (buf + l, ".%03ld", m); return (buf); -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] CONFIG_LCD_BMP_RLE8 and MCC200 dead code?
Hi Wolfgang, On 11/06/2014 02:50 PM, Wolfgang Denk wrote: Dear Nikita, In message <545b6844.2060...@compulab.co.il> you wrote: I've been trying to do some cleanup in common/lcd.c, and noticed some unused code: Thanks! The other case is MCC200 specific #ifdefs. It handles 1bpp BMPs, which I don't think is likely to be used by current and future boards, and the board itself is old, and has no maintainer. Perhaps this board can be removed? I agree. We should remove the MCC200 and PRS200 boards. Can you submit such a patch, please? TIA... Sure. I'll prepare one tomorrow.. Best regards, Wolfgang Denk -- Regards, Nikita Kiryanov ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can i pass pass an environmental variable or argument from command line to build u-boot?
Thank you guys. This is exactly what i wanted. Thanks, Harsha -- View this message in context: http://u-boot.10912.n7.nabble.com/Can-i-pass-pass-an-environmental-variable-or-argument-from-command-line-to-build-u-boot-tp194962p194972.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can i pass pass an environmental variable or argument from command line to build u-boot?
Hi harsha, 2014-11-07 1:43 GMT+09:00 harsha kiran : > Thanks Rini, > > We have freeze the code base of bootloader for 2014-07 main line. > > What can be another alternate approach? i was looking at the make file and i > see that they take everything before _config and is sorted to find all the > right pieces from boards.cfg file > > %_config:: outputmakefile > @$(MKCONFIG) -A $(@:_config=) > > i was thinking to add something which can parse the Partnumber after the > _config..i am not sure if its a good approach.. > Why don't you save your favorite version string into a file "localversion"? This feature is available in v2014.07. masahiro@oscar:~/workspace/u-boot$ git describe v2014.07 masahiro@oscar:~/workspace/u-boot$ echo "PN#1234567" > localversion && make sandbox_config all Configuring for sandbox board... GEN include/autoconf.mk.dep GEN include/autoconf.mk CHK include/config/uboot.release UPD include/config/uboot.release CHK include/generated/version_autogenerated.h UPD include/generated/version_autogenerated.h CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h CC lib/asm-offsets.s GEN include/generated/generic-asm-offsets.h [ snip ] CC test/dm/ut.o CC test/dm/core.o CC test/dm/gpio.o LD test/dm/built-in.o LD u-boot OBJCOPY u-boot.srec OBJCOPY u-boot.bin masahiro@oscar:~/workspace/u-boot$ ./u-boot U-Boot 2014.07PN#1234567 (Nov 07 2014 - 02:19:30) DRAM: 128 MiB Using default environment In:serial Out: lcd Err: lcd => -- Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] test: ums: Add sleep before unmount directory
On 11/06/2014 03:23 AM, Lukasz Majewski wrote: This change helps to run script on machines with quite long uptime. Without this the following error emerges: File: ./dat_14M.img umount: /mnt/tmp-ums-test: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) TX: md5sum:083d3d22b542d3ecba61b12d17e03f9f mount: /dev/sdd6 already mounted or /mnt/tmp-ums-test busy mount: according to mtab, /dev/sdd6 is already mounted on /mnt/tmp-ums-test diff --git a/test/ums/ums_gadget_test.sh b/test/ums/ums_gadget_test.sh cp ./$1 $MNT_DIR +sleep 2 umount $MNT_DIR I don't think there's any guarantee the "2" is the exact correct amount of time to sleep; I presume you derived the value by trying some values until you found one that works, and so the actual value required may vary from system to system. How about something like the following, which I use in a script that copies a new kernel to an SD card, where I experienced a similar issue: while true; do sudo umount /mnt/C-ROOT/ if [ $? -eq 0 ]; then break fi echo sleeping to wait for umount... sleep 1 done ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Can i pass pass an environmental variable or argument from command line to build u-boot?
Thanks Rini, We have freeze the code base of bootloader for 2014-07 main line. What can be another alternate approach? i was looking at the make file and i see that they take everything before _config and is sorted to find all the right pieces from boards.cfg file %_config:: outputmakefile @$(MKCONFIG) -A $(@:_config=) i was thinking to add something which can parse the Partnumber after the _config..i am not sure if its a good approach.. Thanks, Harsha -- View this message in context: http://u-boot.10912.n7.nabble.com/Can-i-pass-pass-an-environmental-variable-or-argument-from-command-line-to-build-u-boot-tp194962p194969.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [net/eth.c:64]: (error) Uninitialized variable: skip_state
On Thu, Nov 06, 2014 at 01:37:23PM +0100, Wolfgang Denk wrote: > Hello, > > cppcheck reports: > > [net/eth.c:64]: (error) Uninitialized variable: skip_state > > can you please have a look? Thanks! Dense code, like cmd_ini.c my cppcheck is OK and looking at the code manually I think it's fine too: return ((skip_state = getenv(enetvar)) != NULL); -- 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 (Secondary Program Loader) on iMX6SL
Hi Fabio, Thanks for the info. I will try to send some patch or file for iMX6 SabreSD and for iMX6SL-evk later today. Regards, john On Thu, Nov 6, 2014 at 4:43 AM, Fabio Estevam wrote: > Hi John, > > On Thu, Nov 6, 2014 at 12:54 AM, John Tobias wrote: >> Hi Fabio, >> >> The SPL support that I have done for sabresd is not %100 done. I just >> did that for the testing and to see if I could load the SPL image. >> >> Btw, I saw in freescale repository that they have the plugin feature. >> I enabled it but it didn't work. When I load the image, it jump to >> 0x00907000. >> >> Do you know how does it work?. > > You should not focus on the plugin feature. It was posted a few days > ago and the general agreement is that spl should be used instead. > > For spl example on mx6, you can look at gw_ventana, cm_fx6 and novena > boards as references. > > Regards, > > Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [common/cmd_ini.c:137]: (error) Uninitialized variable: line
On Thu, Nov 06, 2014 at 01:32:59PM +0100, Wolfgang Denk wrote: > Hello, > > cppcheck reports: > > [common/cmd_ini.c:137]: (error) Uninitialized variable: line > > can you please have a look? Thanks! trini@bill-the-cat:~/work/u-boot/u-boot-ti (master)$ cppcheck --version Cppcheck 1.52 trini@bill-the-cat:~/work/u-boot/u-boot-ti (master)$ cppcheck --force --inline-suppr common/cmd_ini.c Checking common/cmd_ini.c... Checking common/cmd_ini.c: CONFIG_INI_ALLOW_MULTILINE... Checking common/cmd_ini.c: CONFIG_INI_CASE_INSENSITIVE... Checking common/cmd_ini.c: CONFIG_INI_MAX_LINE... Checking common/cmd_ini.c: CONFIG_INI_MAX_NAME... Checking common/cmd_ini.c: CONFIG_INI_MAX_SECTION... And I don't see anything. I did this since manually inspecting things and the code looks correct here but I could see cppcheck failing to figure it out (and I could see the code being optimized, we pass line as a pointer but then also return that back..). -- 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, U-boot] net: phy: marvell: add errata w/a for 88E151* chips
On Wed, Nov 05, 2014 at 04:30:33PM -0500, Tom Rini wrote: > On Wed, Oct 29, 2014 at 08:38:23PM +0200, Khoronzhuk, Ivan wrote: > > > From: Hao Zhang > > > > As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/88E1514 > > Rev A0, Errata Section 3.1 Marvell PHY has an errata which requires > > that certain registers get written in order to restart > > autonegotiation. > > > > Signed-off-by: Hao Zhang > > Signed-off-by: Ivan Khoronzhuk > > Applied to u-boot-ti/master, thanks! ... Ivan pointed out there's a v2, dropping this one and getting the right one. -- 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, U-boot, v2] net: phy: marvell: add errata w/a for 88E151* chips
On Thu, Oct 30, 2014 at 06:59:43PM +0200, Ivan Khoronzhuk wrote: > From: Hao Zhang > > As per Marvell Release Notes - Alaska 88E1510/88E1518/88E1512/88E1514 > Rev A0, Errata Section 3.1 Marvell PHY has an errata which requires > that certain registers get written in order to restart > autonegotiation. > > Signed-off-by: Hao Zhang > Signed-off-by: Ivan Khoronzhuk > Reviewed-by: Stefan Roese Applied to u-boot-ti/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] Can i pass pass an environmental variable or argument from command line to build u-boot?
On Thu, Nov 06, 2014 at 08:30:35AM -0700, harsha kiran wrote: > Hi ! > > For our project, we are trying to build the Bootloader with a Software > partnumber. and i want it to be displayed on the first U-boot print.. Upgrade to current mainline and you can use CONFIG_LOCALVERSION for what you want. -- Tom signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Can i pass pass an environmental variable or argument from command line to build u-boot?
Hi ! For our project, we are trying to build the Bootloader with a Software partnumber. and i want it to be displayed on the first U-boot print.. U-Boot 2014.07 (Nov 05 2014 - 16:27:50) PN#12345678-001 I2C: ready DRAM: 256 MiB WARNING: Caches not enabled MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Using default environment I was able to do this by adding the following in the boards.cfg file.. Active arm armv7 am33xx ti am335x_abb_ubootam335x_abb_uboot_npa_dev am335x_abb_uboot:SERIAL4,CONS_INDEX=4,NPA_DEV,IDENT_STRING="PN#12345678-001" But i want to pass the IDENT_STRING from the command line to build the u-boot..the command i use is sudo make ARCH=arm CROSS_COMPILE=/abb/compilers/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf- -j8 -s am335x_abb_uboot_npa_dev_config is there a way i can pass this argument while building the u-boot? Thanks, Harsha -- View this message in context: http://u-boot.10912.n7.nabble.com/Can-i-pass-pass-an-environmental-variable-or-argument-from-command-line-to-build-u-boot-tp194962.html Sent from the U-Boot mailing list archive at Nabble.com. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [drivers/mtd/ubi/eba.c:1275]: (error) Uninitialized variable: aeb
Dear Heiko, In message <545b81d9.6070...@denx.de> you wrote: > > > > [drivers/mtd/ubi/eba.c:1275]: (error) Uninitialized variable: aeb > > > > can you please have a look? Thanks! > > I see in drivers/mtd/ubi/eba.c: > > 1267:ubi_rb_for_each_entry(rb, aeb, &av->root, u.rb) > 1268:scan_eba[i][aeb->lnum] = aeb->pnum; > 1269: > 1270:av = ubi_find_av(ai_fastmap, idx2vol_id(ubi, i)); > 1271:if (!av) > 1272: continue; > 1273: > 1274:ubi_rb_for_each_entry(rb, aeb, &av->root, u.rb) > 1275:fm_eba[i][aeb->lnum] = aeb->pnum; > > Why does cppcheck only report line 1275 not also line 1268 and also > 1351? I could not currently see, why this pops up for line 1274 ... we should also look at the ubi_rb_for_each_entry() macro: 912 #define ubi_rb_for_each_entry(rb, pos, root, member) \ 913 for (rb = rb_first(root), \ 914 pos = (rb ? container_of(rb, typeof(*pos), member) : NULL); \ 915 rb; \ 916 rb = rb_next(rb), \ 917 pos = (rb ? container_of(rb, typeof(*pos), member) : NULL)) We can see there, that this will always set "pos", i. e. the 2nd argument, to a well-defined value. Looks like a false positive to me, then. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Where would we be without rhetorical questions? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] mx6sabresd: Fix error handling in board_mmc_init()
When an invalid USDHC port is passed we should return -EINVAL instead of 0. Also, return the error immediately on fsl_esdhc_initialize() failure. Signed-off-by: Fabio Estevam --- board/freescale/mx6sabresd/mx6sabresd.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 3d81fff..e221981 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -253,7 +253,7 @@ int board_mmc_getcd(struct mmc *mmc) int board_mmc_init(bd_t *bis) { - s32 status = 0; + int ret; int i; /* @@ -286,13 +286,15 @@ int board_mmc_init(bd_t *bis) printf("Warning: you configured more USDHC controllers" "(%d) then supported by the board (%d)\n", i + 1, CONFIG_SYS_FSL_USDHC_NUM); - return status; + return -EINVAL; } - status |= fsl_esdhc_initialize(bis, &usdhc_cfg[i]); + ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]); + if (ret) + return ret; } - return status; + return 0; } #endif -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2 11/11] beagle_x15: add board support for Beagle x15
On Thu, Nov 6, 2014 at 8:44 AM, Felipe Balbi wrote: > BeagleBoard-X15 is the next generation Open Source > Hardware BeagleBoard based on TI's AM5728 SoC > featuring dual core 1.5GHZ A15 processor. The > platform features 2GB DDR3L (w/dual 32bit busses), > eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), > separate LCD port, video In port, 4GB eMMC, uSD, > Analog audio in/out, dual 1G Ethernet. > > For more information, refer to: > http://www.elinux.org/Beagleboard:BeagleBoard-X15 > > Signed-off-by: Felipe Balbi > Signed-off-by: Nishanth Menon > --- > awesome - looks good to me. Thanks for doing this. > changes since v1: > new commit log > > arch/arm/cpu/armv7/omap5/Kconfig | 4 + > board/ti/beagle_x15/Kconfig | 12 ++ > board/ti/beagle_x15/Makefile | 8 + > board/ti/beagle_x15/board.c | 328 > ++ > board/ti/beagle_x15/mux_data.h| 55 +++ > configs/beagle_x15_defconfig | 5 + > include/configs/beagle_x15.h | 89 +++ > include/configs/ti_omap5_common.h | 2 + > 8 files changed, 503 insertions(+) > create mode 100644 board/ti/beagle_x15/Kconfig > create mode 100644 board/ti/beagle_x15/Makefile > create mode 100644 board/ti/beagle_x15/board.c > create mode 100644 board/ti/beagle_x15/mux_data.h > create mode 100644 configs/beagle_x15_defconfig > create mode 100644 include/configs/beagle_x15.h > > diff --git a/arch/arm/cpu/armv7/omap5/Kconfig > b/arch/arm/cpu/armv7/omap5/Kconfig > index 129982c..aca862d 100644 > --- a/arch/arm/cpu/armv7/omap5/Kconfig > +++ b/arch/arm/cpu/armv7/omap5/Kconfig > @@ -12,6 +12,9 @@ config TARGET_OMAP5_UEVM > config TARGET_DRA7XX_EVM > bool "TI DRA7XX" > > +config TARGET_BEAGLE_X15 > + bool "BeagleBoard X15" > + > endchoice > > config SYS_SOC > @@ -20,5 +23,6 @@ config SYS_SOC > source "board/compulab/cm_t54/Kconfig" > source "board/ti/omap5_uevm/Kconfig" > source "board/ti/dra7xx/Kconfig" > +source "board/ti/beagle_x15/Kconfig" > > endif > diff --git a/board/ti/beagle_x15/Kconfig b/board/ti/beagle_x15/Kconfig > new file mode 100644 > index 000..a305ff1 > --- /dev/null > +++ b/board/ti/beagle_x15/Kconfig > @@ -0,0 +1,12 @@ > +if TARGET_BEAGLE_X15 > + > +config SYS_BOARD > + default "beagle_x15" > + > +config SYS_VENDOR > + default "ti" > + > +config SYS_CONFIG_NAME > + default "beagle_x15" > + > +endif > diff --git a/board/ti/beagle_x15/Makefile b/board/ti/beagle_x15/Makefile > new file mode 100644 > index 000..5cd6873 > --- /dev/null > +++ b/board/ti/beagle_x15/Makefile > @@ -0,0 +1,8 @@ > +# > +# (C) Copyright 2014 > +# Texas Instruments, > +# > +# SPDX-License-Identifier: GPL-2.0+ > +# > + > +obj-y := board.o > diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c > new file mode 100644 > index 000..5cafc87 > --- /dev/null > +++ b/board/ti/beagle_x15/board.c > @@ -0,0 +1,328 @@ > +/* > + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com > + * > + * Author: Felipe Balbi > + * > + * Based on board/ti/dra7xx/evm.c > + * > + * SPDX-License-Identifier:GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "mux_data.h" > + > +#ifdef CONFIG_DRIVER_TI_CPSW > +#include > +#endif > + > +DECLARE_GLOBAL_DATA_PTR; > + > +const struct omap_sysinfo sysinfo = { > + "Board: BeagleBoard x15\n" > +}; > + > +static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = { > + .dmm_lisa_map_3 = 0x80740300, > + .is_ma_present = 0x1 > +}; > + > +void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) > +{ > + *dmm_lisa_regs = &beagle_x15_lisa_regs; > +} > + > +static const struct emif_regs beagle_x15_ddr3_532mhz_emif_regs = { > + .sdram_config_init = 0x61851B32, /* dont know what to do about > this */ > + .sdram_config = 0x61851B32, > + .sdram_config2 = 0x, > + .ref_ctrl = 0x1035, > + .sdram_tim1 = 0xCEEF266B, > + .sdram_tim2 = 0x328F7FDA, > + .sdram_tim3 = 0x027F88A8, > + .read_idle_ctrl = 0x00050001, /* not sure where in gel file */ > + .zq_config = 0x0007190B, > + .temp_alert_config = 0x, > + .emif_ddr_phy_ctlr_1_init = 0x0E24400A, /* not sure what to do about > this */ > + .emif_ddr_phy_ctlr_1= 0x0E24400A, /* based on non hw level > enabled */ > + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, /* not sure wherein gel file */ > + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, > + .emif_ddr_ext_phy_ctrl_3 = 0x00780078, > + .emif_ddr_ext_phy_ctrl_4 = 0x007c007c, > + .emif_ddr_ext_phy_ctrl_5 = 0x007b007b, > + .emif_rd_wr_lvl_rmp_win = 0x, > + .emif_rd_wr_lvl_rmp_ctl = 0x, /* based
[U-Boot] [PATCH v2 11/11] beagle_x15: add board support for Beagle x15
BeagleBoard-X15 is the next generation Open Source Hardware BeagleBoard based on TI's AM5728 SoC featuring dual core 1.5GHZ A15 processor. The platform features 2GB DDR3L (w/dual 32bit busses), eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), separate LCD port, video In port, 4GB eMMC, uSD, Analog audio in/out, dual 1G Ethernet. For more information, refer to: http://www.elinux.org/Beagleboard:BeagleBoard-X15 Signed-off-by: Felipe Balbi Signed-off-by: Nishanth Menon --- changes since v1: new commit log arch/arm/cpu/armv7/omap5/Kconfig | 4 + board/ti/beagle_x15/Kconfig | 12 ++ board/ti/beagle_x15/Makefile | 8 + board/ti/beagle_x15/board.c | 328 ++ board/ti/beagle_x15/mux_data.h| 55 +++ configs/beagle_x15_defconfig | 5 + include/configs/beagle_x15.h | 89 +++ include/configs/ti_omap5_common.h | 2 + 8 files changed, 503 insertions(+) create mode 100644 board/ti/beagle_x15/Kconfig create mode 100644 board/ti/beagle_x15/Makefile create mode 100644 board/ti/beagle_x15/board.c create mode 100644 board/ti/beagle_x15/mux_data.h create mode 100644 configs/beagle_x15_defconfig create mode 100644 include/configs/beagle_x15.h diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig index 129982c..aca862d 100644 --- a/arch/arm/cpu/armv7/omap5/Kconfig +++ b/arch/arm/cpu/armv7/omap5/Kconfig @@ -12,6 +12,9 @@ config TARGET_OMAP5_UEVM config TARGET_DRA7XX_EVM bool "TI DRA7XX" +config TARGET_BEAGLE_X15 + bool "BeagleBoard X15" + endchoice config SYS_SOC @@ -20,5 +23,6 @@ config SYS_SOC source "board/compulab/cm_t54/Kconfig" source "board/ti/omap5_uevm/Kconfig" source "board/ti/dra7xx/Kconfig" +source "board/ti/beagle_x15/Kconfig" endif diff --git a/board/ti/beagle_x15/Kconfig b/board/ti/beagle_x15/Kconfig new file mode 100644 index 000..a305ff1 --- /dev/null +++ b/board/ti/beagle_x15/Kconfig @@ -0,0 +1,12 @@ +if TARGET_BEAGLE_X15 + +config SYS_BOARD + default "beagle_x15" + +config SYS_VENDOR + default "ti" + +config SYS_CONFIG_NAME + default "beagle_x15" + +endif diff --git a/board/ti/beagle_x15/Makefile b/board/ti/beagle_x15/Makefile new file mode 100644 index 000..5cd6873 --- /dev/null +++ b/board/ti/beagle_x15/Makefile @@ -0,0 +1,8 @@ +# +# (C) Copyright 2014 +# Texas Instruments, +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := board.o diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c new file mode 100644 index 000..5cafc87 --- /dev/null +++ b/board/ti/beagle_x15/board.c @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com + * + * Author: Felipe Balbi + * + * Based on board/ti/dra7xx/evm.c + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mux_data.h" + +#ifdef CONFIG_DRIVER_TI_CPSW +#include +#endif + +DECLARE_GLOBAL_DATA_PTR; + +const struct omap_sysinfo sysinfo = { + "Board: BeagleBoard x15\n" +}; + +static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = { + .dmm_lisa_map_3 = 0x80740300, + .is_ma_present = 0x1 +}; + +void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) +{ + *dmm_lisa_regs = &beagle_x15_lisa_regs; +} + +static const struct emif_regs beagle_x15_ddr3_532mhz_emif_regs = { + .sdram_config_init = 0x61851B32, /* dont know what to do about this */ + .sdram_config = 0x61851B32, + .sdram_config2 = 0x, + .ref_ctrl = 0x1035, + .sdram_tim1 = 0xCEEF266B, + .sdram_tim2 = 0x328F7FDA, + .sdram_tim3 = 0x027F88A8, + .read_idle_ctrl = 0x00050001, /* not sure where in gel file */ + .zq_config = 0x0007190B, + .temp_alert_config = 0x, + .emif_ddr_phy_ctlr_1_init = 0x0E24400A, /* not sure what to do about this */ + .emif_ddr_phy_ctlr_1= 0x0E24400A, /* based on non hw level enabled */ + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, /* not sure wherein gel file */ + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, + .emif_ddr_ext_phy_ctrl_3 = 0x00780078, + .emif_ddr_ext_phy_ctrl_4 = 0x007c007c, + .emif_ddr_ext_phy_ctrl_5 = 0x007b007b, + .emif_rd_wr_lvl_rmp_win = 0x, + .emif_rd_wr_lvl_rmp_ctl = 0x, /* based on non hw level enabled */ + .emif_rd_wr_lvl_ctl = 0x, /* not sure where based in gel file */ + .emif_rd_wr_exec_thresh = 0x0305 +}; + +void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs) +{ + *regs = &beagle_x15_ddr3_532mhz_emif_regs; +} + +static const u32 beagle_x15_ddr3_ext_phy_ctrl_const_regs[] = { + 0x00800080, // 6 + + + 0x00360036, // 7 + 0x00
Re: [U-Boot] [PATCH 11/11] beagle_x15: add board support for Beagle x15
On Thu, Nov 06, 2014 at 08:35:41AM -0600, menon.nisha...@gmail.com wrote: > On Thu, Nov 6, 2014 at 8:28 AM, Felipe Balbi wrote: > > This is the bare minimum support for Beagle x15 > > into u-boot. There is still quite some work in > > order to get this in good shape, but it's a > > start. > > > > Sorry, I should have commented earlier :) > > we could expand this a little more here? > How about: > BeagleBoard-X15 is the next generation Open Source Hardware > BeagleBoard based on TI's AM5728 SoC featuring dual core 1.5GHZ A15 > processor. The platform features 2GB DDR3L (w/dual 32bit busses), > eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), separate LCD > port, video In port, 4GB eMMC, uSD, Analog audio in/out, dual 1G > Ethernet. > > For more information, refer to: > http://www.elinux.org/Beagleboard:BeagleBoard-X15 > > ofcourse - the wiki is yet to be built up.. will do, it has been a while since this stopped being "bare minimum" anyway. It's actually pretty complete from u-boot's point of view. -- balbi signature.asc Description: Digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2] mx6sabresd: Staticize when possible
Annotate 'static' when appropriate for the variables used locally. Signed-off-by: Fabio Estevam --- board/freescale/mx6sabresd/mx6sabresd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index e221981..8e2bc25 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -60,12 +60,12 @@ int dram_init(void) return 0; } -iomux_v3_cfg_t const uart1_pads[] = { +static iomux_v3_cfg_t const uart1_pads[] = { MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL), }; -iomux_v3_cfg_t const enet_pads[] = { +static iomux_v3_cfg_t const enet_pads[] = { MX6_PAD_ENET_MDIO__ENET_MDIO| MUX_PAD_CTRL(ENET_PAD_CTRL), MX6_PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL), MX6_PAD_RGMII_TXC__RGMII_TXC| MUX_PAD_CTRL(ENET_PAD_CTRL), @@ -95,7 +95,7 @@ static void setup_iomux_enet(void) gpio_set_value(IMX_GPIO_NR(1, 25), 1); } -iomux_v3_cfg_t const usdhc2_pads[] = { +static iomux_v3_cfg_t const usdhc2_pads[] = { MX6_PAD_SD2_CLK__SD2_CLK| MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD2_CMD__SD2_CMD| MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -109,7 +109,7 @@ iomux_v3_cfg_t const usdhc2_pads[] = { MX6_PAD_NANDF_D2__GPIO2_IO02| MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */ }; -iomux_v3_cfg_t const usdhc3_pads[] = { +static iomux_v3_cfg_t const usdhc3_pads[] = { MX6_PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -123,7 +123,7 @@ iomux_v3_cfg_t const usdhc3_pads[] = { MX6_PAD_NANDF_D0__GPIO2_IO00| MUX_PAD_CTRL(NO_PAD_CTRL), /* CD */ }; -iomux_v3_cfg_t const usdhc4_pads[] = { +static iomux_v3_cfg_t const usdhc4_pads[] = { MX6_PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), MX6_PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), @@ -136,7 +136,7 @@ iomux_v3_cfg_t const usdhc4_pads[] = { MX6_PAD_SD4_DAT7__SD4_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), }; -iomux_v3_cfg_t const ecspi1_pads[] = { +static iomux_v3_cfg_t const ecspi1_pads[] = { MX6_PAD_KEY_COL0__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL), MX6_PAD_KEY_COL1__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL), MX6_PAD_KEY_ROW0__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL), -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 11/11] beagle_x15: add board support for Beagle x15
On Thu, Nov 6, 2014 at 8:28 AM, Felipe Balbi wrote: > This is the bare minimum support for Beagle x15 > into u-boot. There is still quite some work in > order to get this in good shape, but it's a > start. > Sorry, I should have commented earlier :) we could expand this a little more here? How about: BeagleBoard-X15 is the next generation Open Source Hardware BeagleBoard based on TI's AM5728 SoC featuring dual core 1.5GHZ A15 processor. The platform features 2GB DDR3L (w/dual 32bit busses), eSATA, 3 USB3.0 ports, integrated HDMI (1920x108@60), separate LCD port, video In port, 4GB eMMC, uSD, Analog audio in/out, dual 1G Ethernet. For more information, refer to: http://www.elinux.org/Beagleboard:BeagleBoard-X15 ofcourse - the wiki is yet to be built up.. > Signed-off-by: Felipe Balbi > Signed-off-by: Nishanth Menon > --- > arch/arm/cpu/armv7/omap5/Kconfig | 4 + > board/ti/beagle_x15/Kconfig | 12 ++ > board/ti/beagle_x15/Makefile | 8 + > board/ti/beagle_x15/board.c | 328 > ++ > board/ti/beagle_x15/mux_data.h| 55 +++ > configs/beagle_x15_defconfig | 5 + > include/configs/beagle_x15.h | 89 +++ > include/configs/ti_omap5_common.h | 2 + > 8 files changed, 503 insertions(+) > create mode 100644 board/ti/beagle_x15/Kconfig > create mode 100644 board/ti/beagle_x15/Makefile > create mode 100644 board/ti/beagle_x15/board.c > create mode 100644 board/ti/beagle_x15/mux_data.h > create mode 100644 configs/beagle_x15_defconfig > create mode 100644 include/configs/beagle_x15.h > > diff --git a/arch/arm/cpu/armv7/omap5/Kconfig > b/arch/arm/cpu/armv7/omap5/Kconfig > index 129982c..aca862d 100644 > --- a/arch/arm/cpu/armv7/omap5/Kconfig > +++ b/arch/arm/cpu/armv7/omap5/Kconfig > @@ -12,6 +12,9 @@ config TARGET_OMAP5_UEVM > config TARGET_DRA7XX_EVM > bool "TI DRA7XX" > > +config TARGET_BEAGLE_X15 > + bool "BeagleBoard X15" > + > endchoice > > config SYS_SOC > @@ -20,5 +23,6 @@ config SYS_SOC > source "board/compulab/cm_t54/Kconfig" > source "board/ti/omap5_uevm/Kconfig" > source "board/ti/dra7xx/Kconfig" > +source "board/ti/beagle_x15/Kconfig" > > endif > diff --git a/board/ti/beagle_x15/Kconfig b/board/ti/beagle_x15/Kconfig > new file mode 100644 > index 000..a305ff1 > --- /dev/null > +++ b/board/ti/beagle_x15/Kconfig > @@ -0,0 +1,12 @@ > +if TARGET_BEAGLE_X15 > + > +config SYS_BOARD > + default "beagle_x15" > + > +config SYS_VENDOR > + default "ti" > + > +config SYS_CONFIG_NAME > + default "beagle_x15" > + > +endif > diff --git a/board/ti/beagle_x15/Makefile b/board/ti/beagle_x15/Makefile > new file mode 100644 > index 000..5cd6873 > --- /dev/null > +++ b/board/ti/beagle_x15/Makefile > @@ -0,0 +1,8 @@ > +# > +# (C) Copyright 2014 > +# Texas Instruments, > +# > +# SPDX-License-Identifier: GPL-2.0+ > +# > + > +obj-y := board.o > diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c > new file mode 100644 > index 000..5cafc87 > --- /dev/null > +++ b/board/ti/beagle_x15/board.c > @@ -0,0 +1,328 @@ > +/* > + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com > + * > + * Author: Felipe Balbi > + * > + * Based on board/ti/dra7xx/evm.c > + * > + * SPDX-License-Identifier:GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "mux_data.h" > + > +#ifdef CONFIG_DRIVER_TI_CPSW > +#include > +#endif > + > +DECLARE_GLOBAL_DATA_PTR; > + > +const struct omap_sysinfo sysinfo = { > + "Board: BeagleBoard x15\n" > +}; > + > +static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = { > + .dmm_lisa_map_3 = 0x80740300, > + .is_ma_present = 0x1 > +}; > + > +void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) > +{ > + *dmm_lisa_regs = &beagle_x15_lisa_regs; > +} > + > +static const struct emif_regs beagle_x15_ddr3_532mhz_emif_regs = { > + .sdram_config_init = 0x61851B32, /* dont know what to do about > this */ > + .sdram_config = 0x61851B32, > + .sdram_config2 = 0x, > + .ref_ctrl = 0x1035, > + .sdram_tim1 = 0xCEEF266B, > + .sdram_tim2 = 0x328F7FDA, > + .sdram_tim3 = 0x027F88A8, > + .read_idle_ctrl = 0x00050001, /* not sure where in gel file */ > + .zq_config = 0x0007190B, > + .temp_alert_config = 0x, > + .emif_ddr_phy_ctlr_1_init = 0x0E24400A, /* not sure what to do about > this */ > + .emif_ddr_phy_ctlr_1= 0x0E24400A, /* based on non hw level > enabled */ > + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, /* not sure wherein gel file */ > + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, > + .emif_ddr_ext_phy_ctrl_3 = 0x00780078,
[U-Boot] [PATCH 10/11] arm: omap: add support for am57xx devices
just add a few ifdefs around because this device is very similar to dra7xxx. Signed-off-by: Felipe Balbi --- arch/arm/cpu/armv7/omap-common/boot-common.c | 2 +- arch/arm/include/asm/arch-omap5/clock.h | 2 +- arch/arm/include/asm/arch-omap5/omap.h | 4 ++-- drivers/mmc/omap_hsmmc.c | 5 +++-- drivers/power/palmas.c | 2 +- drivers/spi/ti_qspi.c| 8 include/linux/usb/xhci-omap.h| 4 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c index fb535eb..b819fe2 100644 --- a/arch/arm/cpu/armv7/omap-common/boot-common.c +++ b/arch/arm/cpu/armv7/omap-common/boot-common.c @@ -57,7 +57,7 @@ void save_omap_boot_params(void) } } -#ifdef CONFIG_DRA7XX +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) /* * We get different values for QSPI_1 and QSPI_4 being used, but * don't actually care about this difference. Rather than diff --git a/arch/arm/include/asm/arch-omap5/clock.h b/arch/arm/include/asm/arch-omap5/clock.h index 7eacba2..0dc584b 100644 --- a/arch/arm/include/asm/arch-omap5/clock.h +++ b/arch/arm/include/asm/arch-omap5/clock.h @@ -314,7 +314,7 @@ */ #define CONFIG_DEFAULT_OMAP_RESET_TIME_MAX_USEC31219 -#ifdef CONFIG_DRA7XX +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) #define V_OSCK 2000/* Clock output from T2 */ #else #define V_OSCK 1920/* Clock output from T2 */ diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h index b9600cf..e218159 100644 --- a/arch/arm/include/asm/arch-omap5/omap.h +++ b/arch/arm/include/asm/arch-omap5/omap.h @@ -27,7 +27,7 @@ #define CONTROL_CORE_ID_CODE 0x4A002204 #define CONTROL_WKUP_ID_CODE 0x4AE0C204 -#ifdef CONFIG_DRA7XX +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) #define CONTROL_ID_CODECONTROL_WKUP_ID_CODE #else #define CONTROL_ID_CODECONTROL_CORE_ID_CODE @@ -163,7 +163,7 @@ struct s32ktimer { * much larger) and do not, at this time, make use of the additional * space. */ -#ifdef CONFIG_DRA7XX +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) #define NON_SECURE_SRAM_START 0x4030 #define NON_SECURE_SRAM_END0x4038 /* Not inclusive */ #else diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index ef2cbf9..1bfbe2a 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -661,7 +661,8 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio, case 1: priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC2_BASE; #if (defined(CONFIG_OMAP44XX) || defined(CONFIG_OMAP54XX) || \ - defined(CONFIG_DRA7XX)) && defined(CONFIG_HSMMC2_8BIT) + defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)) && \ + defined(CONFIG_HSMMC2_8BIT) /* Enable 8-bit interface for eMMC on OMAP4/5 or DRA7XX */ host_caps_val |= MMC_MODE_8BIT; #endif @@ -670,7 +671,7 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio, #ifdef OMAP_HSMMC3_BASE case 2: priv_data->base_addr = (struct hsmmc *)OMAP_HSMMC3_BASE; -#if defined(CONFIG_DRA7XX) && defined(CONFIG_HSMMC3_8BIT) +#if (defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)) && defined(CONFIG_HSMMC3_8BIT) /* Enable 8-bit interface for eMMC on DRA7XX */ host_caps_val |= MMC_MODE_8BIT; #endif diff --git a/drivers/power/palmas.c b/drivers/power/palmas.c index cfbc9dc..6430fe0 100644 --- a/drivers/power/palmas.c +++ b/drivers/power/palmas.c @@ -27,7 +27,7 @@ int palmas_mmc1_poweron_ldo(void) { u8 val = 0; -#if defined(CONFIG_DRA7XX) +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) /* * Currently valid for the dra7xx_evm board: * Set TPS659038 LDO1 to 3.0 V diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c index fd7fea8..857b604 100644 --- a/drivers/spi/ti_qspi.c +++ b/drivers/spi/ti_qspi.c @@ -102,7 +102,7 @@ static void ti_spi_setup_spi_register(struct ti_qspi_slave *qslave) struct spi_slave *slave = &qslave->slave; u32 memval = 0; -#ifdef CONFIG_DRA7XX +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) slave->memory_map = (void *)MMAP_START_ADDR_DRA; #else slave->memory_map = (void *)MMAP_START_ADDR_AM43x; @@ -244,7 +244,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, uint status; int timeout; -#ifdef CONFIG_DRA7XX +#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX) int val; #endif @@ -254,7 +254,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, /* Setup mmap flags */ if (flags & SPI_XFER_MMAP) {
[U-Boot] [PATCH 09/11] arm: omap_common: expose tps659038 and dra7xx_dplls
expose those two definitions so they can be used by another board which we're adding in upcoming patches. Signed-off-by: Felipe Balbi --- arch/arm/include/asm/omap_common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h index 1838234..323952f 100644 --- a/arch/arm/include/asm/omap_common.h +++ b/arch/arm/include/asm/omap_common.h @@ -540,6 +540,7 @@ extern struct prcm_regs const omap5_es2_prcm; extern struct prcm_regs const omap4_prcm; extern struct prcm_regs const dra7xx_prcm; extern struct dplls const **dplls_data; +extern struct dplls dra7xx_dplls; extern struct vcores_data const **omap_vcores; extern const u32 sys_clk_array[8]; extern struct omap_sys_ctrl_regs const **ctrl; @@ -547,6 +548,8 @@ extern struct omap_sys_ctrl_regs const omap4_ctrl; extern struct omap_sys_ctrl_regs const omap5_ctrl; extern struct omap_sys_ctrl_regs const dra7xx_ctrl; +extern struct pmic_data tps659038; + void hw_data_init(void); const struct dpll_params *get_mpu_dpll_params(struct dplls const *); -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 06/11] configs: omap5_common : Boot rootfs from sd card by default
From: Franklin S Cooper Jr * Since the emmc isn't always programed trying to load the fs from the emmc causes boot failures/kernel panic. * The current bootcmd is set to: bootcmd=run findfdt; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; \ setenv mmcroot /dev/mmcblk0p2 rw; run mmcboot; My guess is the env variables should be set so that sd card boot (dt,kernel,fs) is the default and then fallback to emmc if it fails (no sd card detected) The current bootcmd attempts to set mmcroot to the sd card rootfs but that code doesn't run due to mmcboot being ran early on. Signed-off-by: Franklin Cooper Jr. Signed-off-by: Felipe Balbi --- include/configs/ti_omap5_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index 5b03fb1..de96d7d 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -78,7 +78,7 @@ "partitions=" PARTS_DEFAULT "\0" \ "optargs=\0" \ "mmcdev=0\0" \ - "mmcroot=/dev/mmcblk1p2 rw\0" \ + "mmcroot=/dev/mmcblk0p2 rw\0" \ "mmcrootfstype=ext4 rootwait\0" \ "mmcargs=setenv bootargs console=${console} " \ "${optargs} " \ -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 08/11] arm: omap5: sdram: mark emif_get_ext_phy_ctrl_const_regs __weak
this will allow for boards to overwrite those in case memory setup is different. Signed-off-by: Felipe Balbi --- arch/arm/cpu/armv7/omap5/sdram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/omap5/sdram.c b/arch/arm/cpu/armv7/omap5/sdram.c index 065199b..7d8cec0 100644 --- a/arch/arm/cpu/armv7/omap5/sdram.c +++ b/arch/arm/cpu/armv7/omap5/sdram.c @@ -513,7 +513,7 @@ const struct lpddr2_mr_regs mr_regs = { .mr16 = MR16_REF_FULL_ARRAY }; -static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr, +void __weak emif_get_ext_phy_ctrl_const_regs(u32 emif_nr, const u32 **regs, u32 *size) { -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 11/11] beagle_x15: add board support for Beagle x15
This is the bare minimum support for Beagle x15 into u-boot. There is still quite some work in order to get this in good shape, but it's a start. Signed-off-by: Felipe Balbi Signed-off-by: Nishanth Menon --- arch/arm/cpu/armv7/omap5/Kconfig | 4 + board/ti/beagle_x15/Kconfig | 12 ++ board/ti/beagle_x15/Makefile | 8 + board/ti/beagle_x15/board.c | 328 ++ board/ti/beagle_x15/mux_data.h| 55 +++ configs/beagle_x15_defconfig | 5 + include/configs/beagle_x15.h | 89 +++ include/configs/ti_omap5_common.h | 2 + 8 files changed, 503 insertions(+) create mode 100644 board/ti/beagle_x15/Kconfig create mode 100644 board/ti/beagle_x15/Makefile create mode 100644 board/ti/beagle_x15/board.c create mode 100644 board/ti/beagle_x15/mux_data.h create mode 100644 configs/beagle_x15_defconfig create mode 100644 include/configs/beagle_x15.h diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig index 129982c..aca862d 100644 --- a/arch/arm/cpu/armv7/omap5/Kconfig +++ b/arch/arm/cpu/armv7/omap5/Kconfig @@ -12,6 +12,9 @@ config TARGET_OMAP5_UEVM config TARGET_DRA7XX_EVM bool "TI DRA7XX" +config TARGET_BEAGLE_X15 + bool "BeagleBoard X15" + endchoice config SYS_SOC @@ -20,5 +23,6 @@ config SYS_SOC source "board/compulab/cm_t54/Kconfig" source "board/ti/omap5_uevm/Kconfig" source "board/ti/dra7xx/Kconfig" +source "board/ti/beagle_x15/Kconfig" endif diff --git a/board/ti/beagle_x15/Kconfig b/board/ti/beagle_x15/Kconfig new file mode 100644 index 000..a305ff1 --- /dev/null +++ b/board/ti/beagle_x15/Kconfig @@ -0,0 +1,12 @@ +if TARGET_BEAGLE_X15 + +config SYS_BOARD + default "beagle_x15" + +config SYS_VENDOR + default "ti" + +config SYS_CONFIG_NAME + default "beagle_x15" + +endif diff --git a/board/ti/beagle_x15/Makefile b/board/ti/beagle_x15/Makefile new file mode 100644 index 000..5cd6873 --- /dev/null +++ b/board/ti/beagle_x15/Makefile @@ -0,0 +1,8 @@ +# +# (C) Copyright 2014 +# Texas Instruments, +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := board.o diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c new file mode 100644 index 000..5cafc87 --- /dev/null +++ b/board/ti/beagle_x15/board.c @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com + * + * Author: Felipe Balbi + * + * Based on board/ti/dra7xx/evm.c + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mux_data.h" + +#ifdef CONFIG_DRIVER_TI_CPSW +#include +#endif + +DECLARE_GLOBAL_DATA_PTR; + +const struct omap_sysinfo sysinfo = { + "Board: BeagleBoard x15\n" +}; + +static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = { + .dmm_lisa_map_3 = 0x80740300, + .is_ma_present = 0x1 +}; + +void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs) +{ + *dmm_lisa_regs = &beagle_x15_lisa_regs; +} + +static const struct emif_regs beagle_x15_ddr3_532mhz_emif_regs = { + .sdram_config_init = 0x61851B32, /* dont know what to do about this */ + .sdram_config = 0x61851B32, + .sdram_config2 = 0x, + .ref_ctrl = 0x1035, + .sdram_tim1 = 0xCEEF266B, + .sdram_tim2 = 0x328F7FDA, + .sdram_tim3 = 0x027F88A8, + .read_idle_ctrl = 0x00050001, /* not sure where in gel file */ + .zq_config = 0x0007190B, + .temp_alert_config = 0x, + .emif_ddr_phy_ctlr_1_init = 0x0E24400A, /* not sure what to do about this */ + .emif_ddr_phy_ctlr_1= 0x0E24400A, /* based on non hw level enabled */ + .emif_ddr_ext_phy_ctrl_1 = 0x10040100, /* not sure wherein gel file */ + .emif_ddr_ext_phy_ctrl_2 = 0x00740074, + .emif_ddr_ext_phy_ctrl_3 = 0x00780078, + .emif_ddr_ext_phy_ctrl_4 = 0x007c007c, + .emif_ddr_ext_phy_ctrl_5 = 0x007b007b, + .emif_rd_wr_lvl_rmp_win = 0x, + .emif_rd_wr_lvl_rmp_ctl = 0x, /* based on non hw level enabled */ + .emif_rd_wr_lvl_ctl = 0x, /* not sure where based in gel file */ + .emif_rd_wr_exec_thresh = 0x0305 +}; + +void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs) +{ + *regs = &beagle_x15_ddr3_532mhz_emif_regs; +} + +static const u32 beagle_x15_ddr3_ext_phy_ctrl_const_regs[] = { + 0x00800080, // 6 + + + 0x00360036, // 7 + 0x00340034, // 8 + 0x00360036, // 9 + 0x00350035, // 10 + 0x00350035, // 11 + + 0x01ff01ff, // 12 + 0x01ff01ff, + 0x01ff01ff, + 0x01ff01ff, + 0x01ff01ff, + + 0x00430043, + 0x003e003e, + 0x004a004a, + 0x00470047, + 0x00400040, + + 0x
[U-Boot] [PATCH 05/11] arm: omap-common: emif: allow to map memory without interleaving
If we want to have two sections, one on each EMIF, without interleaving, current code wouldn't enable emif2. Fix that problem. Signed-off-by: Felipe Balbi --- arch/arm/cpu/armv7/omap-common/emif-common.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/armv7/omap-common/emif-common.c b/arch/arm/cpu/armv7/omap-common/emif-common.c index c8e9bc8..e601ba1 100644 --- a/arch/arm/cpu/armv7/omap-common/emif-common.c +++ b/arch/arm/cpu/armv7/omap-common/emif-common.c @@ -1226,13 +1226,14 @@ void dmm_init(u32 base) emif1_enabled = 1; emif2_enabled = 1; break; - } else if (valid == 1) { + } + + if (valid == 1) emif1_enabled = 1; - } else if (valid == 2) { + + if (valid == 2) emif2_enabled = 1; - } } - } static void do_bug0039_workaround(u32 base) -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 01/11] arm: omap5: don't enable misc_init_r by default
Out of all OMAP5-like boards, only one of them needs CONFIG_MISC_INIT_R, so it's best to enable that for that particular board only, instead of enabling for all boards unconditionally. Signed-off-by: Felipe Balbi --- board/ti/dra7xx/evm.c | 12 include/configs/cm_t54.h | 1 - include/configs/omap5_uevm.h | 1 + include/configs/ti_omap5_common.h | 1 - 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 37df7b2..6522241 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -96,18 +96,6 @@ int board_late_init(void) return 0; } -/** - * @brief misc_init_r - Configure EVM board specific configurations - * such as power configurations, ethernet initialization as phase2 of - * boot sequence - * - * @return 0 - */ -int misc_init_r(void) -{ - return 0; -} - static void do_set_mux32(u32 base, struct pad_conf_entry const *array, int size) { diff --git a/include/configs/cm_t54.h b/include/configs/cm_t54.h index 641ab48..92ce1e1 100644 --- a/include/configs/cm_t54.h +++ b/include/configs/cm_t54.h @@ -16,7 +16,6 @@ #include -#undef CONFIG_MISC_INIT_R #undef CONFIG_SPL_OS_BOOT /* Enable Generic board */ diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h index e8dc462..e07795f 100644 --- a/include/configs/omap5_uevm.h +++ b/include/configs/omap5_uevm.h @@ -23,6 +23,7 @@ #define CONFIG_SYS_NS16550_COM3UART3_BASE #define CONFIG_BAUDRATE115200 +#define CONFIG_MISC_INIT_R /* MMC ENV related defines */ #define CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */ diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index 3166392..5b03fb1 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -19,7 +19,6 @@ #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO -#define CONFIG_MISC_INIT_R #define CONFIG_ARCH_CPU_INIT #define CONFIG_SYS_CACHELINE_SIZE 64 -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 03/11] arm: dra7xx: prcm: add missing registers
some boards might want to use USB1 for host, without fiddling those registers it'll be impossible. Signed-off-by: Felipe Balbi --- arch/arm/cpu/armv7/omap5/prcm-regs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c b/arch/arm/cpu/armv7/omap5/prcm-regs.c index ff08ef4..0745d42 100644 --- a/arch/arm/cpu/armv7/omap5/prcm-regs.c +++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c @@ -376,6 +376,7 @@ struct omap_sys_ctrl_regs const omap5_ctrl = { struct omap_sys_ctrl_regs const dra7xx_ctrl = { .control_status = 0x4A002134, + .control_phy_power_usb = 0x4A002370, .control_phy_power_sata = 0x4A002374, .control_core_mac_id_0_lo = 0x4A002514, .control_core_mac_id_0_hi = 0x4A002518, @@ -800,6 +801,7 @@ struct prcm_regs const dra7xx_prcm = { .cm_clkmode_dpll_dsp= 0x4a005234, .cm_shadow_freq_config1 = 0x4a005260, .cm_clkmode_dpll_gmac = 0x4a0052a8, + .cm_coreaon_usb_phy_core_clkctrl= 0x4a008640, .cm_coreaon_usb_phy2_core_clkctrl = 0x4a008688, /* cm1.mpu */ @@ -906,6 +908,7 @@ struct prcm_regs const dra7xx_prcm = { .cm_gmac_gmac_clkctrl = 0x4a0093d0, .cm_l3init_ocp2scp1_clkctrl = 0x4a0093e0, .cm_l3init_ocp2scp3_clkctrl = 0x4a0093e8, + .cm_l3init_usb_otg_ss_clkctrl = 0x4a0093f0, /* cm2.l4per */ .cm_l4per_clkstctrl = 0x4a009700, -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 07/11] arm: omap5: make hw_init_data weak
this way we can let boards overwrite based on what they need. Signed-off-by: Felipe Balbi --- arch/arm/cpu/armv7/omap5/hw_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c index 8b4d53a..95f1686 100644 --- a/arch/arm/cpu/armv7/omap5/hw_data.c +++ b/arch/arm/cpu/armv7/omap5/hw_data.c @@ -593,7 +593,7 @@ const struct ctrl_ioregs ioregs_dra72x_es1 = { .ctrl_ddr_ctrl_ext_0 = 0xA200, }; -void hw_data_init(void) +void __weak hw_data_init(void) { u32 omap_rev = omap_revision(); -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 04/11] usb: phy: omap_usb_phy: fix build breakage
there's no such function usb3_phy_power(), it's likely that author meant to call, usb_phy_power() instead, but that's already called properly from xhci-omap.c. Signed-off-by: Felipe Balbi --- drivers/usb/phy/omap_usb_phy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/phy/omap_usb_phy.c b/drivers/usb/phy/omap_usb_phy.c index f78d532..52a3664 100644 --- a/drivers/usb/phy/omap_usb_phy.c +++ b/drivers/usb/phy/omap_usb_phy.c @@ -118,7 +118,6 @@ void usb_phy_power(int on) void omap_usb3_phy_init(struct omap_usb3_phy *phy_regs) { omap_usb_dpll_lock(phy_regs); - usb3_phy_partial_powerup(phy_regs); /* * Give enough time for the PHY to partially power-up before @@ -126,7 +125,6 @@ void omap_usb3_phy_init(struct omap_usb3_phy *phy_regs) * team. */ mdelay(100); - usb3_phy_power(1); } static void omap_enable_usb3_phy(struct omap_xhci *omap) -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 02/11] arm: omap5: tps659038: rename regulator defines
Those regulators don't have any coupling with what they supply, so remove the suffixes in order to not confuse anybody. Signed-off-by: Felipe Balbi --- arch/arm/cpu/armv7/omap5/hw_data.c | 10 +- arch/arm/include/asm/arch-omap5/clock.h | 10 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c index 0257383..8b4d53a 100644 --- a/arch/arm/cpu/armv7/omap5/hw_data.c +++ b/arch/arm/cpu/armv7/omap5/hw_data.c @@ -365,31 +365,31 @@ struct vcores_data dra752_volts = { .mpu.value = VDD_MPU_DRA752, .mpu.efuse.reg = STD_FUSE_OPP_VMIN_MPU_NOM, .mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS, - .mpu.addr = TPS659038_REG_ADDR_SMPS12_MPU, + .mpu.addr = TPS659038_REG_ADDR_SMPS12, .mpu.pmic = &tps659038, .eve.value = VDD_EVE_DRA752, .eve.efuse.reg = STD_FUSE_OPP_VMIN_DSPEVE_NOM, .eve.efuse.reg_bits = DRA752_EFUSE_REGBITS, - .eve.addr = TPS659038_REG_ADDR_SMPS45_EVE, + .eve.addr = TPS659038_REG_ADDR_SMPS45, .eve.pmic = &tps659038, .gpu.value = VDD_GPU_DRA752, .gpu.efuse.reg = STD_FUSE_OPP_VMIN_GPU_NOM, .gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS, - .gpu.addr = TPS659038_REG_ADDR_SMPS6_GPU, + .gpu.addr = TPS659038_REG_ADDR_SMPS6, .gpu.pmic = &tps659038, .core.value = VDD_CORE_DRA752, .core.efuse.reg = STD_FUSE_OPP_VMIN_CORE_NOM, .core.efuse.reg_bits = DRA752_EFUSE_REGBITS, - .core.addr = TPS659038_REG_ADDR_SMPS7_CORE, + .core.addr = TPS659038_REG_ADDR_SMPS7, .core.pmic = &tps659038, .iva.value = VDD_IVA_DRA752, .iva.efuse.reg = STD_FUSE_OPP_VMIN_IVA_NOM, .iva.efuse.reg_bits = DRA752_EFUSE_REGBITS, - .iva.addr = TPS659038_REG_ADDR_SMPS8_IVA, + .iva.addr = TPS659038_REG_ADDR_SMPS8, .iva.pmic = &tps659038, }; diff --git a/arch/arm/include/asm/arch-omap5/clock.h b/arch/arm/include/asm/arch-omap5/clock.h index 30d9de2..7eacba2 100644 --- a/arch/arm/include/asm/arch-omap5/clock.h +++ b/arch/arm/include/asm/arch-omap5/clock.h @@ -278,11 +278,11 @@ /* TPS659038 */ #define TPS659038_I2C_SLAVE_ADDR 0x58 -#define TPS659038_REG_ADDR_SMPS12_MPU 0x23 -#define TPS659038_REG_ADDR_SMPS45_EVE 0x2B -#define TPS659038_REG_ADDR_SMPS6_GPU 0x2F -#define TPS659038_REG_ADDR_SMPS7_CORE 0x33 -#define TPS659038_REG_ADDR_SMPS8_IVA 0x37 +#define TPS659038_REG_ADDR_SMPS12 0x23 +#define TPS659038_REG_ADDR_SMPS45 0x2B +#define TPS659038_REG_ADDR_SMPS6 0x2F +#define TPS659038_REG_ADDR_SMPS7 0x33 +#define TPS659038_REG_ADDR_SMPS8 0x37 /* TPS */ #define TPS62361_I2C_SLAVE_ADDR0x60 -- 2.1.0.GIT ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: move "select CPU_V7" to ARCH_SUNXI
Hi Hans, 2014-11-06 22:56 GMT+09:00 Hans de Goede : > Hi, > > On 11/06/2014 03:36 AM, Masahiro Yamada wrote: >> CPU_V7 is select'ed by all the MACH_SUN*I. >> >> While we are here, let's delete the redundant "string" typedef >> of SYS_CONFIG_NAME. >> >> Signed-off-by: Masahiro Yamada > > I deliberately put the CPU_V7 where it is because I think it is > likely we will see V8 sunxi hardware in the future. > Understood. Just disregards this patch. -- Best Regards Masahiro Yamada ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] powerpc, muas3001: remove CONFIG_SYS_RAMBOOT
cppcheck reports: [board/muas3001/muas3001.c:270]: (error) Uninitialized variable: psize remove the CONFIG_SYS_RAMBOOT define to prevent this error report. Signed-off-by: Heiko Schocher Reported-by: Wolfgang Denk --- board/muas3001/muas3001.c | 4 include/configs/muas3001.h | 4 2 files changed, 8 deletions(-) diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c index 08eb5e8..812a7f1 100644 --- a/board/muas3001/muas3001.c +++ b/board/muas3001/muas3001.c @@ -243,14 +243,11 @@ phys_size_t initdram (int board_type) volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile memctl8260_t *memctl = &immap->im_memctl; long psize; -#ifndef CONFIG_SYS_RAMBOOT long sizelittle, sizebig; -#endif memctl->memc_psrt = CONFIG_SYS_PSRT; memctl->memc_mptpr = CONFIG_SYS_MPTPR; -#ifndef CONFIG_SYS_RAMBOOT /* 60x SDRAM setup: */ sizelittle = try_init (memctl, CONFIG_SYS_PSDMR_LITTLE, CONFIG_SYS_OR1_LITTLE, @@ -263,7 +260,6 @@ phys_size_t initdram (int board_type) psize = try_init (memctl, CONFIG_SYS_PSDMR_LITTLE, CONFIG_SYS_OR1_LITTLE, (uchar *) CONFIG_SYS_SDRAM_BASE); } -#endif /* CONFIG_SYS_RAMBOOT */ icache_enable (); diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h index 7343c94..df2ecc1 100644 --- a/include/configs/muas3001.h +++ b/include/configs/muas3001.h @@ -206,10 +206,6 @@ #define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE } #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE -#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) -#define CONFIG_SYS_RAMBOOT -#endif - #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 256KB for Monitor */ #define CONFIG_ENV_IS_IN_FLASH -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [drivers/mtd/ubi/eba.c:1275]: (error) Uninitialized variable: aeb
Hello Wolfgang, Am 06.11.2014 13:34, schrieb Wolfgang Denk: Hello, cppcheck reports: [drivers/mtd/ubi/eba.c:1275]: (error) Uninitialized variable: aeb can you please have a look? Thanks! I see in drivers/mtd/ubi/eba.c: 1267:ubi_rb_for_each_entry(rb, aeb, &av->root, u.rb) 1268:scan_eba[i][aeb->lnum] = aeb->pnum; 1269: 1270:av = ubi_find_av(ai_fastmap, idx2vol_id(ubi, i)); 1271:if (!av) 1272: continue; 1273: 1274:ubi_rb_for_each_entry(rb, aeb, &av->root, u.rb) 1275:fm_eba[i][aeb->lnum] = aeb->pnum; Why does cppcheck only report line 1275 not also line 1268 and also 1351? I could not currently see, why this pops up for line 1274 ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/9] board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow
On 11/06/2014 02:03 PM, Wolfgang Denk wrote: Fix error detected by cppcheck: [board/matrix_vision/mvblx/sys_eeprom.c:353]: (error) Buffer is accessed out of bounds. Signed-off-by: Wolfgang Denk cc: Michael Jones --- board/matrix_vision/mvblx/sys_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/matrix_vision/mvblx/sys_eeprom.c b/board/matrix_vision/mvblx/sys_eeprom.c index 1a2ac8d..db42987 100644 --- a/board/matrix_vision/mvblx/sys_eeprom.c +++ b/board/matrix_vision/mvblx/sys_eeprom.c @@ -348,7 +348,7 @@ int mac_read_from_eeprom(void) if (memcmp(&e.mac, "\0\0\0\0\0\0", 6) && memcmp(&e.mac, "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) { - char ethaddr[9]; + char ethaddr[18]; sprintf(ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X", e.mac[0], Thanks for the fix. Acked-by: Michael Jones - VISION 2014 in Stuttgart | 04.11.2014 - 06.11.2014 Meet us at the VISION show Hall 1 - Stand E12 - MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Uwe Furtner, Erhard Meier ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] sunxi: move "select CPU_V7" to ARCH_SUNXI
Hi, On 11/06/2014 03:36 AM, Masahiro Yamada wrote: > CPU_V7 is select'ed by all the MACH_SUN*I. > > While we are here, let's delete the redundant "string" typedef > of SYS_CONFIG_NAME. > > Signed-off-by: Masahiro Yamada I deliberately put the CPU_V7 where it is because I think it is likely we will see V8 sunxi hardware in the future. Regards, Hans ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] km/km82xx: remove CONFIG_SYS_RAMBOOT
This define is never set in our setup, so we can remove it safely. The former code causes cppcheck to complain about: [board/keymile/km82xx/km82xx.c:311]: (error) Uninitialized variable: psize Signed-off-by: Holger Brunck cc: Valentin Longchamp cc: Wolfgang Denk --- board/keymile/km82xx/km82xx.c | 2 -- include/configs/km82xx.h | 3 --- 2 files changed, 5 deletions(-) diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c index dfbfab8..cb13a0b 100644 --- a/board/keymile/km82xx/km82xx.c +++ b/board/keymile/km82xx/km82xx.c @@ -300,11 +300,9 @@ phys_size_t initdram(int board_type) out_8(&memctl->memc_psrt, CONFIG_SYS_PSRT); out_be16(&memctl->memc_mptpr, CONFIG_SYS_MPTPR); -#ifndef CONFIG_SYS_RAMBOOT /* 60x SDRAM setup: */ psize = probe_sdram(memctl); -#endif /* CONFIG_SYS_RAMBOOT */ icache_enable(); diff --git a/include/configs/km82xx.h b/include/configs/km82xx.h index 029c348..220975d 100644 --- a/include/configs/km82xx.h +++ b/include/configs/km82xx.h @@ -204,9 +204,6 @@ "" #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE -#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) -#define CONFIG_SYS_RAMBOOT -#endif #define CONFIG_SYS_MONITOR_LEN (768 << 10) -- 2.1.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 9/9] board/esd/common/auto_update.c: fix Uninitialized variable
On 11/06/2014 02:03 PM, Wolfgang Denk wrote: > cppcheck reports: > > [board/esd/common/auto_update.c:458]: (error) Uninitialized variable: cnt > > The variable is not really used anywhere, so remove it. > > Signed-off-by: Wolfgang Denk > Cc: Matthias Fuchs > --- > board/esd/common/auto_update.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c > index 85c3567..b168074 100644 > --- a/board/esd/common/auto_update.c > +++ b/board/esd/common/auto_update.c > @@ -377,7 +377,7 @@ int do_auto_update(void) > { > block_dev_desc_t *stor_dev = NULL; > long sz; > - int i, res, cnt, old_ctrlc; > + int i, res, old_ctrlc; > char buffer[32]; > char str[80]; > int n; > @@ -455,7 +455,6 @@ int do_auto_update(void) > clear_ctrlc (); > break; > } > - cnt++; > } while (res < 0); > } > > Thanks for fixing! Acked-by: Matthias Fuchs ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [drivers/usb/musb-new/musb_core.c:2166]: (error) Uninitialized variable: musb
On Thursday, November 06, 2014 at 01:36:22 PM, Wolfgang Denk wrote: > Hello, Hi, > cppcheck reports: > > [drivers/usb/musb-new/musb_core.c:2166]: (error) Uninitialized > variable: musb > [drivers/usb/musb-new/musb_host.c:1918]: (error) Uninitialized > variable: idle > > > can you please have a look? Thanks! CC Tom. On a related note, we have two MUSB drivers in U-Boot. Which one is used and which one is not ? Can we get rid of one of those ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [scripts/docproc.c:398]: (error) Common realloc mistake
On Thursday, November 06, 2014 at 01:42:41 PM, Wolfgang Denk wrote: > Hello, Hello, > cppcheck reports: > > [scripts/docproc.c:398]: (error) Common realloc mistake: 'data' nulled > but not freed upon failure > [scripts/docproc.c:422]: (error) Common realloc mistake: 'all_list' > nulled but not freed upon failure > > can you please have a look? Thanks! This looks unresolved in mainline Linux as well. I'm currently really pressed, so I cannot take an immediate action. I believe it would be worth reporting it to mainline Linux guys as well though. 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 3/9] drivers/usb/host/isp116x-hcd.c: fix syntax error
On Thursday, November 06, 2014 at 02:02:59 PM, Wolfgang Denk wrote: > Fix error detected by cppcheck: > > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: ''. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: 'ISP116X_HCD_OC_ENABLE'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: > 'ISP116X_HCD_REMOTE_WAKEUP_ENABLE'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: 'ISP116X_HCD_SEL15kRES'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: > 'ISP116X_HCD_USE_EXTRA_DELAY'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: 'ISP116X_HCD_USE_UDELAY'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: 'TRACE'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: 'TRACE;VERBOSE'. > [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of > character (() when these macros are defined: 'VERBOSE'. > > Signed-off-by: Wolfgang Denk > Cc: Stephen Warren > Cc: Marek Vasut A brief grep: marex@bfu:u-boot$ git grep USB_ISP116X_HCD drivers/usb/host/Makefile:obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o include/usb.h: defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \ marex@bfu:u-boot$ gives me a better idea on how to resolve this bug ... scrap this code altogether. Looks like the code was unused forever. Can you prepare a patch for that please ? 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 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux
On Wed 2014-11-05 07:02:23, Marek Vasut wrote: > On Wednesday, November 05, 2014 at 06:06:09 AM, Masahiro Yamada wrote: > > Hi Pavel, > > > > Thanks for your close checking. > > > > > > On Tue, 4 Nov 2014 20:50:13 +0100 > > > > Pavel Machek wrote: > > > On Tue 2014-11-04 20:26:26, Masahiro Yamada wrote: > > > > U-Boot has never cared about the type when we get max/min of two > > > > values, but Linux Kernel does. This commit gets min, max, min3, max3 > > > > macros synced with the kernel introduing type checks. > > > > > > "introducing" > > > > I will fix this. > > Are you linting the patches with aspell or something ? My eyes do this automatically. I tried to find a switch to turn it off, but could not, so far. :-), Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [drivers/usb/gadget/f_dfu.c:687]: (error) Uninitialized variable: d
Dear Lukasz, In message <20141106135936.26788299@amdc2363> you wrote: > > > [drivers/usb/gadget/f_dfu.c:687]: (error) Uninitialized variable: d ... > I will look on it, but first at a first glance it all looks correct. We > definitely need usb_interface descriptor... You are right. This appears to be a false positive. Strange... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It is dangerous to be right on a subject on which the established authorities are wrong.-- Voltaire ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/9] drivers/net/uli526x.c: fix syntax error
Fix error detected by cppcheck: [drivers/net/uli526x.c:551]: (error) printf format string requires 3 parameters but only 2 are given. Signed-off-by: Wolfgang Denk Cc: Roy Zang --- drivers/net/uli526x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/uli526x.c b/drivers/net/uli526x.c index 538f11e..9526faa 100644 --- a/drivers/net/uli526x.c +++ b/drivers/net/uli526x.c @@ -548,7 +548,7 @@ static int uli526x_rx_packet(struct eth_device *dev) rdes0 = le32_to_cpu(rxptr->rdes0); #ifdef RX_DEBUG - printf("%s(): rxptr->rdes0=%x:%x\n", __FUNCTION__, rxptr->rdes0); + printf("%s(): rxptr->rdes0=%x\n", __FUNCTION__, rxptr->rdes0); #endif if (!(rdes0 & 0x8000)) {/* packet owner check */ if ((rdes0 & 0x300) != 0x300) { -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 8/9] ARM: MXS: fix Uninitialized variable error
cppcheck reports: [arch/arm/cpu/arm926ejs/mxs/timer.c:96]: (error) Uninitialized variable: now Signed-off-by: Wolfgang Denk Cc: Marek Vasut Cc: Stefano Babic --- arch/arm/cpu/arm926ejs/mxs/timer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/cpu/arm926ejs/mxs/timer.c b/arch/arm/cpu/arm926ejs/mxs/timer.c index 99d3fb8..f2e7225 100644 --- a/arch/arm/cpu/arm926ejs/mxs/timer.c +++ b/arch/arm/cpu/arm926ejs/mxs/timer.c @@ -91,6 +91,8 @@ unsigned long long get_ticks(void) TIMROT_RUNNING_COUNTn_RUNNING_COUNT_OFFSET; #elif defined(CONFIG_MX28) now = readl(&timrot_regs->hw_timrot_running_count0); +#else +#error "Don't know how to read timrot_regs" #endif if (lastdec >= now) { -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 9/9] board/esd/common/auto_update.c: fix Uninitialized variable
cppcheck reports: [board/esd/common/auto_update.c:458]: (error) Uninitialized variable: cnt The variable is not really used anywhere, so remove it. Signed-off-by: Wolfgang Denk Cc: Matthias Fuchs --- board/esd/common/auto_update.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c index 85c3567..b168074 100644 --- a/board/esd/common/auto_update.c +++ b/board/esd/common/auto_update.c @@ -377,7 +377,7 @@ int do_auto_update(void) { block_dev_desc_t *stor_dev = NULL; long sz; - int i, res, cnt, old_ctrlc; + int i, res, old_ctrlc; char buffer[32]; char str[80]; int n; @@ -455,7 +455,6 @@ int do_auto_update(void) clear_ctrlc (); break; } - cnt++; } while (res < 0); } -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 5/9] common/cmd_fitupd.c: restore corrupted file
This file got corrupted by the automatic editin of commit 1a45966 "Add GPL-2.0+ SPDX-License-Identifier to source files"; restore the opiginal content and manually insert the SPDX ID. The bug was detected by running cppcheck, which reported: [common/cmd_fitupd.c:8]: (error) Invalid number of character ({) when these macros are defined: 'CONFIG_UPDATE_TFTP'. Signed-off-by: Wolfgang Denk --- common/cmd_fitupd.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/common/cmd_fitupd.c b/common/cmd_fitupd.c index e811473..b045974 100644 --- a/common/cmd_fitupd.c +++ b/common/cmd_fitupd.c @@ -1,12 +1,8 @@ -de - -#if !defined(CONFIG_UPDATE_TFTP) -#error "CONFIG_UPDATE_TFTP required" -#endif - -static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - ulong addr = 0Un the root directory of the source tree for details. +/* + * (C) Copyright 2011 + * Andreas Pretzsch, carpe noctem engineering, a...@cn-eng.de + * + * SPDX-License-Identifier:GPL-2.0+ */ #include -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 7/9] board/renesas/ecovec/ecovec.c: fix buffer overflow
Fix error detected by cppcheck: [board/renesas/ecovec/ecovec.c:66]: (error) Buffer is accessed out of bounds. Signed-off-by: Wolfgang Denk Cc: Nobuhiro Iwamatsu --- board/renesas/ecovec/ecovec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/renesas/ecovec/ecovec.c b/board/renesas/ecovec/ecovec.c index 2804d91..d862d99 100644 --- a/board/renesas/ecovec/ecovec.c +++ b/board/renesas/ecovec/ecovec.c @@ -41,7 +41,7 @@ static void debug_led(u8 led) int board_late_init(void) { u8 mac[6]; - char env_mac[17]; + char env_mac[18]; udelay(1000); -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 6/9] board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow
Fix error detected by cppcheck: [board/matrix_vision/mvblx/sys_eeprom.c:353]: (error) Buffer is accessed out of bounds. Signed-off-by: Wolfgang Denk cc: Michael Jones --- board/matrix_vision/mvblx/sys_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/matrix_vision/mvblx/sys_eeprom.c b/board/matrix_vision/mvblx/sys_eeprom.c index 1a2ac8d..db42987 100644 --- a/board/matrix_vision/mvblx/sys_eeprom.c +++ b/board/matrix_vision/mvblx/sys_eeprom.c @@ -348,7 +348,7 @@ int mac_read_from_eeprom(void) if (memcmp(&e.mac, "\0\0\0\0\0\0", 6) && memcmp(&e.mac, "\xFF\xFF\xFF\xFF\xFF\xFF", 6)) { - char ethaddr[9]; + char ethaddr[18]; sprintf(ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X", e.mac[0], -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/9] drivers/usb/host/isp116x-hcd.c: fix syntax error
Fix error detected by cppcheck: [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: ''. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'ISP116X_HCD_OC_ENABLE'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'ISP116X_HCD_REMOTE_WAKEUP_ENABLE'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'ISP116X_HCD_SEL15kRES'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'ISP116X_HCD_USE_EXTRA_DELAY'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'ISP116X_HCD_USE_UDELAY'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'TRACE'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'TRACE;VERBOSE'. [drivers/usb/host/isp116x-hcd.c:1282]: (error) Invalid number of character (() when these macros are defined: 'VERBOSE'. Signed-off-by: Wolfgang Denk Cc: Stephen Warren Cc: Marek Vasut --- drivers/usb/host/isp116x-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 46e4cee..35d4e9f 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -1279,7 +1279,7 @@ int isp116x_check_id(struct isp116x *isp116x) return 0; } -int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)) +int usb_lowlevel_init(int index, enum usb_init_type init, void **controller) { struct isp116x *isp116x = &isp116x_dev; -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/9] board/cogent/lcd.c: fix syntax error
Fix error detected by cppcheck: [board/cogent/lcd.c:237]: (error) Invalid number of character (() when these macros are defined: 'CONFIG_SHOW_ACTIVITY;CONFIG_STATUS_LED'. Signed-off-by: Wolfgang Denk --- board/cogent/lcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/cogent/lcd.c b/board/cogent/lcd.c index 8e90f98..05ffc4d 100644 --- a/board/cogent/lcd.c +++ b/board/cogent/lcd.c @@ -234,7 +234,7 @@ lcd_heartbeat(void) void board_show_activity (ulong timestamp) { #ifdef CONFIG_STATUS_LED - if ((timestamp % (CONFIG_SYS_HZ / 2) == 0) + if ((timestamp % (CONFIG_SYS_HZ / 2)) == 0) lcd_heartbeat (); #endif } -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/9] cppcheck cleanup
The following patches clean up a number of errors and warnings detected by running the "cppcheck" [1] tool over the U-Boot source tree. This discovers a number of issues that escape GCC, for example because they are inside #ifdef branches which are never compiled for any of the tested configurations. This is just an initial patch series; some other error reports have been sent to the respective code maintainers, so more patches should follow soon. The command used for these tests was: $ cd u-boot $ cppcheck --force --quiet --inline-suppr . [1] http://cppcheck.sourceforge.net/ Wolfgang Denk (9): cppcheck cleanup: fix nullPointer errors board/cogent/lcd.c: fix syntax error drivers/usb/host/isp116x-hcd.c: fix syntax error drivers/net/uli526x.c: fix syntax error common/cmd_fitupd.c: restore corrupted file board/matrix_vision/mvblx/sys_eeprom.c: fix buffer overflow board/renesas/ecovec/ecovec.c: fix buffer overflow ARM: MXS: fix Uninitialized variable error board/esd/common/auto_update.c: fix Uninitialized variable arch/arm/cpu/arm926ejs/mxs/mxs.c | 2 ++ arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 2 ++ arch/arm/cpu/arm926ejs/mxs/timer.c| 2 ++ arch/arm/cpu/armv7/zynq/ddrc.c| 1 + arch/blackfin/cpu/initcode.c | 1 + arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 5 - arch/sh/lib/zimageboot.c | 1 + board/cogent/lcd.c| 2 +- board/esd/common/auto_update.c| 3 +-- board/esd/pci405/cmd_pci405.c | 4 +++- board/keymile/common/common.c | 1 + board/matrix_vision/mvblx/sys_eeprom.c| 2 +- board/renesas/ecovec/ecovec.c | 2 +- board/scb9328/flash.c | 2 ++ common/cmd_fitupd.c | 14 +- drivers/net/uli526x.c | 2 +- drivers/usb/host/isp116x-hcd.c| 2 +- 17 files changed, 30 insertions(+), 18 deletions(-) -- 1.8.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/9] cppcheck cleanup: fix nullPointer errors
There are a number of places where U-Boot intentionally and legally accesses physical address 0x, for example when installing exception vectors on systems where these are located in low memory. Add "cppcheck-suppress nullPointer" comments to silence cppcheck where this is intentional and legal. Signed-off-by: Wolfgang Denk --- arch/arm/cpu/arm926ejs/mxs/mxs.c | 2 ++ arch/arm/cpu/arm926ejs/mxs/spl_boot.c | 2 ++ arch/arm/cpu/armv7/zynq/ddrc.c| 1 + arch/blackfin/cpu/initcode.c | 1 + arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 5 - arch/sh/lib/zimageboot.c | 1 + board/esd/pci405/cmd_pci405.c | 4 +++- board/keymile/common/common.c | 1 + board/scb9328/flash.c | 2 ++ 9 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/mxs/mxs.c b/arch/arm/cpu/arm926ejs/mxs/mxs.c index 365542f..ef130ae 100644 --- a/arch/arm/cpu/arm926ejs/mxs/mxs.c +++ b/arch/arm/cpu/arm926ejs/mxs/mxs.c @@ -83,7 +83,9 @@ void mx28_fixup_vt(uint32_t start_addr) int i; for (i = 0; i < 8; i++) { + /* cppcheck-suppress nullPointer */ vt[i] = ldr_pc; + /* cppcheck-suppress nullPointer */ vt[i + 8] = start_addr + (4 * i); } } diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c index d3e1369..d29b9aa 100644 --- a/arch/arm/cpu/arm926ejs/mxs/spl_boot.c +++ b/arch/arm/cpu/arm926ejs/mxs/spl_boot.c @@ -118,6 +118,8 @@ static void mxs_spl_fixup_vectors(void) * fine. */ extern uint32_t _start; + + /* cppcheck-suppress nullPointer */ memcpy(0x0, &_start, 0x60); } diff --git a/arch/arm/cpu/armv7/zynq/ddrc.c b/arch/arm/cpu/armv7/zynq/ddrc.c index 1ea086d..d74f8db 100644 --- a/arch/arm/cpu/armv7/zynq/ddrc.c +++ b/arch/arm/cpu/armv7/zynq/ddrc.c @@ -40,6 +40,7 @@ void zynq_ddrc_init(void) * first stage bootloader. To get ECC to work all memory has * been initialized by writing any value. */ + /* cppcheck-suppress nullPointer */ memset((void *)0, 0, 1 * 1024 * 1024); } else { puts("ECC disabled "); diff --git a/arch/blackfin/cpu/initcode.c b/arch/blackfin/cpu/initcode.c index 2e640af..fde54ea 100644 --- a/arch/blackfin/cpu/initcode.c +++ b/arch/blackfin/cpu/initcode.c @@ -955,6 +955,7 @@ check_hibernation(ADI_BOOT_DATA *bs, u16 vr_ctl, bool put_into_srfs) uint32_t *hibernate_magic = 0; SSYNC(); + /* cppcheck-suppress nullPointer */ if (hibernate_magic[0] == 0xDEADBEEF) { serial_putc('c'); bfin_write_EVT15(hibernate_magic[1]); diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c index 47b712d..072387a 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c @@ -161,9 +161,12 @@ void cpu_init_early_f(void *fdt) setup_ifc_sram = (void *)SRAM_BASE_ADDR; dst = (u32 *) SRAM_BASE_ADDR; src = (u32 *) setup_ifc; - for (i = 0; i < 1024; i++) + for (i = 0; i < 1024; i++) { + /* cppcheck-suppress nullPointer */ *dst++ = *src++; + } + /* cppcheck-suppress nullPointer */ setup_ifc_sram(); /* CLEANUP */ diff --git a/arch/sh/lib/zimageboot.c b/arch/sh/lib/zimageboot.c index 86d3998..3fea5f5 100644 --- a/arch/sh/lib/zimageboot.c +++ b/arch/sh/lib/zimageboot.c @@ -45,6 +45,7 @@ int do_sh_zimageboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) bootargs = getenv("bootargs"); /* Clear zero page */ + /* cppcheck-suppress nullPointer */ memset(param, 0, 0x1000); /* Set commandline */ diff --git a/board/esd/pci405/cmd_pci405.c b/board/esd/pci405/cmd_pci405.c index 55c20d0..29c688a 100644 --- a/board/esd/pci405/cmd_pci405.c +++ b/board/esd/pci405/cmd_pci405.c @@ -23,7 +23,7 @@ */ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - unsigned int *ptr = 0; + unsigned int *ptr; int count = 0; int count2 = 0; int i; @@ -35,12 +35,14 @@ int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) * Mark sync address */ ptr = 0; + /* cppcheck-suppress nullPointer */ *ptr = 0x; puts("\nWaiting for image from pci host -"); /* * Wait for host to write the start address */ + /* cppcheck-suppress nullPointer */ while (*ptr == 0x) { count++; if (!(count % 100)) { diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 2ddb3da..b9aff1a 100644 --- a/board/keymile/common/common.c +++ b/board/key
Re: [U-Boot] [drivers/usb/gadget/f_dfu.c:687]: (error) Uninitialized variable: d
Hi Wolfgang, > Hello, > > cppcheck reports: > > [drivers/usb/gadget/f_dfu.c:687]: (error) Uninitialized variable: d > > can you please have a look? Thanks! I will look on it, but first at a first glance it all looks correct. We definitely need usb_interface descriptor... > > > Best regards, > > Wolfgang Denk > -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] usb_storage: skip all unknown devices when probing
Not only skip storage devices with DEV_TYPE_UNKNOWN, but also all devices which are unknown to u-boot (e.g., are not HARDDISK, TAPE, CDROM, OPDISK). This especially avoids long timeouts when probing for external usb harddisks which provide "Enclosure Services". Signed-off-by: Soeren Moch -- Cc: Marek Vasut Cc: Tom Rini --- common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index eb7706c..0ac7b48 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -1351,7 +1351,7 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss, perq = usb_stor_buf[0]; modi = usb_stor_buf[1]; - if ((perq & 0x1f) == 0x1f) { + if ((perq & 0x1f) > DEV_TYPE_OPDISK) { /* skip unknown devices */ return 0; } -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] CONFIG_LCD_BMP_RLE8 and MCC200 dead code?
Dear Nikita, In message <545b6844.2060...@compulab.co.il> you wrote: > > I've been trying to do some cleanup in common/lcd.c, and noticed some > unused code: Thanks! > The other case is MCC200 specific #ifdefs. It handles 1bpp BMPs, which > I don't think is likely to be used by current and future boards, and > the board itself is old, and has no maintainer. Perhaps this board > can be removed? I agree. We should remove the MCC200 and PRS200 boards. Can you submit such a patch, please? TIA... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It is your destiny. - Darth Vader ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] arch/arm/lib/board.c - uninitialized vars
Dear Heiko, In message <545b6539.9090...@denx.de> you wrote: > > -> so I think, we can drop the CONFIG_SPL_BUILD in > u-boot:/arch/arm/lib/board.c board_init_f(), as it is not used, thats > maybe the reason, why this issue never poped up! I agree - this appears to be dead code. Albert, what do you think? And, most important: Who is going to provide a patch? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de He'd been wrong, there _was_ a light at the end of the tunnel, and it was a flamethrower. - Terry Pratchett, _Mort_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [scripts/kconfig/nconf.gui.c:375]: (error) Common realloc mistake
Hello, cppcheck reports: [scripts/kconfig/confdata.c:983]: (error) Resource leak: tristate [scripts/kconfig/nconf.gui.c:375]: (error) Common realloc mistake: 'result' nulled but not freed upon failure [scripts/kconfig/nconf.gui.c:481]: (error) Common realloc mistake: 'result' nulled but not freed upon failure [scripts/kconfig/symbol.c:904]: (error) Common realloc mistake: 'res' nulled but not freed upon failure [scripts/kconfig/zconf.lex.c:817]: (error) Common realloc mistake: 'text' nulled but not freed upon failure can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de How many seconds are there in a year? If I tell you there are 3.155 x 10^7, you won't even try to remember it. On the other hand, who could forget that, to within half a percent, pi seconds is a nanocentury. -- Tom Duff, Bell Labs ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] SPL (Secondary Program Loader) on iMX6SL
Hi John, On Thu, Nov 6, 2014 at 12:54 AM, John Tobias wrote: > Hi Fabio, > > The SPL support that I have done for sabresd is not %100 done. I just > did that for the testing and to see if I could load the SPL image. > > Btw, I saw in freescale repository that they have the plugin feature. > I enabled it but it didn't work. When I load the image, it jump to > 0x00907000. > > Do you know how does it work?. You should not focus on the plugin feature. It was posted a few days ago and the general agreement is that spl should be used instead. For spl example on mx6, you can look at gw_ventana, cm_fx6 and novena boards as references. Regards, Fabio Estevam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [scripts/docproc.c:398]: (error) Common realloc mistake
Hello, cppcheck reports: [scripts/docproc.c:398]: (error) Common realloc mistake: 'data' nulled but not freed upon failure [scripts/docproc.c:422]: (error) Common realloc mistake: 'all_list' nulled but not freed upon failure can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de F u cn rd ths u cnt spl wrth a dm! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] doc: fix documentation of out-of-tree build
Correct environment variable for output directory is KBUILD_OUTPUT. Signed-off-by: Timo Ketola --- v2 changes: - Fixed the example in the doc/README.kwbimage file functionally correct README |6 +++--- doc/README.kwbimage |4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README b/README index 7b5538e..c3a9dfc 100644 --- a/README +++ b/README @@ -5012,14 +5012,14 @@ this behavior and build U-Boot to some external directory: make O=/tmp/build NAME_defconfig make O=/tmp/build all -2. Set environment variable BUILD_DIR to point to the desired location: +2. Set environment variable KBUILD_OUTPUT to point to the desired location: - export BUILD_DIR=/tmp/build + export KBUILD_OUTPUT=/tmp/build make distclean make NAME_defconfig make all -Note that the command line "O=" setting overrides the BUILD_DIR environment +Note that the command line "O=" setting overrides the KBUILD_OUTPUT environment variable. diff --git a/doc/README.kwbimage b/doc/README.kwbimage index 13f6f92..762b2e3 100644 --- a/doc/README.kwbimage +++ b/doc/README.kwbimage @@ -30,10 +30,10 @@ kwbimage support available with mkimage utility will generate kirkwood boot image that can be flashed on the board NAND/SPI flash. The make target which uses mkimage to produce such an image is "u-boot.kwb". For example: - export BUILD_DIR=/tmp/build + export KBUILD_OUTPUT=/tmp/build make distclean make yourboard_config - make $BUILD_DIR/u-boot.kwb + make u-boot.kwb Board specific configuration file specifications: -- 1.7.9.5 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [net/eth.c:64]: (error) Uninitialized variable: skip_state
Hello, cppcheck reports: [net/eth.c:64]: (error) Uninitialized variable: skip_state can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de What we anticipate seldom occurs; what we least expect generally happens. - Bengamin Disraeli ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [board/gdsys/405ep/iocon.c:372]: (error) Uninitialized variable: fpga_features
Hello Wolfgang, 2014-11-06 13:31 GMT+01:00 Wolfgang Denk : > Hello, > > cppcheck reports: > > [board/gdsys/405ep/iocon.c:372]: (error) Uninitialized variable: > fpga_features > > can you please have a look? Thanks! oops, nice one, thanks. Will fix. Cheers Dirk ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [drivers/usb/musb-new/musb_core.c:2166]: (error) Uninitialized variable: musb
Hello, cppcheck reports: [drivers/usb/musb-new/musb_core.c:2166]: (error) Uninitialized variable: musb [drivers/usb/musb-new/musb_host.c:1918]: (error) Uninitialized variable: idle can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Be wiser than other people if you can, but do not tell them so. -- Philip Earl of Chesterfield ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [fs/zfs/zfs.c:743]: (error) Uninitialized variable: ct
Hello, cppcheck reports: [fs/zfs/zfs.c:743]: (error) Uninitialized variable: ct [fs/zfs/zfs.c:937]: (error) Memory leak: l [fs/zfs/zfs.c:1048]: (error) Memory leak: zapbuf [fs/zfs/zfs.c:1083]: (error) Memory leak: zapbuf [fs/zfs/zfs.c:1141]: (error) Memory leak: dnbuf [fs/zfs/zfs.c:1372]: (error) Memory leak: osp [fs/zfs/zfs.c:1726]: (error) Memory leak: nvlist [fs/zfs/zfs.c:1869]: (error) Memory leak: ub_array [fs/zfs/zfs.c:1957]: (error) Memory leak: osp [fs/zfs/zfs.c:2047]: (error) Memory leak: sahdrp can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Those who do not understand Unix are condemned to reinvent it, poorly. - Henry Spencer, University of Toronto Unix hack ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [drivers/usb/gadget/f_dfu.c:687]: (error) Uninitialized variable: d
Hello, cppcheck reports: [drivers/usb/gadget/f_dfu.c:687]: (error) Uninitialized variable: d can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de You could end up being oddly sad and full of a strange, diffuse com- passion which would lead you to believe that it might be a good idea to wipe out the whole human race and start again with amoebas. - Terry Pratchett, _Guards! Guards!_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [drivers/net/e1000.c:2251]: (error) Uninitialized variable: phy_data
Hello, cppcheck reports: [drivers/net/e1000.c:2251]: (error) Uninitialized variable: phy_data [drivers/net/e1000.c:2261]: (error) Uninitialized variable: phy_data [drivers/net/e1000.c:2303]: (error) Uninitialized variable: phy_data [drivers/net/e1000.c:2313]: (error) Uninitialized variable: phy_data [drivers/net/e1000.c:2380]: (error) Uninitialized variable: phy_data [drivers/net/e1000.c:2428]: (error) Uninitialized variable: phy_data can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de "Never face facts; if you do, you'll never get up in the morning." - Marlo Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [drivers/mtd/ubi/eba.c:1275]: (error) Uninitialized variable: aeb
Hello, cppcheck reports: [drivers/mtd/ubi/eba.c:1275]: (error) Uninitialized variable: aeb can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If you're not part of the solution, then you're part of the precipi- tate. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [drivers/misc/cros_ec.c:704]: (error) Uninitialized variable: req
Hello, cppcheck reports: [drivers/misc/cros_ec.c:704]: (error) Uninitialized variable: req can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Dear Lord: I just want *one* one-armed manager so I never have to hear "On the other hand", again. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [common/cmd_ini.c:137]: (error) Uninitialized variable: line
Hello, cppcheck reports: [common/cmd_ini.c:137]: (error) Uninitialized variable: line can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de 365 Days of drinking Lo-Cal beer. = 1 Lite-year ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [board/muas3001/muas3001.c:270]: (error) Uninitialized variable: psize
Hello, cppcheck reports: [board/muas3001/muas3001.c:270]: (error) Uninitialized variable: psize can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Faith may be defined briefly as an illogical belief in the occurence of the improbable.- H. L. Mencken ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [board/keymile/km82xx/km82xx.c:311]: (error) Uninitialized variable: psize
Hello, cppcheck reports: [board/keymile/km82xx/km82xx.c:311]: (error) Uninitialized variable: psize can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de An expert is a person who avoids the small errors while sweeping on to the grand fallacy. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [board/gdsys/405ep/iocon.c:372]: (error) Uninitialized variable: fpga_features
Hello, cppcheck reports: [board/gdsys/405ep/iocon.c:372]: (error) Uninitialized variable: fpga_features can you please have a look? Thanks! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de If you believe that feeling bad or worrying long enough will change a past or future event, then you are residing on another planet with a different reality system. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] CONFIG_LCD_BMP_RLE8 and MCC200 dead code?
Hi all, I've been trying to do some cleanup in common/lcd.c, and noticed some unused code: One is the CONFIG_LCD_BMP_REL8 stuff. This code was added 2 years ago in patch 45d7f52511f43b71b623a502fdf31feb905f70a1, and so far it has no users (sandbox.h defines it, but only to fix a compilation error, see commit 0156444cf7e77e92fed7a61d6c6123b349f1d600). The other case is MCC200 specific #ifdefs. It handles 1bpp BMPs, which I don't think is likely to be used by current and future boards, and the board itself is old, and has no maintainer. Perhaps this board can be removed? -- Regards, Nikita Kiryanov ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] arch/arm/lib/board.c - uninitialized vars
Hello Wolfgang, Am 06.11.2014 12:28, schrieb Wolfgang Denk: Hi, I'm trying to clean up some warnings/errors detected when running "cppcheck" on the U-Boot source tree. For arch/arm/lib/board.c I get this: [arch/arm/lib/board.c:445]: (error) Uninitialized variable: id [arch/arm/lib/board.c:422]: (error) Uninitialized variable: addr_sp The problem is not usually detected by GCC depending on which macros are active, here especially CONFIG_SPL_BUILD The relevant code was last touched / introduced by commit f1d2b313: "ARM: add relocation support" some two years ago... I have some questions regarding the CONFIG_SPL_BUILD "else" case (i. e. when building with CONFIG_SPL_BUILD defined): 422 addr_sp += 128; /* leave 32 words for abort-stack */ Is this correct? The stack is growing downward, so should the '+' not be replaced by a '-', like we do a few lines above: No, this is a typo ... it must be a "-" 412 /* leave 3 words for abort-stack*/ 413 addr_sp -= 12; Why do we need 128 words in the CONFIG_SPL_BUILD case, but only 3 otherwise? Good question ... Should we not move the "alignment for ABI compliance" part outside the CONFIG_SPL_BUILD if/else case, i. e. should this not always be done? Yes, I think thats correct. But looking into common/board_f.c ... there it is also done only for the not SPL case ... going back in history ... http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/arm926ejs/start.S;h=cf40ce12928359c5238d02a32ed361ccc153c101;hb=a59e27997637a2395ae2cc7f809127f24119a167 here I see: leave 32 words for abort-stack leave 3 words for abort-stack 8-byte alignment for ABI compliance without SPL (former PRELOADER) define mess ... http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/arm1136/start.S;h=41eb82dae246b9509545f051daac605a02b7db05;hb=a59e27997637a2395ae2cc7f809127f24119a167#l179 here: #ifdef CONFIG_PRELOADER leave 32 words for abort-stack #else leave 3 words for abort-stack #endif 8-byte alignment for ABI compliance http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/pxa/start.S;h=e07c8c2e0e70744c45152c1649cef65f87825708;hb=a59e27997637a2395ae2cc7f809127f24119a167 here leave 3 words for abort-stack 8-byte alignment for ABI compliance no "leave 32 words for abort-stack" ... :-( And of course, how should we correctly initialize the "id" and "addr_sp" variable in both cases? Hmm.. they are initialized for the !SPL case ... and in the SPL case, board__init_f is used from ./arch/arm/lib/spl.c or overwritten from SoC dependend code, like done in: ./arch/arm/cpu/arm926ejs/davinci/spl.c -> so I think, we can drop the CONFIG_SPL_BUILD in u-boot:/arch/arm/lib/board.c board_init_f(), as it is not used, thats maybe the reason, why this issue never poped up! bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] sandbox: Uninitialized variable
Dear Simon, cppcheck reports: [arch/sandbox/cpu/start.c:132]: (error) Uninitialized variable: err And also: [arch/sandbox/cpu/os.c:371]: (error) Memory leak: fname Could you please have a look? Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Eeeek! 'eval' on strings should have been named 'evil'.-- Tom Phoenix in ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] MPC85xx: Uninitialized variables and other problems
Hello, cppcheck reports: [arch/powerpc/cpu/mpc85xx/cmd_errata.c:62]: (error) Uninitialized variable: x108 [board/freescale/common/cds_pci_ft.c:36]: (error) Possible null pointer dereference: map [board/freescale/common/cds_pci_ft.c:52]: (error) Uninitialized variable: len [board/freescale/t4qds/eth.c:289]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf(). [board/freescale/t4qds/eth.c:298]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf(). [board/freescale/t4qds/eth.c:307]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf(). [board/freescale/t4qds/eth.c:316]: (error) Undefined behavior: Variable 'buf' is used as parameter and destination in s[n]printf(). [drivers/ddr/fsl/ctrl_regs.c:1659]: (error) Uninitialized variable: wr [drivers/ddr/fsl/ctrl_regs.c:2257]: (error) Uninitialized variable: ea [drivers/ddr/fsl/ctrl_regs.c:2256]: (error) Uninitialized variable: sa [drivers/ddr/fsl/ctrl_regs.c:1985]: (error) Uninitialized variable: zqcs_init [drivers/mmc/fsl_esdhc_spl.c:95]: (error) Dereferencing 'tmp_buf' after it is deallocated / released [drivers/mmc/fsl_esdhc_spl.c:98]: (error) Memory pointed to by 'tmp_buf' is freed twice. [drivers/mmc/fsl_esdhc_spl.c:101]: (error) Dereferencing 'tmp_buf' after it is deallocated / released [drivers/mmc/fsl_esdhc_spl.c:104]: (error) Memory pointed to by 'tmp_buf' is freed twice. Can you please have a look and fix these? Thanks in advance. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de A person who is more than casually interested in computers should be well schooled in machine language, since it is a fundamental part of a computer. -- Donald Knuth ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] MCF: uninitialized variables
Hello, cppcheck reports: [arch/m68k/cpu/mcf5227x/speed.c:89]: (error) Uninitialized variable: bootmode [arch/m68k/cpu/mcf532x/speed.c:248]: (error) Uninitialized variable: fout [arch/m68k/cpu/mcf5445x/speed.c:194]: (error) Uninitialized variable: bootmode Could you please have a look how to fix this? Eventually this could be used as opportunity to clean up the code a bit. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It usually takes more than three weeks to prepare a good impromptu speech. - Mark Twain ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2 3/4] common: introduce board_preboot_os hook
Hi Stefano, On 11/05/2014 02:32 PM, Stefano Babic wrote: Hi Nikita, On 29/10/2014 16:56, Nikita Kiryanov wrote: Introduce board specific function board_preboot_os() to allow for board specific config before we boot. Signed-off-by: Nikita Kiryanov Cc: Igor Grinberg Cc: Stefano Babic Cc: Tom Rini Cc: Jeroen Hofstee Cc: Otavio Salvador --- Changes in V2: - Added board_preboot_os to bootm.h - Split cm_fx6 stuff into a separate patch common/bootm_os.c | 7 +++ include/bootm.h | 1 + 2 files changed, 8 insertions(+) There is something that does not convince me. Really, the general statement should be to turn all devices off before booting the kernel, because this is what Linux expects. That said, this could be later solved with dm, because we will can iterate through all drivers and call a shutdown function. Currently, "preboot" functions are turning off the hardware, so the name is already misleading. And I see that arch_preboot_os() was also convinced (because it is weak) to become a board_preboot, for example here: board/renesas/koelsch/koelsch.c (and in other renesas implementation, too). I have some concerns adding a new weak function, that enables some further hooks inside board code. I find it not well scalable. In your case, you need such as sata_shutdown(), and it should be responsibility of the general sata code to call something specific for the board, if necessary. In current code, bootm_disable_interrupts() calls also usb_stop() and eth_halt(), - nothing to do with the name of the function. IMHO it should be better to move the code to shutdown interface inside boot_selected_os(), or having a common function "disable_hardware()" that calls usb_stop(), eth_halt() and then, why not, a sata_stop(). There is also in arch/arm/imx-common/cpu.c a derived implementation for arch_preboot_os(). Really it has nothing to do with arch, as I can see: it shuts down only the IPU. But it is another hook, and IMHO it is better stopping sata here as adding a hidden callback. You make some good points. I'll switch to using arch_preboot_os until there's a better way of doing this. -- Regards, Nikita Kiryanov ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] arch/arm/lib/board.c - uninitialized vars
Hi, I'm trying to clean up some warnings/errors detected when running "cppcheck" on the U-Boot source tree. For arch/arm/lib/board.c I get this: [arch/arm/lib/board.c:445]: (error) Uninitialized variable: id [arch/arm/lib/board.c:422]: (error) Uninitialized variable: addr_sp The problem is not usually detected by GCC depending on which macros are active, here especially CONFIG_SPL_BUILD The relevant code was last touched / introduced by commit f1d2b313: "ARM: add relocation support" some two years ago... I have some questions regarding the CONFIG_SPL_BUILD "else" case (i. e. when building with CONFIG_SPL_BUILD defined): 422 addr_sp += 128; /* leave 32 words for abort-stack */ Is this correct? The stack is growing downward, so should the '+' not be replaced by a '-', like we do a few lines above: 412 /* leave 3 words for abort-stack*/ 413 addr_sp -= 12; Why do we need 128 words in the CONFIG_SPL_BUILD case, but only 3 otherwise? Should we not move the "alignment for ABI compliance" part outside the CONFIG_SPL_BUILD if/else case, i. e. should this not always be done? And of course, how should we correctly initialize the "id" and "addr_sp" variable in both cases? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Der Dativ ist dem Genitiv sein Tod. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v4 2/2] Odroid-XU3: Add support for Odroid-XU3
This patch adds support for Odroid-XU3. Signed-off-by: Hyungwon Hwang Cc: Minkyu Kang Cc: Lukasz Majewski --- Changes for v3: - Remove unnecessary node from DT file - Remove unnecessary features from config file - Remove unnecessary macros from board-specific header file - Fix some trivial typos in comments Changes for v4: - Add MMC FIFO buffer's configuration to DT file - Make CONFIG_OF_CONTROL be set by the target information - Add basic document to doc/README.odroid-xu3 - Add CONFIG_CMD_EXT4 to config file - Add environment size and offset to config file - Add extra default environment to make bootable without modification - Remove unnecessary features from config file arch/arm/cpu/armv7/exynos/Kconfig | 5 ++ arch/arm/dts/Makefile | 3 +- arch/arm/dts/exynos5422-odroidxu3.dts | 60 ++ board/samsung/odroid-xu3/Kconfig | 12 +++ board/samsung/odroid-xu3/MAINTAINERS | 6 ++ board/samsung/odroid-xu3/Makefile | 7 ++ board/samsung/odroid-xu3/odroid-xu3.c | 131 +++ board/samsung/odroid-xu3/setup.h | 95 ++ configs/odroid-xu3_defconfig | 4 + doc/README.odroid-xu3 | 134 +++ include/configs/odroid_xu3.h | 144 ++ 11 files changed, 600 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts create mode 100644 board/samsung/odroid-xu3/Kconfig create mode 100644 board/samsung/odroid-xu3/MAINTAINERS create mode 100644 board/samsung/odroid-xu3/Makefile create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c create mode 100644 board/samsung/odroid-xu3/setup.h create mode 100644 configs/odroid-xu3_defconfig create mode 100644 doc/README.odroid-xu3 create mode 100644 include/configs/odroid_xu3.h diff --git a/arch/arm/cpu/armv7/exynos/Kconfig b/arch/arm/cpu/armv7/exynos/Kconfig index 3a25fee..d0530f0 100644 --- a/arch/arm/cpu/armv7/exynos/Kconfig +++ b/arch/arm/cpu/armv7/exynos/Kconfig @@ -22,6 +22,10 @@ config TARGET_TRATS2 config TARGET_ODROID bool "Exynos4412 Odroid board" +config TARGET_ODROID_XU3 + bool "Exynos5422 Odroid board" + select OF_CONTROL if !SPL_BUILD + config TARGET_ARNDALE bool "Exynos5250 Arndale board" select OF_CONTROL if !SPL_BUILD @@ -60,6 +64,7 @@ source "board/samsung/universal_c210/Kconfig" source "board/samsung/origen/Kconfig" source "board/samsung/trats2/Kconfig" source "board/samsung/odroid/Kconfig" +source "board/samsung/odroid-xu3/Kconfig" source "board/samsung/arndale/Kconfig" source "board/samsung/smdk5250/Kconfig" source "board/samsung/smdk5420/Kconfig" diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 2dcfcc0..66191f9 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -12,7 +12,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5250-smdk5250.dtb \ exynos5420-smdk5420.dtb \ exynos5420-peach-pit.dtb \ - exynos5800-peach-pi.dtb + exynos5800-peach-pi.dtb \ + exynos5422-odroidxu3.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts new file mode 100644 index 000..21c0023 --- /dev/null +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -0,0 +1,60 @@ +/* + * Odroid XU3 device tree source + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * SPDX-License-Identifier:GPL-2.0+ + */ + +/dts-v1/; +/include/ "exynos54xx.dtsi" + +/ { + model = "Odroid XU3 based on EXYNOS5422"; + compatible = "samsung,odroidxu3", "samsung,exynos5"; + + aliases { + serial0 = "/serial@12C0"; + console = "/serial@12C2"; + }; + + memory { + device_type = "memory"; + reg = <0x4000 0x1000 + 0x5000 0x1000 + 0x6000 0x1000 + 0x7000 0x1000 + 0x8000 0x1000 + 0x9000 0x1000 + 0xa000 0x1000 + 0xb000 0xea0>; + }; + + serial@12C2 { + status="okay"; + }; + + mmc@1220 { + samsung,bus-width = <8>; + samsung,timing = <1 3 3>; + samsung,removable = <0>; + samsung,pre-init; + fifoth_val = <0x200f0020>; + }; + + mmc@1221 { + status = "disabled"; + }; + + mmc@1222 { + samsung,bus-width = <4>; + samsung,timing = <1 2 3>; + samsung,removable = <1>; + fifoth_val =
[U-Boot] [PATCH v4 1/2] exynos5: fix GPIO information of exynos5420
This patch fixes wrong GPIO information such as GPIO bank, table which is used to convert GPIO name to index, bank base address, and etc. Signed-off-by: Hyungwon Hwang Cc: Minkyu Kang Cc: Lukasz Majewski --- Changes for v4: - None arch/arm/include/asm/arch-exynos/cpu.h | 11 +- arch/arm/include/asm/arch-exynos/gpio.h | 232 +++- 2 files changed, 117 insertions(+), 126 deletions(-) diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index 7c5c4ff..da4ac6b 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -139,7 +139,7 @@ /* EXYNOS5420 */ #define EXYNOS5420_AUDIOSS_BASE0x0381 -#define EXYNOS5420_GPIO_PART6_BASE 0x0386 +#define EXYNOS5420_GPIO_PART5_BASE 0x0386 #define EXYNOS5420_PRO_ID 0x1000 #define EXYNOS5420_CLOCK_BASE 0x1001 #define EXYNOS5420_POWER_BASE 0x1004 @@ -161,11 +161,10 @@ #define EXYNOS5420_I2S_BASE0x12D6 #define EXYNOS5420_PWMTIMER_BASE 0x12DD #define EXYNOS5420_SPI_ISP_BASE0x131A -#define EXYNOS5420_GPIO_PART2_BASE 0x1340 -#define EXYNOS5420_GPIO_PART3_BASE 0x13400C00 -#define EXYNOS5420_GPIO_PART4_BASE 0x1341 -#define EXYNOS5420_GPIO_PART5_BASE 0x1400 -#define EXYNOS5420_GPIO_PART1_BASE 0x1401 +#define EXYNOS5420_GPIO_PART1_BASE 0x1340 +#define EXYNOS5420_GPIO_PART2_BASE 0x1341 +#define EXYNOS5420_GPIO_PART3_BASE 0x1400 +#define EXYNOS5420_GPIO_PART4_BASE 0x1401 #define EXYNOS5420_MIPI_DSIM_BASE 0x1450 #define EXYNOS5420_DP_BASE 0x145B diff --git a/arch/arm/include/asm/arch-exynos/gpio.h b/arch/arm/include/asm/arch-exynos/gpio.h index 32e045a..431ae3a 100644 --- a/arch/arm/include/asm/arch-exynos/gpio.h +++ b/arch/arm/include/asm/arch-exynos/gpio.h @@ -1028,83 +1028,7 @@ enum exynos5_gpio_pin { }; enum exynos5420_gpio_pin { - /* GPIO_PART1_STARTS */ - EXYNOS5420_GPIO_A00,/* 0 */ - EXYNOS5420_GPIO_A01, - EXYNOS5420_GPIO_A02, - EXYNOS5420_GPIO_A03, - EXYNOS5420_GPIO_A04, - EXYNOS5420_GPIO_A05, - EXYNOS5420_GPIO_A06, - EXYNOS5420_GPIO_A07, - EXYNOS5420_GPIO_A10,/* 8 */ - EXYNOS5420_GPIO_A11, - EXYNOS5420_GPIO_A12, - EXYNOS5420_GPIO_A13, - EXYNOS5420_GPIO_A14, - EXYNOS5420_GPIO_A15, - EXYNOS5420_GPIO_A16, - EXYNOS5420_GPIO_A17, - EXYNOS5420_GPIO_A20,/* 16 0x10 */ - EXYNOS5420_GPIO_A21, - EXYNOS5420_GPIO_A22, - EXYNOS5420_GPIO_A23, - EXYNOS5420_GPIO_A24, - EXYNOS5420_GPIO_A25, - EXYNOS5420_GPIO_A26, - EXYNOS5420_GPIO_A27, - EXYNOS5420_GPIO_B00,/* 24 0x18 */ - EXYNOS5420_GPIO_B01, - EXYNOS5420_GPIO_B02, - EXYNOS5420_GPIO_B03, - EXYNOS5420_GPIO_B04, - EXYNOS5420_GPIO_B05, - EXYNOS5420_GPIO_B06, - EXYNOS5420_GPIO_B07, - EXYNOS5420_GPIO_B10,/* 32 0x20 */ - EXYNOS5420_GPIO_B11, - EXYNOS5420_GPIO_B12, - EXYNOS5420_GPIO_B13, - EXYNOS5420_GPIO_B14, - EXYNOS5420_GPIO_B15, - EXYNOS5420_GPIO_B16, - EXYNOS5420_GPIO_B17, - EXYNOS5420_GPIO_B20,/* 40 0x28 */ - EXYNOS5420_GPIO_B21, - EXYNOS5420_GPIO_B22, - EXYNOS5420_GPIO_B23, - EXYNOS5420_GPIO_B24, - EXYNOS5420_GPIO_B25, - EXYNOS5420_GPIO_B26, - EXYNOS5420_GPIO_B27, - EXYNOS5420_GPIO_B30,/* 48 0x30 */ - EXYNOS5420_GPIO_B31, - EXYNOS5420_GPIO_B32, - EXYNOS5420_GPIO_B33, - EXYNOS5420_GPIO_B34, - EXYNOS5420_GPIO_B35, - EXYNOS5420_GPIO_B36, - EXYNOS5420_GPIO_B37, - EXYNOS5420_GPIO_B40,/* 56 0x38 */ - EXYNOS5420_GPIO_B41, - EXYNOS5420_GPIO_B42, - EXYNOS5420_GPIO_B43, - EXYNOS5420_GPIO_B44, - EXYNOS5420_GPIO_B45, - EXYNOS5420_GPIO_B46, - EXYNOS5420_GPIO_B47, - EXYNOS5420_GPIO_H00,/* 64 0x40 */ - EXYNOS5420_GPIO_H01, - EXYNOS5420_GPIO_H02, - EXYNOS5420_GPIO_H03, - EXYNOS5420_GPIO_H04, - EXYNOS5420_GPIO_H05, - EXYNOS5420_GPIO_H06, - EXYNOS5420_GPIO_H07, - - /* GPIO PART 2 STARTS*/ - EXYNOS5420_GPIO_MAX_PORT_PART_1,/* 72 0x48 */ - EXYNOS5420_GPIO_Y70 = EXYNOS5420_GPIO_MAX_PORT_PART_1, + EXYNOS5420_GPIO_Y70, EXYNOS5420_GPIO_Y71, EXYNOS5420_GPIO_Y72, EXYNOS5420_GPIO_Y73, @@ -1112,10 +1036,7 @@ enum exynos5420_gpio_pin { EXYNOS5420_GPIO_Y75, EXYNOS5420_GPIO_Y76, EXYNOS5420_GPIO_Y77, - - /* GPIO PART 3 STARTS*/ - EXYNOS5420_GPIO_MAX_PORT_PART_2,/* 80 0x50 */ - EXYNOS5420_GPIO_X00 = EXYNOS5420_GPIO_MAX_PORT_PART_2, + EXYNOS5420_GPIO_X00, EXYNOS5420_GPIO_X01, EXYN
[U-Boot] [PATCH v4 0/2] Adds support for Exynos5422 odroid xu3 board
This is v4 of the patchset adding support Odroud XU3 board. link to the previous version: v2: https://www.mail-archive.com/u-boot@lists.denx.de/msg152275.html v3: https://www.mail-archive.com/u-boot%40lists.denx.de/msg152677.html This patchset fixes GPIO information of Exynos5420 which is needed to support Exynos5422 Odroid XU3 board. On the base of the fixes, this patchset adds support for Exynos5422 Odroid XU3 board. I have done this work on the master branch in http://git.denx.de/u-boot-samsung.git with patches by Akshay Saraswat. link: https://patchwork.ozlabs.org/patch/400043/ Changes for v2: - Add a patch to add new common setup header file for Odroid X2/U3 and Odroid XU3 Changes for v3: - Remove the patch which adds new common setup header file from v2 - Remove the wrong patch to fix GPIO information of Exynos 5800 - Remove unnecessary node from DT file - Remove unnecessary features from config file - Fix some trivial typos in comments Changes for v4: - Add MMC FIFO buffer's configuration to DT file - Make CONFIG_OF_CONTROL be set by the target information - Add basic document to doc/README.odroid-xu3 - Add CONFIG_CMD_EXT4 to config file - Add environment size and offset to config file - Add extra default environment to make bootable without modification - Remove unnecessary features from config file Hyungwon Hwang (2): exynos5: fix GPIO information of exynos5420 Odroid-XU3: Add support for Odroid-XU3 arch/arm/cpu/armv7/exynos/Kconfig | 5 + arch/arm/dts/Makefile | 3 +- arch/arm/dts/exynos5422-odroidxu3.dts | 60 + arch/arm/include/asm/arch-exynos/cpu.h | 11 +- arch/arm/include/asm/arch-exynos/gpio.h | 232 +++- board/samsung/odroid-xu3/Kconfig| 12 ++ board/samsung/odroid-xu3/MAINTAINERS| 6 + board/samsung/odroid-xu3/Makefile | 7 + board/samsung/odroid-xu3/odroid-xu3.c | 131 ++ board/samsung/odroid-xu3/setup.h| 95 + configs/odroid-xu3_defconfig| 4 + doc/README.odroid-xu3 | 134 ++ include/configs/odroid_xu3.h| 144 13 files changed, 717 insertions(+), 127 deletions(-) create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts create mode 100644 board/samsung/odroid-xu3/Kconfig create mode 100644 board/samsung/odroid-xu3/MAINTAINERS create mode 100644 board/samsung/odroid-xu3/Makefile create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c create mode 100644 board/samsung/odroid-xu3/setup.h create mode 100644 configs/odroid-xu3_defconfig create mode 100644 doc/README.odroid-xu3 create mode 100644 include/configs/odroid_xu3.h -- 1.8.3.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ARM: UniPhier: move DDR related configuration to Kconfig
Signed-off-by: Masahiro Yamada --- arch/arm/cpu/armv7/uniphier/Kconfig | 23 +++ arch/arm/cpu/armv7/uniphier/dram_init.c | 2 +- arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile| 3 +-- arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c | 4 arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile | 3 +-- arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c | 4 arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile | 3 +-- arch/arm/cpu/armv7/uniphier/ph1-sld8/umc_init.c | 4 include/configs/ph1_ld4.h | 2 -- include/configs/ph1_pro4.h | 2 -- include/configs/ph1_sld8.h | 2 -- 11 files changed, 27 insertions(+), 25 deletions(-) diff --git a/arch/arm/cpu/armv7/uniphier/Kconfig b/arch/arm/cpu/armv7/uniphier/Kconfig index f013dc3..011c6d9 100644 --- a/arch/arm/cpu/armv7/uniphier/Kconfig +++ b/arch/arm/cpu/armv7/uniphier/Kconfig @@ -32,4 +32,27 @@ config CMD_PINMON The boot mode pins are latched when the system reset is deasserted and determine which device the system should load a boot image from. +config DRAM_INIT + bool + default SPL_BUILD + +choice + prompt "DDR3 Frequency select" + depends on DRAM_INIT + +config DDR_FREQ_1600 + bool "DDR3 1600" + depends on MACH_PH1_PRO4 || MACH_PH1_LD4 + +config DDR_FREQ_1333 + bool "DDR3 1333" + depends on MACH_PH1_LD4 || MACH_PH1_SLD8 + +endchoice + +config DDR_FREQ + int + default 1333 if DDR_FREQ_1333 + default 1600 if DDR_FREQ_1600 + endmenu diff --git a/arch/arm/cpu/armv7/uniphier/dram_init.c b/arch/arm/cpu/armv7/uniphier/dram_init.c index 5465a0e..7de657b 100644 --- a/arch/arm/cpu/armv7/uniphier/dram_init.c +++ b/arch/arm/cpu/armv7/uniphier/dram_init.c @@ -16,7 +16,7 @@ int dram_init(void) DECLARE_GLOBAL_DATA_PTR; gd->ram_size = CONFIG_SYS_SDRAM_SIZE; -#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) +#ifdef CONFIG_DRAM_INIT led_write(B, 4, , ); { diff --git a/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile b/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile index 781b511..5722ee2 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile +++ b/arch/arm/cpu/armv7/uniphier/ph1-ld4/Makefile @@ -7,5 +7,4 @@ obj-y += platdevice.o obj-y += boot-mode.o obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \ sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o -obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \ - umc_init.o +obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o diff --git a/arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c b/arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c index 1344ac1..ebcbaab 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-ld4/umc_init.c @@ -149,10 +149,6 @@ int umc_init(void) CONFIG_SDRAM1_SIZE / 0x0800); } -#if CONFIG_DDR_FREQ != 1333 && CONFIG_DDR_FREQ != 1600 -#error Unsupported DDR Frequency. -#endif - #if (CONFIG_SDRAM0_SIZE == 0x0800 || CONFIG_SDRAM0_SIZE == 0x1000) && \ (CONFIG_SDRAM1_SIZE == 0x0800 || CONFIG_SDRAM1_SIZE == 0x1000) && \ CONFIG_DDR_NUM_CH0 == 1 && CONFIG_DDR_NUM_CH1 == 1 diff --git a/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile b/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile index e11f4f6..25a1202 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile +++ b/arch/arm/cpu/armv7/uniphier/ph1-pro4/Makefile @@ -7,5 +7,4 @@ obj-y += platdevice.o obj-y += boot-mode.o obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o sbc_init.o \ sg_init.o pll_init.o clkrst_init.o pinctrl.o -obj-$(CONFIG_SPL_BUILD) += pll_spectrum.o \ - umc_init.o +obj-$(CONFIG_DRAM_INIT) += pll_spectrum.o umc_init.o diff --git a/arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c b/arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c index dd46287..328b2f4 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c +++ b/arch/arm/cpu/armv7/uniphier/ph1-pro4/umc_init.c @@ -122,10 +122,6 @@ int umc_init(void) CONFIG_SDRAM1_SIZE / 0x0800); } -#if CONFIG_DDR_FREQ != 1600 -#error Unsupported DDR frequency. -#endif - #if ((CONFIG_SDRAM0_SIZE == 0x2000 && CONFIG_DDR_NUM_CH0 == 2) || \ (CONFIG_SDRAM0_SIZE == 0x1000 && CONFIG_DDR_NUM_CH0 == 1)) && \ ((CONFIG_SDRAM1_SIZE == 0x2000 && CONFIG_DDR_NUM_CH1 == 2) || \ diff --git a/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile b/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile index 781b511..5722ee2 100644 --- a/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile +++ b/arch/arm/cpu/armv7/uniphier/ph1-sld8/Makefile @@ -7,5 +7,4 @@ obj-y += platdevice.o obj-y += boot-mode.o obj-$(CONFIG_BOARD_POSTCLK_INIT) += board_postclk_init.o bcu_init.o \ sbc_init.o sg_init.o pll_init.o clkrst_init.o pinctrl.o -obj-$(CONFIG_S
[U-Boot] [PATCH] exynos: dts: Correct USB vbus-gpio numbering for Snow
The current vbus GPIOs on snow make very little sense, their number is far above the maximum. As a result, USB doesn't work on snow. Correct the GPIO numbering so they match the current scheme for exynos5. Tested both EHCI and XHCI to correctly work after this change. Signed-off-by: Sjoerd Simons --- arch/arm/dts/exynos5250-snow.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts index 6fd9275..95af025 100644 --- a/arch/arm/dts/exynos5250-snow.dts +++ b/arch/arm/dts/exynos5250-snow.dts @@ -131,11 +131,11 @@ }; ehci@1211 { - samsung,vbus-gpio = <&gpio 0x309 0>; /* X11 */ + samsung,vbus-gpio = <&gpio 0xb1 0>; /* X11 */ }; xhci@1200 { - samsung,vbus-gpio = <&gpio 0x317 0>; /* X27 */ + samsung,vbus-gpio = <&gpio 0xbf 0>; /* X27 */ }; tmu@1006 { -- 2.1.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] mtd: sf: Zap ramtron driver
Removed ramtron driver since the EMK boards are no longer been active, and these are the only boards used this flash driver. Commit details for EMK zap: "ppc/arm: zap EMK boards" (sha1: d58a9451e7339ed4cf2b2627e534611f427fb791) Signed-off-by: Jagannadha Sutradharudu Teki Cc: Reinhard Meyer --- drivers/mtd/spi/Makefile | 1 - drivers/mtd/spi/ramtron.c | 404 -- 2 files changed, 405 deletions(-) delete mode 100644 drivers/mtd/spi/ramtron.c diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile index 15789a0..c61b784 100644 --- a/drivers/mtd/spi/Makefile +++ b/drivers/mtd/spi/Makefile @@ -17,6 +17,5 @@ obj-$(CONFIG_SPI_FLASH) += sf_probe.o #endif obj-$(CONFIG_CMD_SF) += sf.o obj-$(CONFIG_SPI_FLASH) += sf_ops.o sf_params.o -obj-$(CONFIG_SPI_FRAM_RAMTRON) += ramtron.o obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o obj-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o diff --git a/drivers/mtd/spi/ramtron.c b/drivers/mtd/spi/ramtron.c deleted file mode 100644 index a23032c..000 --- a/drivers/mtd/spi/ramtron.c +++ /dev/null @@ -1,404 +0,0 @@ -/* - * (C) Copyright 2010 - * Reinhard Meyer, EMK Elektronik, reinhard.me...@emk-elektronik.de - * - * SPDX-License-Identifier:GPL-2.0+ - */ - -/* - * Note: RAMTRON SPI FRAMs are ferroelectric, nonvolatile RAMs - * with an interface identical to SPI flash devices. - * However since they behave like RAM there are no delays or - * busy polls required. They can sustain read or write at the - * allowed SPI bus speed, which can be 40 MHz for some devices. - * - * Unfortunately some RAMTRON devices do not have a means of - * identifying them. They will leave the SO line undriven when - * the READ-ID command is issued. It is therefore mandatory - * that the MISO line has a proper pull-up, so that READ-ID - * will return a row of 0xff. This 0xff pseudo-id will cause - * probes by all vendor specific functions that are designed - * to handle it. If the MISO line is not pulled up, READ-ID - * could return any random noise, even mimicking another - * device. - * - * We use CONFIG_SPI_FRAM_RAMTRON_NON_JEDEC - * to define which device will be assumed after a simple status - * register verify. This method is prone to false positive - * detection and should therefore be the last to be tried. - * Enter it in the last position in the table in spi_flash.c! - * - * The define CONFIG_SPI_FRAM_RAMTRON_NON_JEDEC both activates - * compilation of the special handler and defines the device - * to assume. - */ - -#include -#include -#include -#include -#include "sf_internal.h" - -/* - * Properties of supported FRAMs - * Note: speed is currently not used because we have no method to deliver that - * value to the upper layers - */ -struct ramtron_spi_fram_params { - u32 size; /* size in bytes */ - u8 addr_len; /* number of address bytes */ - u8 merge_cmd; /* some address bits are in the command byte */ - u8 id1;/* device ID 1 (family, density) */ - u8 id2;/* device ID 2 (sub, rev, rsvd) */ - u32 speed; /* max. SPI clock in Hz */ - const char *name; /* name for display and/or matching */ -}; - -struct ramtron_spi_fram { - struct spi_flash flash; - const struct ramtron_spi_fram_params *params; -}; - -static inline struct ramtron_spi_fram *to_ramtron_spi_fram(struct spi_flash -*flash) -{ - return container_of(flash, struct ramtron_spi_fram, flash); -} - -/* - * table describing supported FRAM chips: - * chips without RDID command must have the values 0xff for id1 and id2 - */ -static const struct ramtron_spi_fram_params ramtron_spi_fram_table[] = { - { - .size = 32*1024, - .addr_len = 2, - .merge_cmd = 0, - .id1 = 0x22, - .id2 = 0x00, - .speed = 4000, - .name = "FM25V02", - }, - { - .size = 32*1024, - .addr_len = 2, - .merge_cmd = 0, - .id1 = 0x22, - .id2 = 0x01, - .speed = 4000, - .name = "FM25VN02", - }, - { - .size = 64*1024, - .addr_len = 2, - .merge_cmd = 0, - .id1 = 0x23, - .id2 = 0x00, - .speed = 4000, - .name = "FM25V05", - }, - { - .size = 64*1024, - .addr_len = 2, - .merge_cmd = 0, - .id1 = 0x23, - .id2 = 0x01, - .speed = 4000, - .name = "FM25VN05", - }, - { - .size = 128*1024, - .addr_len = 3, - .merge_cmd = 0, - .id1 = 0x24, - .id2 = 0x00, - .speed = 4000, - .name = "F
Re: [U-Boot] [PATCH 2/2] spi: add common spi3 controller driver
Ping. Scott 2014-09-25 17:25 GMT+08:00 Scott Jiang : > SPI3 controller is not only used on BF609 platform. So we add a common > controller > driver and leave machine specific configuration in board drivers. > Remove obsolete spi6xx.h and select new board driver in configuration file. > > Signed-off-by: Scott Jiang > --- > drivers/spi/Makefile |1 + > drivers/spi/adi_spi3.c | 222 > .../bits/spi6xx.h => drivers/spi/adi_spi3.h| 27 +- > drivers/spi/bfin_spi6xx.c | 279 > ++-- > include/configs/bf609-ezkit.h |1 + > 5 files changed, 262 insertions(+), 268 deletions(-) > create mode 100644 drivers/spi/adi_spi3.c > rename arch/blackfin/include/asm/mach-common/bits/spi6xx.h => > drivers/spi/adi_spi3.h (95%) > > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile > index f02c35a..e0c82e6 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -16,6 +16,7 @@ obj-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o > obj-$(CONFIG_ATMEL_SPI) += atmel_spi.o > obj-$(CONFIG_BFIN_SPI) += bfin_spi.o > obj-$(CONFIG_BFIN_SPI6XX) += bfin_spi6xx.o > +obj-$(CONFIG_ADI_SPI3) += adi_spi3.o > obj-$(CONFIG_CF_SPI) += cf_spi.o > obj-$(CONFIG_CF_QSPI) += cf_qspi.o > obj-$(CONFIG_DAVINCI_SPI) += davinci_spi.o > diff --git a/drivers/spi/adi_spi3.c b/drivers/spi/adi_spi3.c > new file mode 100644 > index 000..89c914a > --- /dev/null > +++ b/drivers/spi/adi_spi3.c > @@ -0,0 +1,222 @@ > +/* > + * Analog Devices SPI3 controller driver > + * > + * Copyright (c) 2014 Analog Devices Inc. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include "adi_spi3.h" > + > +#define to_adi_spi_slave(s) container_of(s, struct adi_spi_slave, slave) > + > +int spi_cs_is_valid(unsigned int bus, unsigned int cs) > +{ > + if (is_gpio_cs(cs)) > + return gpio_is_valid(gpio_cs(cs)); > + else > + return adi_spi_cs_valid(bus, cs); > +} > + > +void spi_cs_activate(struct spi_slave *slave) > +{ > + struct adi_spi_slave *sdev = to_adi_spi_slave(slave); > + > + if (is_gpio_cs(slave->cs)) { > + unsigned int cs = gpio_cs(slave->cs); > + gpio_set_value(cs, sdev->cs_pol); > + } else { > + u32 ssel; > + ssel = readl(&sdev->regs->ssel); > + ssel |= BIT_SSEL_EN(slave->cs); > + if (sdev->cs_pol) > + ssel |= BIT_SSEL_VAL(slave->cs); > + else > + ssel &= ~BIT_SSEL_VAL(slave->cs); > + writel(ssel, &sdev->regs->ssel); > + } > +} > + > +void spi_cs_deactivate(struct spi_slave *slave) > +{ > + struct adi_spi_slave *sdev = to_adi_spi_slave(slave); > + > + if (is_gpio_cs(slave->cs)) { > + unsigned int cs = gpio_cs(slave->cs); > + gpio_set_value(cs, !sdev->cs_pol); > + gpio_set_value(cs, 1); > + } else { > + u32 ssel; > + ssel = readl(&sdev->regs->ssel); > + if (sdev->cs_pol) > + ssel &= ~BIT_SSEL_VAL(slave->cs); > + else > + ssel |= BIT_SSEL_VAL(slave->cs); > + /* deassert cs */ > + writel(ssel, &sdev->regs->ssel); > + /* disable cs */ > + ssel &= ~BIT_SSEL_EN(slave->cs); > + writel(ssel, &sdev->regs->ssel); > + } > +} > + > +void spi_init() > +{ > +} > + > +void spi_set_speed(struct spi_slave *slave, uint hz) > +{ > + struct adi_spi_slave *sdev = to_adi_spi_slave(slave); > + u32 clock; > + > + clock = get_spi_clk() / hz; > + if (clock) > + clock--; > + sdev->clock = clock; > +} > + > +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, > + unsigned int max_hz, unsigned int mode) > +{ > + struct adi_spi_slave *sdev; > + > + if (!spi_cs_is_valid(bus, cs)) > + return NULL; > + > + if (max_hz > get_spi_clk()) > + return NULL; > + > + sdev = adi_spi_setup(bus, cs); > + if (!sdev) > + return NULL; > + > + sdev->control = SPI_CTL_EN | SPI_CTL_MSTR; > + if (mode & SPI_CPHA) > + sdev->control |= SPI_CTL_CPHA; > + if (mode & SPI_CPOL) > + sdev->control |= SPI_CTL
Re: [U-Boot] [PATCH 1/2] blackfin: spi: move spi max chip select to spi.h
Ping. Scott 2014-09-25 17:25 GMT+08:00 Scott Jiang : > This macro is only related to spi. So it's better to place it in spi.h. > > Signed-off-by: Scott Jiang > --- > arch/blackfin/include/asm/config-pre.h |3 --- > arch/blackfin/include/asm/mach-common/bits/spi.h |1 + > 2 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/arch/blackfin/include/asm/config-pre.h > b/arch/blackfin/include/asm/config-pre.h > index 2d8b293..189cb05 100644 > --- a/arch/blackfin/include/asm/config-pre.h > +++ b/arch/blackfin/include/asm/config-pre.h > @@ -70,9 +70,6 @@ static inline const char *get_bfin_boot_mode(int bfin_boot) > # define BFIN_BOOT_SPI_SSEL 1 > #endif > > -/* Define to get a GPIO CS with the Blackfin SPI controller */ > -#define MAX_CTRL_CS 8 > - > /* There is no Blackfin/NetBSD port */ > #undef CONFIG_BOOTM_NETBSD > > diff --git a/arch/blackfin/include/asm/mach-common/bits/spi.h > b/arch/blackfin/include/asm/mach-common/bits/spi.h > index 869dcb0..180cfaa 100644 > --- a/arch/blackfin/include/asm/mach-common/bits/spi.h > +++ b/arch/blackfin/include/asm/mach-common/bits/spi.h > @@ -64,4 +64,5 @@ > #define RXS0x0020 /* SPI_RDBR Data Buffer Status > (Full/Empty*) */ > #define TXCOL 0x0040 /* Transmit Collision Error (Corrupt > Data May Have Been Sent) */ > > +#define MAX_CTRL_CS 7 > #endif > -- > 1.7.9.5 > ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] test: ums: Add sleep before unmount directory
This change helps to run script on machines with quite long uptime. Without this the following error emerges: File: ./dat_14M.img umount: /mnt/tmp-ums-test: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) TX: md5sum:083d3d22b542d3ecba61b12d17e03f9f mount: /dev/sdd6 already mounted or /mnt/tmp-ums-test busy mount: according to mtab, /dev/sdd6 is already mounted on /mnt/tmp-ums-test Signed-off-by: Lukasz Majewski --- test/ums/ums_gadget_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ums/ums_gadget_test.sh b/test/ums/ums_gadget_test.sh index 56d4616..f862332 100755 --- a/test/ums/ums_gadget_test.sh +++ b/test/ums/ums_gadget_test.sh @@ -59,6 +59,7 @@ ums_test_file () { fi cp ./$1 $MNT_DIR +sleep 2 umount $MNT_DIR -- 2.0.0.rc2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/5] usb: s3c-otg: Split out PHY control
Hi Marek, > Split the Samsung specific PHY control into a separate file > and compile this into the S3C OTG driver only if used on a > Samsung system. > > Signed-off-by: Marek Vasut > Cc: Chin Liang See > Cc: Dinh Nguyen > Cc: Vince Bridgers > Cc: Pavel Machek > Cc: Stefan Roese > Cc: Lukasz Majewski > --- > drivers/usb/gadget/Makefile | 1 + > drivers/usb/gadget/s3c_udc_otg.c | 64 +-- > drivers/usb/gadget/s3c_udc_otg_phy.c | 99 > > include/configs/exynos4-common.h | 1 + > include/configs/s5p_goni.h | 1 + > include/configs/s5pc210_universal.h | 1 + > include/configs/smdkv310.h | 1 + 7 files changed, 106 > insertions(+), 62 deletions(-) create mode 100644 > drivers/usb/gadget/s3c_udc_otg_phy.c > > diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile > index 2efd5a4..70bb550 100644 > --- a/drivers/usb/gadget/Makefile > +++ b/drivers/usb/gadget/Makefile > @@ -12,6 +12,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o > usbstring.o ifdef CONFIG_USB_GADGET > obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o > obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o > +obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o > obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o > obj-$(CONFIG_CI_UDC) += ci_udc.o > obj-$(CONFIG_THOR_FUNCTION) += f_thor.o > diff --git a/drivers/usb/gadget/s3c_udc_otg.c > b/drivers/usb/gadget/s3c_udc_otg.c index b808ddaf..b910053 100644 > --- a/drivers/usb/gadget/s3c_udc_otg.c > +++ b/drivers/usb/gadget/s3c_udc_otg.c > @@ -151,68 +151,8 @@ bool dfu_usb_get_reset(void) > return !!(readl(®->gintsts) & INT_RESET); > } > > -void otg_phy_init(struct s3c_udc *dev) > -{ > - unsigned int usb_phy_ctrl = dev->pdata->usb_phy_ctrl; > - struct s3c_usbotg_phy *phy = > - (struct s3c_usbotg_phy *)dev->pdata->regs_phy; > - > - dev->pdata->phy_control(1); > - > - /*USB PHY0 Enable */ > - printf("USB PHY0 Enable\n"); > - > - /* Enable PHY */ > - writel(readl(usb_phy_ctrl) | USB_PHY_CTRL_EN0, usb_phy_ctrl); > - > - if (dev->pdata->usb_flags == PHY0_SLEEP) /* C210 Universal */ > - writel((readl(&phy->phypwr) > - &~(PHY_0_SLEEP | OTG_DISABLE_0 | > ANALOG_PWRDOWN) > - &~FORCE_SUSPEND_0), &phy->phypwr); > - else /* C110 GONI */ > - writel((readl(&phy->phypwr) &~(OTG_DISABLE_0 | > ANALOG_PWRDOWN) > - &~FORCE_SUSPEND_0), &phy->phypwr); > - > - if (s5p_cpu_id == 0x4412) > - writel((readl(&phy->phyclk) & > ~(EXYNOS4X12_ID_PULLUP0 | > - EXYNOS4X12_COMMON_ON_N0)) | > EXYNOS4X12_CLK_SEL_24MHZ, > -&phy->phyclk); /* PLL 24Mhz */ > - else > - writel((readl(&phy->phyclk) & ~(ID_PULLUP0 | > COMMON_ON_N0)) | > -CLK_SEL_24MHZ, &phy->phyclk); /* PLL 24Mhz */ > - > - writel((readl(&phy->rstcon) &~(LINK_SW_RST | PHYLNK_SW_RST)) > -| PHY_SW_RST0, &phy->rstcon); > - udelay(10); > - writel(readl(&phy->rstcon) > -&~(PHY_SW_RST0 | LINK_SW_RST | PHYLNK_SW_RST), > &phy->rstcon); > - udelay(10); > -} > - > -void otg_phy_off(struct s3c_udc *dev) > -{ > - unsigned int usb_phy_ctrl = dev->pdata->usb_phy_ctrl; > - struct s3c_usbotg_phy *phy = > - (struct s3c_usbotg_phy *)dev->pdata->regs_phy; > - > - /* reset controller just in case */ > - writel(PHY_SW_RST0, &phy->rstcon); > - udelay(20); > - writel(readl(&phy->phypwr) &~PHY_SW_RST0, &phy->rstcon); > - udelay(20); > - > - writel(readl(&phy->phypwr) | OTG_DISABLE_0 | ANALOG_PWRDOWN > -| FORCE_SUSPEND_0, &phy->phypwr); > - > - writel(readl(usb_phy_ctrl) &~USB_PHY_CTRL_EN0, usb_phy_ctrl); > - > - writel((readl(&phy->phyclk) & ~(ID_PULLUP0 | COMMON_ON_N0)), > - &phy->phyclk); > - > - udelay(1); > - > - dev->pdata->phy_control(0); > -} > +__weak void otg_phy_init(struct s3c_udc *dev) {} > +__weak void otg_phy_off(struct s3c_udc *dev) {} > > /***/ > > diff --git a/drivers/usb/gadget/s3c_udc_otg_phy.c > b/drivers/usb/gadget/s3c_udc_otg_phy.c new file mode 100644 > index 000..055fe86 > --- /dev/null > +++ b/drivers/usb/gadget/s3c_udc_otg_phy.c > @@ -0,0 +1,99 @@ > +/* > + * drivers/usb/gadget/s3c_udc_otg.c > + * Samsung S3C on-chip full/high speed USB OTG 2.0 device controllers > + * > + * Copyright (C) 2008 for Samsung Electronics > + * > + * BSP Support for Samsung's UDC driver > + * available at: > + * > git://git.kernel.org/pub/scm/linux/kernel/git/kki_ap/linux-2.6-samsung.git > + * > + * State machine bugfixes: > + * Marek Szyprowski > + * > + * Ported to u-boot: > + * Marek Szyprowski > + * Lukasz Majewski > + * > + * SPDX-License-Identifier: GPL-2.0+ > + */ > + > +#include > +#include > +#include > +#include > + > +#inclu
Re: [U-Boot] [PATCH 2/5] usb: s3c-otg: Encapsulate PHY control
Hi Marek, > Encapsulate the Samsung PHY control and it's register accesses > into the otg_phy_init() and otg_phy_off() functions. > > Signed-off-by: Marek Vasut > Cc: Chin Liang See > Cc: Dinh Nguyen > Cc: Vince Bridgers > Cc: Pavel Machek > Cc: Stefan Roese > Cc: Lukasz Majewski > --- > drivers/usb/gadget/s3c_udc_otg.c | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/gadget/s3c_udc_otg.c > b/drivers/usb/gadget/s3c_udc_otg.c index 7508b1a..b808ddaf 100644 > --- a/drivers/usb/gadget/s3c_udc_otg.c > +++ b/drivers/usb/gadget/s3c_udc_otg.c > @@ -145,8 +145,6 @@ static struct usb_ep_ops s3c_ep_ops = { > > void __iomem *regs_otg; > struct s3c_usbotg_reg *reg; > -struct s3c_usbotg_phy *phy; > -static unsigned int usb_phy_ctrl; > > bool dfu_usb_get_reset(void) > { > @@ -155,6 +153,10 @@ bool dfu_usb_get_reset(void) > > void otg_phy_init(struct s3c_udc *dev) > { > + unsigned int usb_phy_ctrl = dev->pdata->usb_phy_ctrl; > + struct s3c_usbotg_phy *phy = > + (struct s3c_usbotg_phy *)dev->pdata->regs_phy; > + > dev->pdata->phy_control(1); > > /*USB PHY0 Enable */ > @@ -189,6 +191,10 @@ void otg_phy_init(struct s3c_udc *dev) > > void otg_phy_off(struct s3c_udc *dev) > { > + unsigned int usb_phy_ctrl = dev->pdata->usb_phy_ctrl; > + struct s3c_usbotg_phy *phy = > + (struct s3c_usbotg_phy *)dev->pdata->regs_phy; > + > /* reset controller just in case */ > writel(PHY_SW_RST0, &phy->rstcon); > udelay(20); > @@ -853,9 +859,7 @@ int s3c_udc_probe(struct s3c_plat_otg_data *pdata) > > dev->pdata = pdata; > > - phy = (struct s3c_usbotg_phy *)pdata->regs_phy; > reg = (struct s3c_usbotg_reg *)pdata->regs_otg; > - usb_phy_ctrl = pdata->usb_phy_ctrl; > > /* regs_otg = (void *)pdata->regs_otg; */ > Acked-by: Lukasz Majewski Tested-by: Lukasz Majewski HW: Trats2 (Exynos4412) - on top of v2014.10 -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/5] usb: s3c-otg: Remove useless include
Hi Marek, > Remove the useless inclusion of arch/arm/gpio.h , which is completely > bogus in this driver. > > Signed-off-by: Marek Vasut > Cc: Chin Liang See > Cc: Dinh Nguyen > Cc: Vince Bridgers > Cc: Pavel Machek > Cc: Stefan Roese > Cc: Lukasz Majewski > --- > drivers/usb/gadget/s3c_udc_otg.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/usb/gadget/s3c_udc_otg.c > b/drivers/usb/gadget/s3c_udc_otg.c index b9816df..7508b1a 100644 > --- a/drivers/usb/gadget/s3c_udc_otg.c > +++ b/drivers/usb/gadget/s3c_udc_otg.c > @@ -31,7 +31,6 @@ > #include > > #include > -#include > > #include "regs-otg.h" > #include Acked-by: Lukasz Majewski -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux
Hi Masahiro, > U-Boot has never cared about the type when we get max/min of two > values, but Linux Kernel does. This commit gets min, max, min3, max3 > macros synced with the kernel introduing type checks. > > Many of references of those macros must be fixed to suppress warnings. > We have two options: > - Use min, max, min3, max3 only when the arguments have the same type >(or add casts to the arguments) > - Use min_t/max_t instead with the appropriate type for the first >argument > > Signed-off-by: Masahiro Yamada > --- > > arch/arm/cpu/arm1176/tnetv107x/clock.c| 5 ++- > arch/arm/cpu/armv7/exynos/clock.c | 4 +- > arch/arm/cpu/armv7/tegra20/display.c | 4 +- > arch/avr32/cpu/at32ap700x/clk.c | 2 +- > arch/blackfin/cpu/jtag-console.c | 2 +- > arch/blackfin/lib/string.c| 2 +- > arch/powerpc/cpu/mpc85xx/tlb.c| 2 +- > arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c| 32 ++-- > arch/powerpc/lib/bootm.c | 2 +- > arch/sandbox/cpu/start.c | 2 +- > arch/x86/cpu/coreboot/pci.c | 2 +- > arch/x86/cpu/coreboot/sdram.c | 2 +- > board/freescale/common/sys_eeprom.c | 6 +-- > board/gdsys/p1022/controlcenterd-id.c | 5 ++- > board/imgtec/malta/malta.c| 2 +- > common/cmd_elf.c | 12 +++--- > common/cmd_sf.c | 16 > common/env_nand.c | 4 +- > common/fdt_support.c | 3 +- > common/lcd.c | 6 +-- > common/usb_hub.c | 3 +- > drivers/block/ahci.c | 2 +- > drivers/ddr/fsl/ctrl_regs.c | 22 +-- > drivers/ddr/fsl/lc_common_dimm_params.c | 62 > ++- > drivers/ddr/fsl/main.c| 3 +- > drivers/dfu/dfu.c | 2 +- > drivers/i2c/fsl_i2c.c | 2 +- > drivers/misc/cros_ec_spi.c| 2 +- > drivers/mmc/fsl_esdhc.c | 2 +- > drivers/mmc/pxa_mmc_gen.c | 6 +-- > drivers/mtd/nand/denali_spl.c | 2 +- > drivers/mtd/spi/sandbox.c | 2 +- > drivers/mtd/spi/sf_ops.c | 5 ++- > drivers/net/netconsole.c | 2 +- > drivers/pci/pci.c | 6 ++- > drivers/pci/pci_auto.c| 2 +- > drivers/serial/usbtty.c | 2 +- > drivers/spi/fsl_espi.c| 4 +- > drivers/spi/mxc_spi.c | 2 +- > drivers/spi/spi-uclass.c | 2 +- > drivers/tpm/tpm_tis_lpc.c | 2 +- > drivers/usb/gadget/composite.c| 4 +- > drivers/usb/gadget/designware_udc.c | 4 +- > drivers/usb/gadget/pxa27x_udc.c | 3 +- > drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 4 +- >From my side: Acked-by: Lukasz Majewski Tested-by: Lukasz Majewski Test HW: Trats2 (Exynos4412) -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Query on the ci_udc driver for USB client implementation
Hi Sanchayan, > > > On Tuesday 04 November 2014 09:58 PM, Lukasz Majewski wrote: > > Hi Sanchayan, > > > >> On Tuesday 04 November 2014 10:25 AM, Marek Vasut wrote: > >>> On Monday, November 03, 2014 at 04:46:48 PM, Fabio Estevam wrote: > On Mon, Nov 3, 2014 at 3:33 AM, Sanchayan Maity > > wrote: > > Hello, > > > > Any pointers? > > Adding Marek and Stefan on Cc in case they can provide some help. > > Regards, > > Fabio Estevam > > > Thanks & Regards, > > Sanchayan Maity. > > > > On Thursday 30 October 2014 11:14 AM, Sanchayan Maity wrote: > >> Hello, > >> > >> I am currently implementing USB Host and client support for > >> Freescale Vybrid platform in u-boot. I managed to get the host > >> implementation working. > >> > >> For the host side, usb start calls usb_init(), which in turns > >> call, usb_lowlevel_init(), from there into the ehic_hcd_init() > >> of my implementation. So, setting up the necessary clocks and > >> plls for USB in my implementation and then setting up the > >> usb_ehci, ehci_hccr and echi_hcor structures was all. The flow > >> and setup required i was able to trace. > >> > >> The USB client part is not clear to me. I was thinking i can > >> use the ci_udc driver somehow to implement the client part. > >> How can i use the ci_udc driver to implement client > >> functionality?. From what i could see, the > >> usb_gadget_driver_register() is suppose to be the first call. > >> But, i couldn't trace from where this gets called or the flow > >> and setup is suppose to be. OR Is a separate client driver > >> required and nothing generic can be used akin to how it could > >> be done for host? > >>> > >>> See include/configs/sansa_fuze_plus.h , you need the gadget driver > >>> for the function you want to implement , in this case it's > >>> ethernet for example (selected via CONFIG_USB_ETH_CDC ). > >>> > >>> An example of DFU/UMS can be found in > >>> include/configs/exynos4-common.h and to activate those, you need > >>> to use the 'dfu' or 'ums' commands. > >> > >> Thank you Marek. I had enabled usb ether options already and was > >> trying to test USB client functionality with RNDIS. For some reason > >> it was not working and i was not able to trace the issue and > >> subsequently was not sure about the client part. Your inputs > >> cleared my doubts. I tried UMS and DFU. UMS is working just fine > >> and i can download the respective images through DFU. Though this > >> DFU is not working full proof, but, i can figure that out now i > >> feel. > > > > I'm very happy that UMS is working seamlessly. What kind of trouble > > do you have with DFU? > > Hello, > > I have a memory alignment problem with DFU as of now. > > mtdparts is as below > device nand0 , # parts = 4 > #: namesizeoffset mask_flags > 0: vf-bcb 0x0002 0x 1 > 1: u-boot 0x0016 0x0002 1 > 2: u-boot-env 0x0008 0x0018 0 > 3: ubi 0x3fe0 0x0020 0 > > active partition: nand0,0 - (vf-bcb) 0x0002 @ 0x > > defaults: > mtdids : nand0=fsl_nfc > mtdparts: > mtdparts=fsl_nfc:128k(vf-bcb)ro,1408k(u-boot)ro,512k(u-boot-env),-(ubi) > > As per the above, setenv dfu_alt_info "vf-bcb part 0,1;u-boot part > 0,2;ubi part 0,4" and CONFIG_SYS_CACHELINE_SIZE is 32. > > I have a ubifs image and i was trying to write it by running "dfu 0 > nand 4" in u-boot and "sudo dfu-util -D ubifs.img -a ubi" on the > host. I got the error as below. > > "dfu_get_buf: Could not memalign 0x80 bytes > > Setting CONFIG_SYS_DFU_DATA_BUF_SIZE to (1024*1024) resolved this. > After this, trying an update as above, did not give me an updated ubi > (which i check by booting to user space) and doing a nand erase.part > on ubi partition and then repeating the procedure results in ""Bad > Linux ARM zImage magic!". After looking a bit online, at the below > two links > > http://lists.denx.de/pipermail/u-boot/2013-May/155089.html > http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs > > I started trying ubinize. Getting the memory alignment issues again > now :). I have tried 1, 2, 4 and 8Mb for the dfu data buffer size. So > i am trying to figure this out at the moment. I am probably missing > something. :) On our boards we have eMMC memory, so I'm not so familiar with NAND DFU problems. However, I would advise you to pose this question to any of AM335x boards maintainer (e.g. Tom Rini) since they use NAND on their boards. > > --Best Regards, > Sanchayan. > > > > >> > >> Thanks again for your inputs. Cheers! > >> > >> Best Regards, > >> Sanchayan. > >> > >>> > >> Sorry if i am asking this question in the wrong place. I > >> couldn't find anyone in the u-boot IRC channel nor find > >> some