From bc62ffc14123c5db922c4174f9f8b4eda8fc9b98 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Fri, 15 May 2020 23:58:25 +0900 Subject: .gitignore: drop stale ignore pattern include/asm In old days, Linux created a symlink include/asm -> include/asm-*, but all the asm headers were moved to arch/*/include/asm, which is the same for Barebox too. Remove the bitrotten ignore pattern. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- include/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/include/.gitignore b/include/.gitignore index f28372a3df..18e58a752a 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -1,2 +1 @@ -asm /config.h -- cgit v1.2.3 From c251736e8f94442ec3bb04d437404229900a66d7 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 17 May 2020 21:14:39 +0900 Subject: arch: include from Many architectures duplicate the same fixed type definitions as in . Include from , and remove the duplicated code. Note: Linux commit 0c79a8e29b5f ("asm/types.h: Remove include/asm-generic/int-l64.h") unified the kernel space definition into int-ll64.h. Barebox also adopts int-ll64. Signed-off-by: Masahiro Yamada Signed-off-by: Sascha Hauer --- arch/arm/include/asm/types.h | 48 +----------------------- arch/nios2/include/asm/int-ll64.h | 78 --------------------------------------- arch/nios2/include/asm/types.h | 2 +- arch/openrisc/include/asm/types.h | 48 +----------------------- arch/powerpc/include/asm/types.h | 35 +----------------- arch/riscv/include/asm/types.h | 42 +-------------------- arch/sandbox/include/asm/types.h | 42 +-------------------- arch/x86/include/asm/types.h | 42 +-------------------- 8 files changed, 11 insertions(+), 326 deletions(-) delete mode 100644 arch/nios2/include/asm/int-ll64.h diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index 9c21066882..22b9642655 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -1,52 +1,6 @@ #ifndef __ASM_ARM_TYPES_H #define __ASM_ARM_TYPES_H -#ifndef __ASSEMBLY__ - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -#include - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ +#include #endif diff --git a/arch/nios2/include/asm/int-ll64.h b/arch/nios2/include/asm/int-ll64.h deleted file mode 100644 index f394147c07..0000000000 --- a/arch/nios2/include/asm/int-ll64.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * asm-generic/int-ll64.h - * - * Integer declarations for architectures which use "long long" - * for 64-bit types. - */ - -#ifndef _ASM_GENERIC_INT_LL64_H -#define _ASM_GENERIC_INT_LL64_H - -#include - -#ifndef __ASSEMBLY__ -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#ifdef __GNUC__ -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#else -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#define S8_C(x) x -#define U8_C(x) x ## U -#define S16_C(x) x -#define U16_C(x) x ## U -#define S32_C(x) x -#define U32_C(x) x ## U -#define S64_C(x) x ## LL -#define U64_C(x) x ## ULL - -#else /* __ASSEMBLY__ */ - -#define S8_C(x) x -#define U8_C(x) x -#define S16_C(x) x -#define U16_C(x) x -#define S32_C(x) x -#define U32_C(x) x -#define S64_C(x) x -#define U64_C(x) x - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_GENERIC_INT_LL64_H */ diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h index 0067ea83c1..380ad340c3 100644 --- a/arch/nios2/include/asm/types.h +++ b/arch/nios2/include/asm/types.h @@ -1,6 +1,6 @@ #ifndef __ASM_TYPES_H #define __ASM_TYPES_H -#include +#include #endif diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h index 8ee6bb00f9..21a45b74cd 100644 --- a/arch/openrisc/include/asm/types.h +++ b/arch/openrisc/include/asm/types.h @@ -16,52 +16,6 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H -/* - * This file is never included by application software unless - * explicitly requested (e.g., via linux/types.h) in which case the - * application is Linux specific so (user-) name space pollution is - * not a major issue. However, for interoperability, libraries still - * need to be careful to avoid a name clashes. - */ - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ +#include #endif /* _ASM_TYPES_H */ diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index 2d3ce0a283..f3d41905ca 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -1,45 +1,14 @@ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H -#ifndef __ASSEMBLY__ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; +#include -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif +#ifndef __ASSEMBLY__ typedef struct { __u32 u[4]; } __attribute((aligned(16))) vector128; -#ifdef __KERNEL__ -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/riscv/include/asm/types.h b/arch/riscv/include/asm/types.h index 8200a03349..af37d7738c 100644 --- a/arch/riscv/include/asm/types.h +++ b/arch/riscv/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_RISCV_TYPES_H #define __ASM_RISCV_TYPES_H +#include + #ifdef __riscv64 /* * This is used in dlmalloc. On RISCV64 we need it to be 64 bit @@ -15,44 +17,4 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif /* __ASM_RISCV_TYPES_H */ diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index 8426de4cc2..3e4a8f7ba3 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H +#include + #ifdef __x86_64__ /* * This is used in dlmalloc. On X86_64 we need it to be @@ -16,44 +18,4 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index e57ae2c8cf..17947b2ff3 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H +#include + #ifndef __ASSEMBLY__ #ifdef __x86_64__ @@ -18,46 +20,6 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif #endif -- cgit v1.2.3 From c31193cc31a352428c6bee93a013da193cf4c325 Mon Sep 17 00:00:00 2001 From: Robert Karszniewicz Date: Thu, 14 May 2020 15:04:21 +0200 Subject: ARM: dts: imx6: phycard: remove baseboard compatible This devicetree isn't baseboard-specific, so keep it compatible at SOM-level. Signed-off-by: Robert Karszniewicz Signed-off-by: Sascha Hauer --- arch/arm/dts/imx6q-phytec-phycard.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/imx6q-phytec-phycard.dts b/arch/arm/dts/imx6q-phytec-phycard.dts index c06461c2c7..b0e47e9b62 100644 --- a/arch/arm/dts/imx6q-phytec-phycard.dts +++ b/arch/arm/dts/imx6q-phytec-phycard.dts @@ -16,7 +16,7 @@ / { model = "PHYTEC phyCARD-i.MX6 Quad"; - compatible = "phytec,imx6q-pbaa03", "phytec,imx6q-pcaaxl3", "fsl,imx6q"; + compatible = "phytec,imx6q-pcaaxl3", "fsl,imx6q"; chosen { stdout-path = &uart3; -- cgit v1.2.3 From 202b6151d8737c11e4be0f9bc1f1146c02b9b930 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Sun, 17 May 2020 20:20:39 +0200 Subject: treewide: replace commas with semicolons where appropriate Found by searching drivers/ arch/ common/ and lib/ for /^\s+[^."/\*\[\s\{\(A-Z][^\[\{\(]*=[^\{\(]+,$/ Because the comma has the lowest precedence in C, this shouldn't result in any functional change. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 2 +- arch/arm/mach-imx/iim.c | 8 ++++---- arch/nios2/lib/libgcc.c | 21 +++++++++++---------- drivers/i2c/busses/i2c-imx-early.c | 2 +- drivers/i2c/busses/i2c-imx.c | 2 +- drivers/i2c/busses/i2c-omap.c | 2 +- drivers/mci/stm32_sdmmc2.c | 4 ++-- drivers/net/usb/usbnet.c | 10 +++++----- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c index 220a484bde..558bc07912 100644 --- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c +++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c @@ -242,7 +242,7 @@ static int eukrea_cpuimx35_core_init(void) reg = writel(reg, MX35_CCM_BASE_ADDR + MX35_CCM_CGR0); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_CGR1); reg |= 0x3 << MX35_CCM_CGR1_FEC_SHIFT; - reg |= 0x3 << MX35_CCM_CGR1_I2C1_SHIFT, + reg |= 0x3 << MX35_CCM_CGR1_I2C1_SHIFT; reg = writel(reg, MX35_CCM_BASE_ADDR + MX35_CCM_CGR1); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_CGR2); reg |= 0x3 << MX35_CCM_CGR2_USB_SHIFT; diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c index 207e1879c3..2f9ffbd271 100644 --- a/arch/arm/mach-imx/iim.c +++ b/arch/arm/mach-imx/iim.c @@ -329,10 +329,10 @@ static int imx_iim_add_bank(struct iim_priv *iim, int num, int nregs) iim->bank[num] = bank; - bank->map_config.reg_bits = 8, - bank->map_config.val_bits = 8, - bank->map_config.reg_stride = 1, - bank->map_config.max_register = (nregs - 1), + bank->map_config.reg_bits = 8; + bank->map_config.val_bits = 8; + bank->map_config.reg_stride = 1; + bank->map_config.max_register = (nregs - 1); bank->map_config.name = xasprintf("bank%d", num); bank->map = regmap_init(&iim->dev, &imx_iim_regmap_bus, bank, &bank->map_config); diff --git a/arch/nios2/lib/libgcc.c b/arch/nios2/lib/libgcc.c index abf93fdd71..814df73310 100644 --- a/arch/nios2/lib/libgcc.c +++ b/arch/nios2/lib/libgcc.c @@ -319,15 +319,15 @@ DWtype __divdi3(DWtype u, DWtype v) DWunion vv = {.ll = v}; DWtype w; - if (uu.s.high < 0) - c = ~c, - - uu.ll = -uu.ll; - - if (vv.s.high < 0) - c = ~c, + if (uu.s.high < 0) { + c = ~c; + uu.ll = -uu.ll; + } - vv.ll = -vv.ll; + if (vv.s.high < 0) { + c = ~c; + vv.ll = -vv.ll; + } w = __udivmoddi4(uu.ll, vv.ll, (UDWtype *) 0); @@ -366,9 +366,10 @@ DWtype __moddi3(DWtype u, DWtype v) DWunion vv = {.ll = v}; DWtype w; - if (uu.s.high < 0) - c = ~c, + if (uu.s.high < 0) { + c = ~c; uu.ll = -uu.ll; + } if (vv.s.high < 0) vv.ll = -vv.ll; diff --git a/drivers/i2c/busses/i2c-imx-early.c b/drivers/i2c/busses/i2c-imx-early.c index 26922c1044..472e4be83a 100644 --- a/drivers/i2c/busses/i2c-imx-early.c +++ b/drivers/i2c/busses/i2c-imx-early.c @@ -282,7 +282,7 @@ fail0: i2c_fsl_stop(fsl_i2c); /* Disable I2C controller, and force our state to stopped */ - temp = fsl_i2c->i2cr_ien_opcode ^ I2CR_IEN, + temp = fsl_i2c->i2cr_ien_opcode ^ I2CR_IEN; fsl_i2c_write_reg(temp, fsl_i2c, FSL_I2C_I2CR); return (ret < 0) ? ret : num; diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 6911f803b2..7d25ed3af5 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -511,7 +511,7 @@ fail0: i2c_fsl_stop(adapter); /* Disable I2C controller, and force our state to stopped */ - temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN, + temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN; fsl_i2c_write_reg(temp, i2c_fsl, FSL_I2C_I2CR); return (result < 0) ? result : num; diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index bdb34ca1b4..d3f525f333 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1176,7 +1176,7 @@ i2c_omap_probe(struct device_d *pdev) omap_i2c_idle(i2c_omap); - i2c_omap->adapter.master_xfer = omap_i2c_xfer, + i2c_omap->adapter.master_xfer = omap_i2c_xfer; i2c_omap->adapter.nr = pdev->id; i2c_omap->adapter.dev.parent = pdev; i2c_omap->adapter.dev.device_node = pdev->device_node; diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c index 3ce3bb0f89..da2dc592ad 100644 --- a/drivers/mci/stm32_sdmmc2.c +++ b/drivers/mci/stm32_sdmmc2.c @@ -586,8 +586,8 @@ static int stm32_sdmmc2_probe(struct amba_device *adev, priv->dev = dev; mci = &priv->mci; - mci->send_cmd = stm32_sdmmc2_send_cmd, - mci->set_ios = stm32_sdmmc2_set_ios, + mci->send_cmd = stm32_sdmmc2_send_cmd; + mci->set_ios = stm32_sdmmc2_set_ios; mci->init = stm32_sdmmc2_reset; mci->hw_dev = dev; diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 406b8c964f..7397034586 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -198,11 +198,11 @@ int usbnet_probe(struct usb_device *usbdev, const struct usb_device_id *prod) edev = &undev->edev; undev->udev = usbdev; - edev->open = usbnet_open, - edev->init = usbnet_init, - edev->send = usbnet_send, - edev->recv = usbnet_recv, - edev->halt = usbnet_halt, + edev->open = usbnet_open; + edev->init = usbnet_init; + edev->send = usbnet_send; + edev->recv = usbnet_recv; + edev->halt = usbnet_halt; edev->priv = undev; edev->parent = &usbdev->dev; -- cgit v1.2.3 From dc52abcc05f75b1edb04b71525c8c39bb61cb19f Mon Sep 17 00:00:00 2001 From: Robert Karszniewicz Date: Mon, 18 May 2020 12:37:35 +0200 Subject: blspec: Allow the "options" key to be given multiple times The Boot Loader Spec says: "This key is optional and may appear more than once in which case all specified parameters are used in the order they are listed." Signed-off-by: Robert Karszniewicz Signed-off-by: Sascha Hauer --- common/blspec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/blspec.c b/common/blspec.c index 1a6d581f5a..9e1036c834 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -298,6 +298,18 @@ static struct blspec_entry *blspec_entry_open(struct bootentries *bootentries, val = end; + if (!strcmp(name, "options")) { + /* If there was a previous "options" key given, prepend its value + * (as per spec). */ + const char *prev_val = blspec_entry_var_get(entry, name); + if (prev_val) { + char *opts = xasprintf("%s %s", prev_val, val); + blspec_entry_var_set(entry, name, opts); + free(opts); + continue; + } + } + blspec_entry_var_set(entry, name, val); } -- cgit v1.2.3 From 9baf73b9bc2891da06d9ca9fb19cc2fa457d5ad8 Mon Sep 17 00:00:00 2001 From: David Dgien Date: Tue, 19 May 2020 23:55:36 -0400 Subject: serial: Add flush function to NS16550 driver Add flush function to NS16550 to remove bad characters being printed during reset Signed-off-by: David Dgien Signed-off-by: Sascha Hauer --- drivers/serial/serial_ns16550.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 5d6cec82a4..f117ab9dc1 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -308,6 +308,17 @@ static int ns16550_tstc(struct console_device *cdev) return ((ns16550_read(cdev, lsr) & LSR_DR) != 0); } +/** + * @brief Flush remaining characters in serial device + * + * @param[in] cdev pointer to console device + */ +static void ns16550_flush(struct console_device *cdev) +{ + /* Loop Doing Nothing */ + while ((ns16550_read(cdev, lsr) & LSR_TEMT) == 0) ; +} + static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv) { struct device_node *np = dev->device_node; @@ -501,6 +512,7 @@ static int ns16550_probe(struct device_d *dev) cdev->putc = ns16550_putc; cdev->getc = ns16550_getc; cdev->setbrg = ns16550_setbaudrate; + cdev->flush = ns16550_flush; cdev->linux_console_name = devtype->linux_console_name; priv->fcrval = FCRVAL; -- cgit v1.2.3 From b5fae708273212bf67cda768d285a825ab3e94b7 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Wed, 20 May 2020 08:46:44 +0200 Subject: password: don't export read_default_passwd() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function is used only in common/password.c itself, so it doesn't need to be exported. Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- common/password.c | 1 - 1 file changed, 1 deletion(-) diff --git a/common/password.c b/common/password.c index a2a9c4cd6c..e5a333d9b1 100644 --- a/common/password.c +++ b/common/password.c @@ -179,7 +179,6 @@ static int read_default_passwd(unsigned char *sum, size_t length) return 0; } -EXPORT_SYMBOL(read_default_passwd); static int read_env_passwd(unsigned char *sum, size_t length) { -- cgit v1.2.3 From 4a35f8894492883da0eba1e41c02979e350c02fa Mon Sep 17 00:00:00 2001 From: David Dgien Date: Fri, 22 May 2020 20:51:56 -0400 Subject: password: Fix warning with empty default password When CONFIG_PASSWORD_DEFAULT is unset, the default_passwd buffer is set to the empty string. The read_default_passwd() function wants to read at least two characters from that buffer, causing GCC to generate an array bounds warning: barebox/common/password.c: In function 'login': barebox/common/password.c:173:5: warning: array subscript [1, 2147483647] is outside array bounds of 'const char[1]' [-Warray-bounds] In file included from barebox/common/password.c:30: include/generated/passwd.h:1:19: note: while referencing 'default_passwd' Add an ARRAY_SIZE check to default_passwd so that the loop is optimized away and the warning is no longer generated. Since the read_default_passwd() function is only called when default_passwd is not the empty string, this is not a functional change. Signed-off-by: David Dgien Signed-off-by: Sascha Hauer --- common/password.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/password.c b/common/password.c index e5a333d9b1..3c08ab782e 100644 --- a/common/password.c +++ b/common/password.c @@ -161,6 +161,9 @@ static int read_default_passwd(unsigned char *sum, size_t length) unsigned char *buf = (unsigned char *)default_passwd; unsigned char c; + if (ARRAY_SIZE(default_passwd) == 1) + return -ENOSYS; + if (!sum || length < 1) return -EINVAL; -- cgit v1.2.3 From 1bdc070a8564eab9aa2d31815a788b7a644835a1 Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Fri, 29 May 2020 14:51:02 +0200 Subject: serial: amba-pl011: set linux_console_name We set the linux_console_name so for this uart the linux.bootargs.console will be properly set. Signed-off-by: Michael Grzeschik Signed-off-by: Sascha Hauer --- drivers/serial/amba-pl011.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 0751c52513..865ecdddb2 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -204,6 +204,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) cdev->putc = pl011_putc; cdev->getc = pl011_getc; cdev->setbrg = pl011_setbaudrate; + cdev->linux_console_name = "ttyAMA"; pl011_init_port(cdev); -- cgit v1.2.3 From fa07f30fc4d3624f22f67c01c6ad684b4c042a91 Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Fri, 29 May 2020 14:51:12 +0200 Subject: serial: stm: set linux_console_name We set the linux_console_name so for this uart the linux.bootargs.console will be properly set. Signed-off-by: Michael Grzeschik Signed-off-by: Sascha Hauer --- drivers/serial/stm-serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c index ea482415ce..a2c3dcf56e 100644 --- a/drivers/serial/stm-serial.c +++ b/drivers/serial/stm-serial.c @@ -159,6 +159,7 @@ static int stm_serial_probe(struct device_d *dev) cdev->flush = stm_serial_flush; cdev->setbrg = stm_serial_setbaudrate; cdev->dev = dev; + cdev->linux_console_name = "ttyAMA"; dev->priv = priv; iores = dev_request_mem_resource(dev, 0); -- cgit v1.2.3 From 9ee75cdd59e05e407af2eef9fec63de2418334e6 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 2 Jun 2020 10:50:52 +0200 Subject: scripts: .gitignore: ignore mvebuimg binary If selected, we generate a mvebuimg binary that should be ignored by version control. Add .gitignore entry to do so. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- scripts/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/.gitignore b/scripts/.gitignore index c3ac0b5702..7c9a3f5571 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -31,3 +31,4 @@ omap3-usb-loader mips-relocs rsatoc stm32image +mvebuimg -- cgit v1.2.3 From 1b57c7381c781e3cf39a10a2a01ce8e1fe5aca66 Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Wed, 3 Jun 2020 09:58:45 +0300 Subject: logo: Makefile: make it possible to use inkscape 1.0 Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- lib/logo/Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/logo/Makefile b/lib/logo/Makefile index eb7aee080e..bf700da89b 100644 --- a/lib/logo/Makefile +++ b/lib/logo/Makefile @@ -1,17 +1,17 @@ -OPTS_barebox-logo-w64.bblogo="-w 64" +OPTS_barebox-logo-w64.bblogo = --export-width=64 bblogo-$(CONFIG_BAREBOX_LOGO_64) += barebox-logo-w64 -OPTS_barebox-logo-w240.bblogo="-w 240" +OPTS_barebox-logo-w240.bblogo = --export-width=240 bblogo-$(CONFIG_BAREBOX_LOGO_240) += barebox-logo-w240 -OPTS_barebox-logo-w320.bblogo="-w 320" +OPTS_barebox-logo-w320.bblogo = --export-width=320 bblogo-$(CONFIG_BAREBOX_LOGO_320) += barebox-logo-w320 -OPTS_barebox-logo-w400.bblogo="-w 400" +OPTS_barebox-logo-w400.bblogo = --export-width=400 bblogo-$(CONFIG_BAREBOX_LOGO_400) += barebox-logo-w400 -OPTS_barebox-logo-w640.bblogo="-w 640" +OPTS_barebox-logo-w640.bblogo = --export-width=640 bblogo-$(CONFIG_BAREBOX_LOGO_640) += barebox-logo-w640 obj-y += $(patsubst %,%.bblogo.o,$(bblogo-y)) @@ -38,10 +38,17 @@ cmd_logo_S = \ %.bblogo.S: %.bblogo FORCE $(call if_changed,logo_S) +# Inkscape 0.92.4 supports -z but Inkscape 1.0 doesn't +INKSCAPEOPTS += $(call try-run, inkscape -z,-z,) +# Inkscape 0.92.4 uses -e but Inkscape 1.0 uses --export-type=png +INKSCAPEOPTS += $(call try-run, inkscape -e -,-e -,--export-type=png) +# Inkscape 1.0 supports -o - +INKSCAPEOPTS += $(call try-run, inkscape -o -,-o -,) + quiet_cmd_logo = LOGO.S $@ cmd_logo = \ ( \ - inkscape -z $(OPTS_$(@F)) -e $@ $< > /dev/null; \ + DISPLAY="" inkscape $(OPTS_$(@F)) $(INKSCAPEOPTS) $< > $@; \ ) %.bblogo: $(srctree)/Documentation/barebox.svg FORCE -- cgit v1.2.3 From c0f0cbd1759a6ca6cbda4001dff5764f6633c825 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 3 Jun 2020 09:50:40 +0200 Subject: nfs: Fix out of bounds read nfs_read_reply() interprets the fields of an incoming packet directly as a field length without checking the boundaries. Clamp the maximum length to the packet length to avoid reading out of bounds. Reported-by: Jai Verma Signed-off-by: Sascha Hauer --- net/nfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/nfs.c b/net/nfs.c index 63573098d7..591417e0de 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -533,7 +533,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) static int nfs_read_reply(unsigned char *pkt, unsigned len) { - int rlen; + unsigned int rlen; uint32_t *data; int ret; @@ -552,6 +552,8 @@ static int nfs_read_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data + 18)); + rlen = max_t(unsigned int, rlen, len - 19); + ret = write(net_store_fd, (char *)(data + 19), rlen); if (ret < 0) { perror("write"); -- cgit v1.2.3 From 34d18aaa2a47522a8b607fb2e61c79f5b10ecb9a Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Wed, 3 Jun 2020 09:20:32 +0300 Subject: MIPS: correctly work with disabled CONFIG_MMU There are some issues with CONFIG_MMU=n in MIPS configuration (e.g. qemu-malta_defconfig): * "Cannot request SDRAM region for stack" error message on start; * empty kseg1_ram0 region in the iomem command output. The patch fixes the problems by forcing KSEG1 memory region usage for CONFIG_MMU=n MIPS configurations. Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/mips/include/asm/io.h | 6 +++++- arch/mips/lib/reloc.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index c155199430..4df9853680 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -39,7 +39,11 @@ static inline unsigned long virt_to_phys(const void *address) */ static inline void *phys_to_virt(unsigned long address) { - return (void *)CKSEG0ADDR(address); + if (IS_ENABLED(CONFIG_MMU)) { + return (void *)CKSEG0ADDR(address); + } + + return (void *)CKSEG1ADDR(address); } #define IO_SPACE_LIMIT 0 diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c index 4b0e252352..b084a88be7 100644 --- a/arch/mips/lib/reloc.c +++ b/arch/mips/lib/reloc.c @@ -120,7 +120,11 @@ void relocate_code(void *fdt, u32 fdt_size, u32 ram_size) length = __bss_stop - __image_start; relocaddr = ALIGN_DOWN(ram_size - length, SZ_64K); - relocaddr = KSEG0ADDR(relocaddr); + if (IS_ENABLED(CONFIG_MMU)) { + relocaddr = KSEG0ADDR(relocaddr); + } else { + relocaddr = KSEG1ADDR(relocaddr); + } new_stack = relocaddr - MALLOC_SIZE - 16; /* -- cgit v1.2.3