summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-11-10 15:07:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-11-10 15:07:31 +0100
commit0b0eada569b198aa3882cfec5874bc35a8a0fa14 (patch)
tree061ca4528bfaee38df3faae6ff1a6be6d4993fe6
parent34ea8b9317afad6ed2cb702c911cbcbad9d3bf23 (diff)
parent706ef1bf6fed8dd2c75c469ad4bc758da2cb4cf3 (diff)
downloadbarebox-0b0eada569b198aa3882cfec5874bc35a8a0fa14.tar.gz
barebox-0b0eada569b198aa3882cfec5874bc35a8a0fa14.tar.xz
Merge branch 'for-next/misc'
-rw-r--r--arch/arm/cpu/Kconfig1
-rw-r--r--arch/arm/cpu/mmu_64.c13
-rw-r--r--arch/arm/mach-imx/include/mach/clock-imx6.h19
-rw-r--r--arch/arm/mach-imx/include/mach/iim.h16
-rw-r--r--arch/arm/mach-imx/include/mach/imx-ipu-fb.h10
-rw-r--r--arch/arm/mach-imx/include/mach/imx25-regs.h16
-rw-r--r--arch/arm/mach-imx/include/mach/imx31-regs.h16
-rw-r--r--arch/arm/mach-imx/include/mach/imx35-regs.h16
-rw-r--r--arch/arm/mach-imx/include/mach/imx6-anadig.h19
-rw-r--r--arch/arm/mach-imx/include/mach/imx6-ddr-regs.h15
-rw-r--r--arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h15
-rw-r--r--arch/arm/mach-imx/include/mach/imx6q-ddr-regs.h15
-rw-r--r--arch/arm/mach-imx/include/mach/imx7-ddr-regs.h14
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx21.h15
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx27.h18
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx2x.h18
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx31.h18
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx35.h15
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx50.h24
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx53.h19
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-mx6.h23
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-v3.h16
-rw-r--r--arch/sandbox/configs/hosttools_defconfig1
-rw-r--r--arch/x86/configs/efi_defconfig18
-rw-r--r--commands/Kconfig30
-rw-r--r--commands/Makefile1
-rw-r--r--commands/i2c.c6
-rw-r--r--commands/memtester/Makefile1
-rw-r--r--commands/memtester/memtester.c274
-rw-r--r--commands/memtester/memtester.h21
-rw-r--r--commands/memtester/sizes.h35
-rw-r--r--commands/memtester/tests.c495
-rw-r--r--commands/memtester/tests.h36
-rw-r--r--commands/memtester/types.h35
-rw-r--r--common/uimage.c21
-rw-r--r--drivers/mci/stm32_sdmmc2.c7
-rw-r--r--drivers/mfd/mc34704.c4
-rw-r--r--drivers/mtd/nand/nand_imx.c15
-rw-r--r--drivers/net/macb.c55
-rw-r--r--drivers/of/base.c3
-rw-r--r--fs/nfs.c124
-rw-r--r--include/zero_page.h54
-rw-r--r--lib/Kconfig3
-rw-r--r--net/eth.c17
-rw-r--r--net/ifup.c20
-rw-r--r--net/lib.c24
-rw-r--r--net/net.c24
-rw-r--r--net/netconsole.c19
-rw-r--r--net/nfs.h10
-rw-r--r--net/rarp.h18
-rw-r--r--net/sntp.c11
-rw-r--r--scripts/Kconfig9
-rw-r--r--scripts/Makefile2
53 files changed, 1290 insertions, 454 deletions
diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index f9f52a6252..ca3bd98962 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -89,6 +89,7 @@ config CPU_V8
select ARM_EXCEPTIONS
select GENERIC_FIND_NEXT_BIT
select ARCH_HAS_STACK_DUMP
+ select ARCH_HAS_ZERO_PAGE
config CPU_XSC3
bool
diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c
index 7e9ae84810..06049e0003 100644
--- a/arch/arm/cpu/mmu_64.c
+++ b/arch/arm/cpu/mmu_64.c
@@ -10,6 +10,7 @@
#include <init.h>
#include <mmu.h>
#include <errno.h>
+#include <zero_page.h>
#include <linux/sizes.h>
#include <asm/memory.h>
#include <asm/pgtable64.h>
@@ -168,6 +169,16 @@ static void mmu_enable(void)
set_cr(get_cr() | CR_M | CR_C | CR_I);
}
+void zero_page_access(void)
+{
+ create_sections(0x0, 0x0, PAGE_SIZE, CACHED_MEM);
+}
+
+void zero_page_faulting(void)
+{
+ create_sections(0x0, 0x0, PAGE_SIZE, 0x0);
+}
+
/*
* Prepare MMU for usage enable it.
*/
@@ -194,7 +205,7 @@ void __mmu_init(bool mmu_on)
create_sections(bank->start, bank->start, bank->size, CACHED_MEM);
/* Make zero page faulting to catch NULL pointer derefs */
- create_sections(0x0, 0x0, 0x1000, 0x0);
+ zero_page_faulting();
mmu_enable();
}
diff --git a/arch/arm/mach-imx/include/mach/clock-imx6.h b/arch/arm/mach-imx/include/mach/clock-imx6.h
index 8e5e9d92b0..69fbedd51e 100644
--- a/arch/arm/mach-imx/include/mach/clock-imx6.h
+++ b/arch/arm/mach-imx/include/mach/clock-imx6.h
@@ -1,20 +1,5 @@
-/*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2010-2011 Freescale Semiconductor, Inc. */
#ifndef __ARCH_ARM_MACH_MX6_CRM_REGS_H__
#define __ARCH_ARM_MACH_MX6_CRM_REGS_H__
diff --git a/arch/arm/mach-imx/include/mach/iim.h b/arch/arm/mach-imx/include/mach/iim.h
index cc89b0d109..3199e4e790 100644
--- a/arch/arm/mach-imx/include/mach/iim.h
+++ b/arch/arm/mach-imx/include/mach/iim.h
@@ -1,17 +1,5 @@
-/*
- * (c) 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix */
#ifndef __MACH_IMX_IIM_H
#define __MACH_IMX_IIM_H
diff --git a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
index 73028d26cf..651bf9a5c9 100644
--- a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
+++ b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
@@ -1,11 +1,5 @@
-/*
- * Copyright (C) 2008
- * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2008 Guennadi Liakhovetski <lg@denx.de>, DENX Software Engineering */
#ifndef __MACH_IMX_IPU_FB_H__
#define __MACH_IMX_IPU_FB_H__
diff --git a/arch/arm/mach-imx/include/mach/imx25-regs.h b/arch/arm/mach-imx/include/mach/imx25-regs.h
index a5754c57db..d63669e1e0 100644
--- a/arch/arm/mach-imx/include/mach/imx25-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx25-regs.h
@@ -1,17 +1,5 @@
-/*
- * (c) 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2009 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix */
#ifndef __ASM_ARCH_MX25_REGS_H
#define __ASM_ARCH_MX25_REGS_H
diff --git a/arch/arm/mach-imx/include/mach/imx31-regs.h b/arch/arm/mach-imx/include/mach/imx31-regs.h
index 3d6c91c503..56c518c120 100644
--- a/arch/arm/mach-imx/include/mach/imx31-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx31-regs.h
@@ -1,17 +1,5 @@
-/*
- * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix */
#ifndef __ASM_ARCH_MX31_REGS_H
#define __ASM_ARCH_MX31_REGS_H
diff --git a/arch/arm/mach-imx/include/mach/imx35-regs.h b/arch/arm/mach-imx/include/mach/imx35-regs.h
index 0a3f9273c7..4a4aa754aa 100644
--- a/arch/arm/mach-imx/include/mach/imx35-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx35-regs.h
@@ -1,17 +1,5 @@
-/*
- * (c) 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2009 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix */
#ifndef __ASM_ARCH_MX35_REGS_H
#define __ASM_ARCH_MX35_REGS_H
diff --git a/arch/arm/mach-imx/include/mach/imx6-anadig.h b/arch/arm/mach-imx/include/mach/imx6-anadig.h
index 65a7dbda4c..38f4ad7351 100644
--- a/arch/arm/mach-imx/include/mach/imx6-anadig.h
+++ b/arch/arm/mach-imx/include/mach/imx6-anadig.h
@@ -1,18 +1,7 @@
-/*
- * Freescale ANADIG Register Definitions
- *
- * Copyright 2008-2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2008-2011 Freescale Semiconductor, Inc. */
+
+/* Freescale ANADIG Register Definitions */
#ifndef __ARCH_ARM___ANADIG_H
#define __ARCH_ARM___ANADIG_H
diff --git a/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h b/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h
index 39b3b55bb2..f10902cec2 100644
--- a/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h
@@ -1,16 +1,5 @@
-/*
- * Copyright (C) 2013 Boundary Devices Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2013 Boundary Devices Inc. */
#define MX6_MMDC_P0_MDCTL 0x021b0000
#define MX6_MMDC_P0_MDPDC 0x021b0004
diff --git a/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h b/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h
index a312e63a99..9e5764276f 100644
--- a/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h
@@ -1,16 +1,5 @@
-/*
- * Copyright (C) 2013 Boundary Devices Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2013 Boundary Devices Inc. */
#define MX6_IOM_DRAM_ADDR00 0x020e0424
#define MX6_IOM_DRAM_ADDR01 0x020e0428
diff --git a/arch/arm/mach-imx/include/mach/imx6q-ddr-regs.h b/arch/arm/mach-imx/include/mach/imx6q-ddr-regs.h
index f910574370..3f20b95091 100644
--- a/arch/arm/mach-imx/include/mach/imx6q-ddr-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx6q-ddr-regs.h
@@ -1,16 +1,5 @@
-/*
- * Copyright (C) 2013 Boundary Devices Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2013 Boundary Devices Inc. */
#define MX6_IOM_DRAM_DQM0 0x020e05ac
#define MX6_IOM_DRAM_DQM1 0x020e05b4
diff --git a/arch/arm/mach-imx/include/mach/imx7-ddr-regs.h b/arch/arm/mach-imx/include/mach/imx7-ddr-regs.h
index e66b2da11e..3ff690608a 100644
--- a/arch/arm/mach-imx/include/mach/imx7-ddr-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx7-ddr-regs.h
@@ -1,15 +1,5 @@
-/*
- * Copyright (C) 2017 Pengutronix, Fridolin Tux <kernel@pengutronix.de>
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* SPDX-FileCopyrightText: 2017 Uwe Kleine-K├Ânig <u.kleine-koenig@pengutronix.de>, Pengutronix */
#define MX7_DDRC_MSTR 0x307a0000
#define MX7_DDRC_STAT 0x307a0004
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx21.h b/arch/arm/mach-imx/include/mach/iomux-mx21.h
index 203190d1d7..308bfac99b 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx21.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx21.h
@@ -1,15 +1,6 @@
-/*
- * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2009 Holger Schurig <hs4233@mail.mn-solutions.de> */
+
#ifndef __MACH_IOMUX_MX21_H__
#define __MACH_IOMUX_MX21_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx27.h b/arch/arm/mach-imx/include/mach/iomux-mx27.h
index b6e334559d..5f8a3826f6 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx27.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx27.h
@@ -1,17 +1,7 @@
-/*
- * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
- * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2008 Sascha Hauer <kernel@pengutronix.de> */
+/* SPDX-FileCopyrightText: 2009 Holger Schurig <hs4233@mail.mn-solutions.de> */
+
#ifndef __MACH_IOMUX_MX27_H__
#define __MACH_IOMUX_MX27_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx2x.h b/arch/arm/mach-imx/include/mach/iomux-mx2x.h
index 15c2e2b060..64f07c0c33 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx2x.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx2x.h
@@ -1,17 +1,7 @@
-/*
- * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
- * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2008 Sascha Hauer <kernel@pengutronix.de> */
+/* SPDX-FileCopyrightText: 2009 Holger Schurig <hs4233@mail.mn-solutions.de> */
+
#ifndef __MACH_IOMUX_MX2x_H__
#define __MACH_IOMUX_MX2x_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx31.h b/arch/arm/mach-imx/include/mach/iomux-mx31.h
index c814c15912..d524125a85 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx31.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx31.h
@@ -1,17 +1,7 @@
-/*
- * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2004-2006 Freescale Semiconductor, Inc. */
+/* SPDX-FileCopyrightText: 2008 Sascha Hauer <kernel@pengutronix.de> */
+
#ifndef __MACH_IOMUX_MX3_H__
#define __MACH_IOMUX_MX3_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx35.h b/arch/arm/mach-imx/include/mach/iomux-mx35.h
index 30b94e3b00..18f9a11171 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx35.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx35.h
@@ -1,16 +1,5 @@
-/*
- * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option, NO_PAD_CTRL) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2009 Jan Weitzel <armlinux@phytec.de>, Phytec Messtechnik GmbH */
#ifndef __MACH_IOMUX_MX35_H__
#define __MACH_IOMUX_MX35_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx50.h b/arch/arm/mach-imx/include/mach/iomux-mx50.h
index c21bb3ea9b..aeb47092df 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx50.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx50.h
@@ -1,22 +1,8 @@
-/*
- * Copyright 2013 Greg Ungerer <gerg@uclinux.org>
- * Copyright 2016 Alexander Kurz <akurz@blala.de>
- * based on linux imx50-pinfunc.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc..
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2013 Greg Ungerer <gerg@uclinux.org> */
+/* SPDX-FileCopyrightText: 2016 Alexander Kurz <akurz@blala.de> */
+
+/* based on linux imx50-pinfunc.h */
#ifndef __MACH_IOMUX_MX50_H__
#define __MACH_IOMUX_MX50_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx53.h b/arch/arm/mach-imx/include/mach/iomux-mx53.h
index 527f8fe3e3..010fb6e5cc 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx53.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx53.h
@@ -1,20 +1,5 @@
-/*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc..
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2010-2011 Freescale Semiconductor, Inc. */
#ifndef __MACH_IOMUX_MX53_H__
#define __MACH_IOMUX_MX53_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-mx6.h b/arch/arm/mach-imx/include/mach/iomux-mx6.h
index 57d1a3bf9f..36e31e0657 100644
--- a/arch/arm/mach-imx/include/mach/iomux-mx6.h
+++ b/arch/arm/mach-imx/include/mach/iomux-mx6.h
@@ -1,23 +1,6 @@
-/*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Auto Generate file, please don't edit it
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2011 Freescale Semiconductor, Inc. */
+
#define MUX_PAD_CTRL(x) ((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
#ifndef __MACH_IOMUX_MX6Q_H__
diff --git a/arch/arm/mach-imx/include/mach/iomux-v3.h b/arch/arm/mach-imx/include/mach/iomux-v3.h
index d1a72a2cf5..e1d62ae4b8 100644
--- a/arch/arm/mach-imx/include/mach/iomux-v3.h
+++ b/arch/arm/mach-imx/include/mach/iomux-v3.h
@@ -1,17 +1,5 @@
-/*
- * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
- * <armlinux@phytec.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2009 Jan Weitzel <armlinux@phytec.de>, Phytec Messtechnik GmbH */
#ifndef __MACH_IOMUX_V3_H__
#define __MACH_IOMUX_V3_H__
diff --git a/arch/sandbox/configs/hosttools_defconfig b/arch/sandbox/configs/hosttools_defconfig
index 72ec0fc462..7d33853124 100644
--- a/arch/sandbox/configs/hosttools_defconfig
+++ b/arch/sandbox/configs/hosttools_defconfig
@@ -2,6 +2,5 @@ CONFIG_IMD=y
CONFIG_COMPILE_HOST_TOOLS=y
CONFIG_ARCH_IMX_USBLOADER=y
CONFIG_MVEBU_HOSTTOOLS=y
-CONFIG_MXS_HOSTTOOLS=y
CONFIG_OMAP3_USB_LOADER=y
CONFIG_OMAP4_HOSTTOOL_USBBOOT=y
diff --git a/arch/x86/configs/efi_defconfig b/arch/x86/configs/efi_defconfig
index 83794d7a07..761ffbe261 100644
--- a/arch/x86/configs/efi_defconfig
+++ b/arch/x86/configs/efi_defconfig
@@ -15,14 +15,19 @@ CONFIG_CONSOLE_ACTIVATE_ALL=y
CONFIG_PARTITION_DISK_EFI=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
CONFIG_STATE=y
+CONFIG_BOOTCHOOSER=y
+CONFIG_RESET_SOURCE=y
CONFIG_DEBUG_LL=y
+CONFIG_CMD_DMESG=y
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
+CONFIG_CMD_IMD=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_GO=y
CONFIG_CMD_LOADB=y
CONFIG_CMD_RESET=y
CONFIG_CMD_UIMAGE=y
+CONFIG_CMD_BOOTCHOOSER=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_EXPORT=y
CONFIG_CMD_LOADENV=y
@@ -56,6 +61,7 @@ CONFIG_CMD_POWEROFF=y
CONFIG_CMD_WD=y
CONFIG_CMD_2048=y
CONFIG_CMD_BAREBOX_UPDATE=y
+CONFIG_CMD_OF_DIFF=y
CONFIG_CMD_OF_NODE=y
CONFIG_CMD_OF_PROPERTY=y
CONFIG_CMD_OFTREE=y
@@ -64,12 +70,24 @@ CONFIG_CMD_STATE=y
CONFIG_NET=y
CONFIG_NET_NFS=y
CONFIG_NET_NETCONSOLE=y
+CONFIG_OFDEVICE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+CONFIG_OF_BAREBOX_ENV_IN_FS=y
CONFIG_DRIVER_SERIAL_EFI_STDIO=y
CONFIG_DRIVER_NET_EFI_SNP=y
# CONFIG_SPI is not set
CONFIG_DISK=y
+CONFIG_DISK_WRITE=y
+CONFIG_VIDEO=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_DRIVER_VIDEO_EFI_GOP=y
+CONFIG_FINTEK_SUPERIO=y
+CONFIG_SMSC_SUPERIO=y
+CONFIG_STATE_DRV=y
CONFIG_WATCHDOG=y
CONFIG_WATCHDOG_EFI=y
+CONFIG_F71808E_WDT=y
+# CONFIG_PINCTRL is not set
CONFIG_FS_EXT4=y
CONFIG_FS_TFTP=y
CONFIG_FS_NFS=y
diff --git a/commands/Kconfig b/commands/Kconfig
index df18715f20..8b4ed9aa53 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -498,6 +498,23 @@ config CMD_UIMAGE
-e OUTFILE extract image to OUTFILE
-n NO use image number NO in multifile image
+config CMD_BOOTCHOOSER
+ tristate
+ depends on BOOTCHOOSER
+ prompt "bootchooser control utility"
+ help
+ Control misc behaviour of the bootchooser
+
+ Options:
+ -a <n|default> [TARGETS]
+ set remaining attempts of given targets to 'n' or the default attempts
+ -p <n|default> [TARGETS]
+ set priority of given targets to 'n' or the default priority
+ -i
+ Show information about the bootchooser
+ -s
+ Mark the last boot successful
+
# end Boot commands
endmenu
@@ -1611,6 +1628,14 @@ config CMD_MEMTEST
-i ITERATIONS perform number of iterations (default 1, 0 is endless)
-b perform only a test on bus lines
+config CMD_MEMTESTER
+ tristate
+ prompt "memtester"
+ help
+ Utility for testing the memory subsystem.
+
+ Homepage: http://pyropus.ca/software/memtester/
+
config CMD_MM
tristate
select DEV_MEM
@@ -2179,11 +2204,6 @@ config CMD_STATE
depends on STATE
prompt "state"
-config CMD_BOOTCHOOSER
- tristate
- depends on BOOTCHOOSER
- prompt "bootchooser"
-
config CMD_DHRYSTONE
bool
prompt "dhrystone"
diff --git a/commands/Makefile b/commands/Makefile
index 6cc4997cc5..dc285cd00e 100644
--- a/commands/Makefile
+++ b/commands/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_CMD_LOADENV) += loadenv.o
obj-$(CONFIG_CMD_NAND) += nand.o
obj-$(CONFIG_CMD_NANDTEST) += nandtest.o
obj-$(CONFIG_CMD_MEMTEST) += memtest.o
+obj-$(CONFIG_CMD_MEMTESTER) += memtester/
obj-$(CONFIG_CMD_TRUE) += true.o
obj-$(CONFIG_CMD_FALSE) += false.o
obj-$(CONFIG_CMD_VERSION) += version.o
diff --git a/commands/i2c.c b/commands/i2c.c
index 53f36dfaab..997d49a949 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -16,10 +16,12 @@ static void i2c_probe_range(struct i2c_adapter *adapter, int startaddr, int stop
printf("probing i2c%d range 0x%02x-0x%02x: ", adapter->nr, startaddr, stopaddr);
for (addr = startaddr; addr <= stopaddr && !ctrlc(); addr++) {
+ u8 buf[1];
struct i2c_msg msg = {
.addr = addr,
- .buf = NULL,
- .len = 0,
+ .buf = buf,
+ .len = sizeof(buf),
+ .flags = I2C_M_RD,
};
int ret = i2c_transfer(adapter, &msg, 1);
if (ret == 1)
diff --git a/commands/memtester/Makefile b/commands/memtester/Makefile
new file mode 100644
index 0000000000..17a2429276
--- /dev/null
+++ b/commands/memtester/Makefile
@@ -0,0 +1 @@
+obj-y += tests.o memtester.o
diff --git a/commands/memtester/memtester.c b/commands/memtester/memtester.c
new file mode 100644
index 0000000000..8b64d32329
--- /dev/null
+++ b/commands/memtester/memtester.c
@@ -0,0 +1,274 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * memtester version 4
+ *
+ * Very simple but very effective user-space memory tester.
+ * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
+ * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
+ * Version 3 not publicly released.
+ * Version 4 rewrite:
+ * Copyright (C) 2004-2012 Charles Cazabon <charlesc-memtester@pyropus.ca>
+ *
+ */
+
+#define __version__ "4.3.0"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+#include <common.h>
+#include <command.h>
+#include <environment.h>
+#include <fs.h>
+
+#include "types.h"
+#include "sizes.h"
+#include "tests.h"
+
+#define EXIT_FAIL_NONSTARTER COMMAND_ERROR
+#define EXIT_FAIL_ADDRESSLINES 0x02
+#define EXIT_FAIL_OTHERTEST 0x04
+
+static struct test tests[] = {
+ { "Random Value", test_random_value },
+ { "Compare XOR", test_xor_comparison },
+ { "Compare SUB", test_sub_comparison },
+ { "Compare MUL", test_mul_comparison },
+ { "Compare DIV",test_div_comparison },
+ { "Compare OR", test_or_comparison },
+ { "Compare AND", test_and_comparison },
+ { "Sequential Increment", test_seqinc_comparison },
+ { "Solid Bits", test_solidbits_comparison },
+ { "Block Sequential", test_blockseq_comparison },
+ { "Checkerboard", test_checkerboard_comparison },
+ { "Bit Spread", test_bitspread_comparison },
+ { "Bit Flip", test_bitflip_comparison },
+ { "Walking Ones", test_walkbits1_comparison },
+ { "Walking Zeroes", test_walkbits0_comparison },
+ { "8-bit Writes", test_8bit_wide_random },
+ { "16-bit Writes", test_16bit_wide_random },
+ { NULL, NULL }
+};
+
+/* Function declarations */
+
+/* Global vars - so tests have access to this information */
+int memtester_use_phys;
+off_t memtester_physaddrbase;
+
+static int do_memtester(int argc, char **argv) {
+ ul loops, loop, i;
+ size_t wantmb, wantbytes, bufsize,
+ halflen, count;
+ void *buf, *aligned;
+ ulv *bufa, *bufb;
+ int exit_code = 0, ret;
+ int memfd = 0, opt;
+ size_t maxbytes = -1; /* addressable memory, in bytes */
+ size_t maxmb = (maxbytes >> 20) + 1; /* addressable memory, in MB */
+ /* Device to mmap memory from with -p, default is normal core */
+ char *device_name = "/dev/mem";
+ struct stat statbuf;
+ int device_specified = 0;
+ ul testmask = 0;
+
+ memtester_use_phys = 0;
+ memtester_physaddrbase = 0;
+
+ printf("memtester version " __version__ " (%d-bit)\n", UL_LEN);
+ printf("Copyright (C) 2001-2012 Charles Cazabon.\n");
+ printf("Licensed under the GNU General Public License version 2 (only).\n");
+ printf("\n");
+
+ while ((opt = getopt(argc, argv, "p:d:m:")) != -1) {
+ ull t;
+
+ switch (opt) {
+ case 'm':
+ if (kstrtoul(optarg, 0, &testmask)) {
+ printf("error parsing MEMTESTER_TEST_MASK %s: %s\n",
+ optarg, strerror(errno));
+ return COMMAND_ERROR_USAGE;
+ }
+ printf("using testmask 0x%lx\n", testmask);
+ break;
+ case 'p':
+ if (kstrtoull(optarg, 0, &t)) {
+ printf("failed to parse physaddrbase arg; should be hex "
+ "address (0x123...)\n");
+ return COMMAND_ERROR_USAGE;
+ }
+ memtester_physaddrbase = (off_t)t;
+ memtester_use_phys = 1;
+ break;
+ case 'd':
+ if (stat(optarg,&statbuf)) {
+ printf("can not use %s as device: %s\n", optarg,
+ strerror(errno));
+ return COMMAND_ERROR_USAGE;
+ } else {
+ if (!S_ISCHR(statbuf.st_mode)) {
+ printf("can not mmap non-char device %s\n",
+ optarg);
+ return COMMAND_ERROR_USAGE;
+ } else {
+ device_name = optarg;
+ device_specified = 1;
+ }
+ }
+ break;
+ default: /* '?' */
+ return COMMAND_ERROR_USAGE;
+ }
+ }
+ if (device_specified && !memtester_use_phys) {
+ printf("for mem device, physaddrbase (-p) must be specified\n");
+ return COMMAND_ERROR_USAGE;
+ }
+
+ if (optind >= argc) {
+ printf("need memory argument, in MB\n");
+ return COMMAND_ERROR_USAGE;
+ }
+
+ wantbytes = (size_t) strtoull_suffix(argv[optind], 0, 0);
+ if (wantbytes < 2 * sizeof(ul)) {
+ printf("need at least %ldB of memory to test\n", 2 * sizeof(ul));
+ return COMMAND_ERROR_USAGE;
+ }
+ wantmb = (wantbytes >> 20);
+ optind++;
+ if (wantmb > maxmb) {
+ printf("This system can only address %llu MB.\n", (ull) maxmb);
+ return EXIT_FAIL_NONSTARTER;
+ }
+
+ if (optind >= argc) {
+ loops = 0;
+ } else {
+ if (kstrtoul(argv[optind], 0, &loops)) {
+ printf("failed to parse number of loops");
+ return COMMAND_ERROR_USAGE;
+ }
+ }
+
+ printf("want %lluMB (%llu bytes)\n", (ull) wantmb, (ull) wantbytes);
+ buf = NULL;
+
+ if (memtester_use_phys) {
+ memfd = open(device_name, O_RDWR);
+ if (memfd == -1) {
+ printf("failed to open %s for physical memory: %s\n",
+ device_name, strerror(errno));
+ return EXIT_FAIL_NONSTARTER;
+ }
+ buf = memmap(memfd, PROT_READ | PROT_WRITE) + memtester_physaddrbase;
+ if (buf == MAP_FAILED) {
+ printf("failed to mmap %s for physical memory: %s\n",
+ device_name, strerror(errno));
+ close(memfd);
+ return EXIT_FAIL_NONSTARTER;
+ }
+
+ bufsize = wantbytes; /* accept no less */
+ } else {
+ buf = malloc(wantbytes);
+ if (!buf)
+ return -ENOMEM;
+
+ printf("got %lluMB (%llu bytes)\n", (ull) wantbytes >> 20,
+ (ull) wantbytes);
+ }
+ bufsize = wantbytes;
+ aligned = buf;
+
+ printf("buffer @ 0x%p\n", buf);
+
+ halflen = bufsize / 2;
+ count = halflen / sizeof(ul);
+ bufa = (ulv *) aligned;
+ bufb = (ulv *) ((size_t) aligned + halflen);
+
+ for(loop=1; ((!loops) || loop <= loops); loop++) {
+ printf("Loop %lu", loop);
+ if (loops) {
+ printf("/%lu", loops);
+ }
+ printf(":\n");
+ printf(" %-20s: ", "Stuck Address");
+ ret = test_stuck_address(aligned, bufsize / sizeof(ul));
+ if (!ret) {
+ printf("ok\n");
+ } else if (ret == -EINTR) {
+ goto out;
+ } else {
+ exit_code |= EXIT_FAIL_ADDRESSLINES;
+ }
+ for (i=0;;i++) {
+ if (!tests[i].name) break;
+ /* If using a custom testmask, only run this test if the
+ bit corresponding to this test was set by the user.
+ */
+ if (testmask && (!((1 << i) & testmask))) {
+ continue;
+ }
+ printf(" %-20s: ", tests[i].name);
+ ret = tests[i].fp(bufa, bufb, count);
+ if (!ret) {
+ printf("ok\n");
+ } else if (ret == -EINTR) {
+ goto out;
+ } else {
+ exit_code |= EXIT_FAIL_OTHERTEST;
+ }
+ }
+ printf("\n");
+ }
+out:
+ if (memtester_use_phys)
+ close(memfd);
+ else
+ free(buf);
+ printf("Done.\n");
+ if (!exit_code)
+ return 0;
+ printf("%s FAILED: 0x%x\n", argv[0], exit_code);
+ return COMMAND_ERROR;
+}
+
+BAREBOX_CMD_HELP_START(memtester)
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_TEXT("-p PHYSADDR")
+BAREBOX_CMD_HELP_TEXT(" tells memtester to test a specific region of memory starting at physical")
+BAREBOX_CMD_HELP_TEXT(" address PHYSADDR (given in hex), by mmaping a device specified by the -d")
+BAREBOX_CMD_HELP_TEXT(" option (below, or /dev/mem by default).")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("-d DEVICE")
+BAREBOX_CMD_HELP_TEXT(" a device to mmap")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("-m TESTMASK")
+BAREBOX_CMD_HELP_TEXT(" bitmask to select desired tests")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("MEMORY ")
+BAREBOX_CMD_HELP_TEXT(" the amount of memory to allocate and test in bytes. You")
+BAREBOX_CMD_HELP_TEXT(" can include a suffix of K, M, or G to indicate kilobytes, ")
+BAREBOX_CMD_HELP_TEXT(" megabytes, or gigabytes respectively.")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("ITERATIONS")
+BAREBOX_CMD_HELP_TEXT(" (optional) number of loops to iterate through. Default is infinite.")
+BAREBOX_CMD_HELP_END
+
+BAREBOX_CMD_START(memtester)
+ .cmd = do_memtester,
+ BAREBOX_CMD_DESC("memory stress-testing")
+ BAREBOX_CMD_OPTS("[-p PHYSADDR [-d DEVICE]] [-m TESTMASK] <MEMORY>[k|M|G] [ITERATIONS]")
+ BAREBOX_CMD_GROUP(CMD_GRP_MEM)
+ BAREBOX_CMD_HELP(cmd_memtester_help)
+BAREBOX_CMD_END
diff --git a/commands/memtester/memtester.h b/commands/memtester/memtester.h
new file mode 100644
index 0000000000..a683cd9d65
--- /dev/null
+++ b/commands/memtester/memtester.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Very simple (yet, for some reason, very effective) memory tester.
+ * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
+ * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
+ * Version 3 not publicly released.
+ * Version 4 rewrite:
+ * Copyright (C) 2004-2012 Charles Cazabon <charlesc-memtester@pyropus.ca>
+ *
+ * This file contains the declarations for external variables from the main file.
+ * See other comments in that file.
+ *
+ */
+
+#include <types.h>
+
+/* extern declarations. */
+
+extern int memtester_use_phys;
+extern off_t memtester_physaddrbase;
+
diff --git a/commands/memtester/sizes.h b/commands/memtester/sizes.h
new file mode 100644
index 0000000000..569b3361e9
--- /dev/null
+++ b/commands/memtester/sizes.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Very simple but very effective user-space memory tester.
+ * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
+ * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
+ * Version 3 not publicly released.
+ * Version 4 rewrite:
+ * Copyright (C) 2004-2012 Charles Cazabon <charlesc-memtester@pyropus.ca>
+ *
+ * This file contains some macro definitions for handling 32/64 bit platforms.
+ *
+ */
+
+#include <linux/limits.h>
+
+#define rand32() random32()
+
+#ifdef CONFIG_64BIT
+ #define rand64() (((ul) rand32()) << 32 | ((ul) rand32()))
+ #define rand_ul() rand64()
+ #define UL_ONEBITS 0xffffffffffffffffUL
+ #define UL_LEN 64
+ #define CHECKERBOARD1 0x5555555555555555
+ #define CHECKERBOARD2 0xaaaaaaaaaaaaaaaa
+ #define UL_BYTE(x) (((ul)x | (ul)x<<8 | (ul)x<<16 | (ul)x<<24 | (ul)x<<32 | (ul)x<<40 | (ul)x<<48 | (ul)x<<56))
+#else
+ #define rand_ul() rand32()
+ #define UL_ONEBITS 0xffffffff
+ #define UL_LEN 32
+ #define CHECKERBOARD1 0x55555555
+ #define CHECKERBOARD2 0xaaaaaaaa
+ #define UL_BYTE(x) ((x | x << 8 | x << 16 | x << 24))
+#endif
+
+
diff --git a/commands/memtester/tests.c b/commands/memtester/tests.c
new file mode 100644
index 0000000000..ca83c4a764
--- /dev/null
+++ b/commands/memtester/tests.c
@@ -0,0 +1,495 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Very simple but very effective user-space memory tester.
+ * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
+ * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
+ * Version 3 not publicly released.
+ * Version 4 rewrite:
+ * Copyright (C) 2004-2012 Charles Cazabon <charlesc-memtester@pyropus.ca>
+ *
+ * This file contains the functions for the actual tests, called from the
+ * main routine in memtester.c. See other comments in that file.
+ *
+ */
+
+#include <common.h>
+#include <types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <linux/limits.h>
+
+#include "types.h"
+#include "sizes.h"
+#include "memtester.h"
+#include "tests.h"
+
+static char progress[] = "-\\|/";
+#define PROGRESSLEN 4
+#define PROGRESSOFTEN 2500
+#define ONE 0x00000001L
+
+static mword8_t mword8;
+static mword16_t mword16;
+
+/* Function definitions. */
+
+static int compare_regions(ulv *bufa, ulv *bufb, size_t count) {
+ int r = 0;
+ size_t i;
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ off_t physaddr;
+
+ if (ctrlc())
+ return -EINTR;
+
+ for (i = 0; i < count; i++, p1++, p2++) {
+ if (*p1 != *p2) {
+ if (memtester_use_phys) {
+ physaddr = memtester_physaddrbase + (i * sizeof(ul));
+ printf("FAILURE: 0x%08lx != 0x%08lx at physical address "
+ "0x%08lx.\n",
+ (ul) *p1, (ul) *p2, physaddr);
+ } else {
+ printf("FAILURE: 0x%08lx != 0x%08lx at offset 0x%08lx.\n",
+ (ul) *p1, (ul) *p2, (ul) (i * sizeof(ul)));
+ }
+ /* printf("Skipping to next test..."); */
+ r = -1;
+ }
+ }
+ return r;
+}
+
+int test_stuck_address(ulv *bufa, size_t count) {
+ ulv *p1 = bufa;
+ unsigned int j;
+ size_t i;
+ off_t physaddr;
+
+ printf(" ");
+ for (j = 0; j < 16; j++) {
+ if (ctrlc())
+ return -EINTR;
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ p1 = (ulv *) bufa;
+ printf("setting %3u", j);
+ for (i = 0; i < count; i++) {
+ *p1 = ((j + i) % 2) == 0 ? (ul) p1 : ~((ul) p1);
+ *p1++;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ p1 = (ulv *) bufa;
+ for (i = 0; i < count; i++, p1++) {
+ if (*p1 != (((j + i) % 2) == 0 ? (ul) p1 : ~((ul) p1))) {
+ if (memtester_use_phys) {
+ physaddr = memtester_physaddrbase + (i * sizeof(ul));
+ printf("FAILURE: possible bad address line at physical "
+ "address 0x%08lx.\n",
+ physaddr);
+ } else {
+ printf("FAILURE: possible bad address line at offset "
+ "0x%08lx.\n",
+ (ul) (i * sizeof(ul)));
+ }
+ printf("Skipping to next test...\n");
+ return -1;
+ }
+ }
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_random_value(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ ul j = 0;
+ size_t i;
+
+ putchar(' ');
+ for (i = 0; i < count; i++) {
+ *p1++ = *p2++ = rand_ul();
+ if (!(i % PROGRESSOFTEN)) {
+ putchar('\b');
+ putchar(progress[++j % PROGRESSLEN]);
+ }
+ }
+ printf("\b \b");
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_xor_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ *p1++ ^= q;
+ *p2++ ^= q;
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_sub_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ *p1++ -= q;
+ *p2++ -= q;
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_mul_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ *p1++ *= q;
+ *p2++ *= q;
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_div_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ if (!q) {
+ q++;
+ }
+ *p1++ /= q;
+ *p2++ /= q;
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_or_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ *p1++ |= q;
+ *p2++ |= q;
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_and_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ *p1++ &= q;
+ *p2++ &= q;
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_seqinc_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ size_t i;
+ ul q = rand_ul();
+
+ for (i = 0; i < count; i++) {
+ *p1++ = *p2++ = (i + q);
+ }
+ return compare_regions(bufa, bufb, count);
+}
+
+int test_solidbits_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j;
+ ul q;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (j = 0; j < 64; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ q = (j % 2) == 0 ? UL_ONEBITS : 0;
+ printf("setting %3u", j);
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ for (i = 0; i < count; i++) {
+ *p1++ = *p2++ = (i % 2) == 0 ? q : ~q;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_checkerboard_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j;
+ ul q;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (j = 0; j < 64; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ q = (j % 2) == 0 ? CHECKERBOARD1 : CHECKERBOARD2;
+ printf("setting %3u", j);
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ for (i = 0; i < count; i++) {
+ *p1++ = *p2++ = (i % 2) == 0 ? q : ~q;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_blockseq_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (j = 0; j < 256; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ printf("setting %3u", j);
+ for (i = 0; i < count; i++) {
+ *p1++ = *p2++ = (ul) UL_BYTE(j);
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_walkbits0_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (j = 0; j < UL_LEN * 2; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ printf("setting %3u", j);
+ for (i = 0; i < count; i++) {
+ if (j < UL_LEN) { /* Walk it up. */
+ *p1++ = *p2++ = ONE << j;
+ } else { /* Walk it back down. */
+ *p1++ = *p2++ = ONE << (UL_LEN * 2 - j - 1);
+ }
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_walkbits1_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (j = 0; j < UL_LEN * 2; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ printf("setting %3u", j);
+ for (i = 0; i < count; i++) {
+ if (j < UL_LEN) { /* Walk it up. */
+ *p1++ = *p2++ = UL_ONEBITS ^ (ONE << j);
+ } else { /* Walk it back down. */
+ *p1++ = *p2++ = UL_ONEBITS ^ (ONE << (UL_LEN * 2 - j - 1));
+ }
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_bitspread_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (j = 0; j < UL_LEN * 2; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ printf("setting %3u", j);
+ for (i = 0; i < count; i++) {
+ if (j < UL_LEN) { /* Walk it up. */
+ *p1++ = *p2++ = (i % 2 == 0)
+ ? (ONE << j) | (ONE << (j + 2))
+ : UL_ONEBITS ^ ((ONE << j)
+ | (ONE << (j + 2)));
+ } else { /* Walk it back down. */
+ *p1++ = *p2++ = (i % 2 == 0)
+ ? (ONE << (UL_LEN * 2 - 1 - j)) | (ONE << (UL_LEN * 2 + 1 - j))
+ : UL_ONEBITS ^ (ONE << (UL_LEN * 2 - 1 - j)
+ | (ONE << (UL_LEN * 2 + 1 - j)));
+ }
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_bitflip_comparison(ulv *bufa, ulv *bufb, size_t count) {
+ ulv *p1 = bufa;
+ ulv *p2 = bufb;
+ unsigned int j, k;
+ ul q;
+ size_t i;
+ int ret;
+
+ printf(" ");
+ for (k = 0; k < UL_LEN; k++) {
+ q = ONE << k;
+ for (j = 0; j < 8; j++) {
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ q = ~q;
+ printf("setting %3u", k * 8 + j);
+ p1 = (ulv *) bufa;
+ p2 = (ulv *) bufb;
+ for (i = 0; i < count; i++) {
+ *p1++ = *p2++ = (i % 2) == 0 ? q : ~q;
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b");
+ printf("testing %3u", k * 8 + j);
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return -1;
+ }
+ }
+ printf("\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b");
+ return 0;
+}
+
+int test_8bit_wide_random(ulv* bufa, ulv* bufb, size_t count) {
+ u8v *p1, *t;
+ ulv *p2;
+ int attempt;
+ unsigned int b, j = 0;
+ size_t i;
+ int ret;
+
+ putchar(' ');
+ for (attempt = 0; attempt < 2; attempt++) {
+ if (attempt & 1) {
+ p1 = (u8v *) bufa;
+ p2 = bufb;
+ } else {
+ p1 = (u8v *) bufb;
+ p2 = bufa;
+ }
+ for (i = 0; i < count; i++) {
+ t = mword8.bytes;
+ *p2++ = mword8.val = rand_ul();
+ for (b=0; b < UL_LEN/8; b++) {
+ *p1++ = *t++;
+ }
+ if (!(i % PROGRESSOFTEN)) {
+ putchar('\b');
+ putchar(progress[++j % PROGRESSLEN]);
+ }
+ }
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b \b");
+ return 0;
+}
+
+int test_16bit_wide_random(ulv* bufa, ulv* bufb, size_t count) {
+ u16v *p1, *t;
+ ulv *p2;
+ int attempt;
+ unsigned int b, j = 0;
+ size_t i;
+ int ret;
+
+ putchar( ' ' );
+ for (attempt = 0; attempt < 2; attempt++) {
+ if (attempt & 1) {
+ p1 = (u16v *) bufa;
+ p2 = bufb;
+ } else {
+ p1 = (u16v *) bufb;
+ p2 = bufa;
+ }
+ for (i = 0; i < count; i++) {
+ t = mword16.u16s;
+ *p2++ = mword16.val = rand_ul();
+ for (b = 0; b < UL_LEN/16; b++) {
+ *p1++ = *t++;
+ }
+ if (!(i % PROGRESSOFTEN)) {
+ putchar('\b');
+ putchar(progress[++j % PROGRESSLEN]);
+ }
+ }
+ ret = compare_regions(bufa, bufb, count);
+ if (ret)
+ return ret;
+ }
+ printf("\b \b");
+ return 0;
+}
diff --git a/commands/memtester/tests.h b/commands/memtester/tests.h
new file mode 100644
index 0000000000..427651e189
--- /dev/null
+++ b/commands/memtester/tests.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Very simple yet very effective memory tester.
+ * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
+ * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
+ * Version 3 not publicly released.
+ * Version 4 rewrite:
+ * Copyright (C) 2004-2012 Charles Cazabon <charlesc-memtester@pyropus.ca>
+ *
+ * This file contains the declarations for the functions for the actual tests,
+ * called from the main routine in memtester.c. See other comments in that
+ * file.
+ *
+ */
+
+/* Function declaration. */
+
+int test_stuck_address(unsigned long volatile *bufa, size_t count);
+int test_random_value(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_xor_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_sub_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_mul_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_div_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_or_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_and_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_seqinc_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_solidbits_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_checkerboard_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_blockseq_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_walkbits0_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_walkbits1_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_bitspread_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_bitflip_comparison(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_8bit_wide_random(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+int test_16bit_wide_random(unsigned long volatile *bufa, unsigned long volatile *bufb, size_t count);
+
diff --git a/commands/memtester/types.h b/commands/memtester/types.h
new file mode 100644
index 0000000000..0291610d2c
--- /dev/null
+++ b/commands/memtester/types.h
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Very simple but very effective user-space memory tester.
+ * Originally by Simon Kirby <sim@stormix.com> <sim@neato.org>
+ * Version 2 by Charles Cazabon <charlesc-memtester@pyropus.ca>
+ * Version 3 not publicly released.
+ * Version 4 rewrite:
+ * Copyright (C) 2004-2010 Charles Cazabon <charlesc-memtester@pyropus.ca>
+ *
+ * This file contains typedefs, structure, and union definitions.
+ *
+ */
+
+#include "sizes.h"
+
+typedef unsigned long ul;
+typedef unsigned long long ull;
+typedef unsigned long volatile ulv;
+typedef unsigned char volatile u8v;
+typedef unsigned short volatile u16v;
+
+struct test {
+ char *name;
+ int (*fp)(ulv *, ulv *, size_t);
+};
+
+typedef union {
+ unsigned char bytes[UL_LEN/8];
+ ul val;
+} mword8_t;
+
+typedef union {
+ unsigned short u16s[UL_LEN/16];
+ ul val;
+} mword16_t;
diff --git a/common/uimage.c b/common/uimage.c
index a84b8fddc4..9abfbcf3ba 100644
--- a/common/uimage.c
+++ b/common/uimage.c
@@ -27,6 +27,7 @@
#include <rtc.h>
#include <filetype.h>
#include <memory.h>
+#include <zero_page.h>
static inline int uimage_is_multi_image(struct uimage_handle *handle)
{
@@ -359,7 +360,10 @@ static int uimage_sdram_flush(void *buf, unsigned int len)
}
}
- memcpy(uimage_buf + uimage_size, buf, len);
+ if (zero_page_contains((unsigned long)uimage_buf + uimage_size))
+ zero_page_memcpy(uimage_buf + uimage_size, buf, len);
+ else
+ memcpy(uimage_buf + uimage_size, buf, len);
uimage_size += len;
@@ -388,7 +392,20 @@ struct resource *file_to_sdram(const char *filename, unsigned long adr)
goto out;
}
- now = read_full(fd, (void *)(res->start + ofs), BUFSIZ);
+ if (zero_page_contains(res->start + ofs)) {
+ void *tmp = malloc(BUFSIZ);
+ if (!tmp)
+ now = -ENOMEM;
+ else
+ now = read_full(fd, tmp, BUFSIZ);
+
+ if (now > 0)
+ zero_page_memcpy((void *)(res->start + ofs), tmp, now);
+ free(tmp);
+ } else {
+ now = read_full(fd, (void *)(res->start + ofs), BUFSIZ);
+ }
+
if (now < 0) {
release_sdram_region(res);
res = NULL;
diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
index da2dc592ad..0c620427ee 100644
--- a/drivers/mci/stm32_sdmmc2.c
+++ b/drivers/mci/stm32_sdmmc2.c
@@ -633,11 +633,16 @@ priv_free:
}
static struct amba_id stm32_sdmmc2_ids[] = {
- /* ST Micro STM32MP157C */
+ /* ST Micro STM32MP15 v1.1 */
{
.id = 0x10153180,
.mask = 0xf0ffffff,
},
+ /* ST Micro STM32MP15 v2.0 */
+ {
+ .id = 0x00253180,
+ .mask = 0xf0ffffff,
+ },
{ 0, 0 },
};
diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c
index 4aa02b74ff..29071c5ccf 100644
--- a/drivers/mfd/mc34704.c
+++ b/drivers/mfd/mc34704.c
@@ -43,7 +43,7 @@ int mc34704_reg_read(struct mc34704 *mc34704, u8 reg, u8 *val)
{
int ret;
- ret = i2c_read_reg(mc34704->client, reg, val, 1);
+ ret = i2c_read_reg(mc34704->client, 1 << 7 | reg, val, 1);
return ret == 1 ? 0 : ret;
}
@@ -112,7 +112,7 @@ static int mc34704_probe(struct device_d *dev)
mc34704_dev = xzalloc(sizeof(struct mc34704));
mc34704_dev->cdev.name = DRIVERNAME;
mc34704_dev->client = to_i2c_client(dev);
- mc34704_dev->cdev.size = 256;
+ mc34704_dev->cdev.size = 128;
mc34704_dev->cdev.dev = dev;
mc34704_dev->cdev.ops = &mc34704_fops;
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index d69a012f01..f9d3c2e34a 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -996,14 +996,23 @@ static void imx_nand_command(struct mtd_info *mtd, unsigned command,
else
host->buf_start = column + mtd->writesize;
- command = NAND_CMD_READ0;
-
- host->send_cmd(host, command);
+ host->send_cmd(host, NAND_CMD_READ0);
mxc_do_addr_cycle(mtd, column, page_addr);
if (host->pagesize_2k)
/* send read confirm command */
host->send_cmd(host, NAND_CMD_READSTART);
+
+ /*
+ * After the core issued READOOB the result is read using
+ * .read_buf, so we have to make sure the data is actually
+ * there.
+ */
+ if (command == NAND_CMD_READOOB) {
+ host->send_page(host, NFC_OUTPUT);
+ copy_spare(mtd, 1, host->data_buf + mtd->writesize);
+ }
+
break;
case NAND_CMD_SEQIN:
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index e3e039f679..188dbf2d8c 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -144,8 +144,6 @@ static void reclaim_rx_buffers(struct macb_device *macb,
{
unsigned int i;
- dev_dbg(macb->dev, "%s\n", __func__);
-
i = macb->rx_tail;
while (i > new_tail) {
macb->rx_ring[i].addr &= ~MACB_BIT(RX_USED);
@@ -170,8 +168,6 @@ static int gem_recv(struct eth_device *edev)
int length;
u32 status;
- dev_dbg(macb->dev, "%s\n", __func__);
-
for (;;) {
barrier();
if (!(macb->rx_ring[macb->rx_tail].addr & MACB_BIT(RX_USED)))
@@ -206,8 +202,6 @@ static int macb_recv(struct eth_device *edev)
int wrapped = 0;
u32 status;
- dev_dbg(macb->dev, "%s\n", __func__);
-
for (;;) {
barrier();
if (!(macb->rx_ring[rx_tail].addr & MACB_BIT(RX_USED)))
@@ -264,9 +258,38 @@ static int macb_recv(struct eth_device *edev)
return 0;
}
+static int macb_set_tx_clk(struct macb_device *macb, int speed)
+{
+ int rate;
+ int rate_rounded;
+
+ if (!macb->txclk) {
+ dev_dbg(macb->dev, "txclk not available\n");
+ return 0;
+ }
+
+ switch (speed) {
+ case SPEED_100:
+ rate = 25000000;
+ break;
+ case SPEED_1000:
+ rate = 125000000;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ rate_rounded = clk_round_rate(macb->txclk, rate);
+ if (rate_rounded <= 0)
+ return -EINVAL;
+
+ return clk_set_rate(macb->txclk, rate_rounded);
+}
+
static void macb_adjust_link(struct eth_device *edev)
{
struct macb_device *macb = edev->priv;
+ int err;
u32 reg;
reg = macb_readl(macb, NCFGR);
@@ -282,14 +305,16 @@ static void macb_adjust_link(struct eth_device *edev)
reg |= GEM_BIT(GBE);
macb_or_gem_writel(macb, NCFGR, reg);
+
+ err = macb_set_tx_clk(macb, edev->phydev->speed);
+ if (err)
+ dev_warn(macb->dev, "cannot set txclk\n");
}
static int macb_open(struct eth_device *edev)
{
struct macb_device *macb = edev->priv;
- dev_dbg(macb->dev, "%s\n", __func__);
-
/* Enable TX and RX */
macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE));
@@ -340,7 +365,7 @@ static int gmac_init_dummy_tx_queues(struct macb_device *macb)
MACB_BIT(TX_LAST) | MACB_BIT(TX_USED);
for (i = 1; i < num_queues; i++)
- gem_writel_queue_TBQP(macb, &macb->gem_q1_descs[0], i - 1);
+ gem_writel_queue_TBQP(macb, (ulong)macb->gem_q1_descs, i - 1);
return 0;
}
@@ -350,8 +375,6 @@ static void macb_init(struct macb_device *macb)
unsigned long paddr, val = 0;
int i;
- dev_dbg(macb->dev, "%s\n", __func__);
-
/*
* macb_halt should have been called at some point before now,
* so we'll assume the controller is idle.
@@ -441,8 +464,6 @@ static int macb_phy_read(struct mii_bus *bus, int addr, int reg)
int value;
uint64_t start;
- dev_dbg(macb->dev, "%s\n", __func__);
-
netctl = macb_readl(macb, NCR);
netctl |= MACB_BIT(MPE);
macb_writel(macb, NCR, netctl);
@@ -478,8 +499,6 @@ static int macb_phy_write(struct mii_bus *bus, int addr, int reg, u16 value)
unsigned long netctl;
unsigned long frame;
- dev_dbg(macb->dev, "%s\n", __func__);
-
netctl = macb_readl(macb, NCR);
netctl |= MACB_BIT(MPE);
macb_writel(macb, NCR, netctl);
@@ -510,8 +529,6 @@ static int macb_get_ethaddr(struct eth_device *edev, unsigned char *adr)
u8 addr[6];
int i;
- dev_dbg(macb->dev, "%s\n", __func__);
-
/* Check all 4 address register for vaild address */
for (i = 0; i < 4; i++) {
bottom = macb_or_gem_readl(macb, SA1B + i * 8);
@@ -537,8 +554,6 @@ static int macb_set_ethaddr(struct eth_device *edev, const unsigned char *adr)
{
struct macb_device *macb = edev->priv;
- dev_dbg(macb->dev, "%s\n", __func__);
-
/* set hardware address */
macb_or_gem_writel(macb, SA1B, adr[0] | adr[1] << 8 | adr[2] << 16 | adr[3] << 24);
macb_or_gem_writel(macb, SA1T, adr[4] | adr[5] << 8);
@@ -742,6 +757,8 @@ static int macb_probe(struct device_d *dev)
macb->txclk = clk_get(dev, "tx_clk");
if (!IS_ERR(macb->txclk))
clk_enable(macb->txclk);
+ else
+ macb->txclk = NULL;
macb->rxclk = clk_get(dev, "rx_clk");
if (!IS_ERR(macb->rxclk))
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5b45c2023f..c39da558d1 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2203,6 +2203,9 @@ int of_add_memory(struct device_node *node, bool dump)
if (!resource_size(&res))
continue;
+ if (!of_device_is_available(node))
+ continue;
+
of_add_memory_bank(node, dump, mem_bank_num,
res.start, resource_size(&res));
mem_bank_num++;
diff --git a/fs/nfs.c b/fs/nfs.c
index 6c4637281d..c281a2ba75 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -263,6 +263,74 @@ struct nfs_dir {
struct nfs_fh fh;
};
+struct nfserror {
+ int ne;
+ int e;
+ const char *name;
+};
+
+static struct nfserror nfserrors[] = {
+ { .ne = NFS3ERR_PERM, .e = EPERM },
+ { .ne = NFS3ERR_NOENT, .e = ENOENT },
+ { .ne = NFS3ERR_IO, .e = EIO },
+ { .ne = NFS3ERR_NXIO, .e = ENXIO },
+ { .ne = NFS3ERR_ACCES, .e = EACCES },
+ { .ne = NFS3ERR_EXIST, .e = EEXIST },
+ { .ne = NFS3ERR_XDEV, .e = EXDEV },
+ { .ne = NFS3ERR_NODEV, .e = ENODEV },
+ { .ne = NFS3ERR_NOTDIR, .e = ENOTDIR },
+ { .ne = NFS3ERR_ISDIR, .e = EISDIR },
+ { .ne = NFS3ERR_INVAL, .e = EINVAL },
+ { .ne = NFS3ERR_FBIG, .e = EFBIG },
+ { .ne = NFS3ERR_NOSPC, .e = ENOSPC },
+ { .ne = NFS3ERR_ROFS, .e = EROFS },
+ { .ne = NFS3ERR_MLINK, .e = EMLINK },
+ { .ne = NFS3ERR_NAMETOOLONG, .e = ENAMETOOLONG },
+ { .ne = NFS3ERR_NOTEMPTY, .e = ENOTEMPTY },
+ { .ne = NFS3ERR_DQUOT, .e = EDQUOT },
+ { .ne = NFS3ERR_STALE, .e = ESTALE },
+ { .ne = NFS3ERR_REMOTE, .e = EREMOTE },
+ { .ne = NFS3ERR_NOTSUPP, .e = EOPNOTSUPP },
+ { .ne = NFS3ERR_BADHANDLE, .e = EINVAL, .name = "BADHANDLE"},
+ { .ne = NFS3ERR_NOT_SYNC, .e = EINVAL, .name = "NOT_SYNC" },
+ { .ne = NFS3ERR_BAD_COOKIE, .e = EINVAL, .name = "BAD_COOKIE" },
+ { .ne = NFS3ERR_TOOSMALL, .e = EINVAL, .name = "TOOSMALL" },
+ { .ne = NFS3ERR_SERVERFAULT, .e = EINVAL, .name = "SERVERFAULT" },
+ { .ne = NFS3ERR_BADTYPE, .e = EINVAL, .name = "BADTYPE" },
+ { .ne = NFS3ERR_JUKEBOX, .e = EINVAL, .name = "JUKEBOX" },
+};
+
+static const char *nfserrstr(u32 nfserror, int *errcode)
+{
+ static char str[32];
+ int i;
+
+ /*
+ * Most NFS errors have a corresponding POSIX error code. But not all of
+ * them have one, so some must be mapped to a different code here.
+ */
+ for (i = 0; i < ARRAY_SIZE(nfserrors); i++) {
+ struct nfserror *err = &nfserrors[i];
+
+ if (nfserror == err->ne) {
+ if (errcode)
+ *errcode = -err->e;
+
+ if (err->name) {
+ snprintf(str, sizeof(str), "NFS3ERR_%s", err->name);
+ return str;
+ } else
+ return strerror(err->e);
+ }
+ }
+
+ if (errcode)
+ *errcode = -EINVAL;
+
+ snprintf(str, sizeof(str), "Unknown NFS error %d", nfserror);
+ return str;
+}
+
static void xdr_init(struct xdr_stream *stream, void *buf, int len)
{
stream->p = stream->buf = buf;
@@ -642,7 +710,7 @@ static uint32_t *nfs_read_post_op_attr(uint32_t *p, struct inode *inode)
static int nfs_mount_req(struct nfs_priv *npriv)
{
uint32_t data[1024];
- uint32_t *p;
+ uint32_t *p, status;
int len;
int pathlen;
struct packet *nfs_packet;
@@ -667,7 +735,18 @@ static int nfs_mount_req(struct nfs_priv *npriv)
if (IS_ERR(nfs_packet))
return PTR_ERR(nfs_packet);
- p = (void *)nfs_packet->data + sizeof(struct rpc_reply) + 4;
+ p = (void *)nfs_packet->data + sizeof(struct rpc_reply);
+
+ /*
+ * Theoretically the error status is one of MNT3ERR_..., but the NFS
+ * constants are identical.
+ */
+ status = ntoh32(net_read_uint32(p++));
+ if (status != NFS3_OK) {
+ int ret;
+ pr_err("Mounting failed: %s\n", nfserrstr(status, &ret));
+ return ret;
+ }
npriv->rootfh.size = ntoh32(net_read_uint32(p++));
if (npriv->rootfh.size > NFS3_FHSIZE) {
@@ -719,7 +798,7 @@ static int nfs_lookup_req(struct nfs_priv *npriv, struct nfs_fh *fh,
{
struct nfs_inode *ninode = nfsi(inode);
uint32_t data[1024];
- uint32_t *p;
+ uint32_t *p, status;
int len;
struct packet *nfs_packet;
@@ -761,7 +840,13 @@ static int nfs_lookup_req(struct nfs_priv *npriv, struct nfs_fh *fh,
if (IS_ERR(nfs_packet))
return PTR_ERR(nfs_packet);
- p = (void *)nfs_packet->data + sizeof(struct rpc_reply) + 4;
+ p = (void *)nfs_packet->data + sizeof(struct rpc_reply);
+ status = ntoh32(net_read_uint32(p++));
+ if (status != NFS3_OK) {
+ int ret;
+ pr_err("Lookup failed: %s\n", nfserrstr(status, &ret));
+ return ret;
+ }
ninode->fh.size = ntoh32(net_read_uint32(p++));
if (ninode->fh.size > NFS3_FHSIZE) {
@@ -787,7 +872,7 @@ static int nfs_lookup_req(struct nfs_priv *npriv, struct nfs_fh *fh,
static void *nfs_readdirattr_req(struct nfs_priv *npriv, struct nfs_dir *dir)
{
uint32_t data[1024];
- uint32_t *p;
+ uint32_t *p, status;
int len;
struct packet *nfs_packet;
void *buf;
@@ -845,7 +930,13 @@ static void *nfs_readdirattr_req(struct nfs_priv *npriv, struct nfs_dir *dir)
if (IS_ERR(nfs_packet))
return NULL;
- p = (void *)nfs_packet->data + sizeof(struct rpc_reply) + 4;
+ p = (void *)nfs_packet->data + sizeof(struct rpc_reply);
+ status = ntoh32(net_read_uint32(p++));
+ if (status != NFS3_OK) {
+ pr_err("Readdir failed: %s\n", nfserrstr(status, NULL));
+ return NULL;
+ }
+
p = nfs_read_post_op_attr(p, NULL);
/* update cookieverf */
@@ -879,8 +970,8 @@ static int nfs_read_req(struct file_priv *priv, uint64_t offset,
uint32_t readlen)
{
uint32_t data[1024];
- uint32_t *p;
- int len;
+ uint32_t *p, status;
+ int len, ret;
struct packet *nfs_packet;
uint32_t rlen, eof;
@@ -922,7 +1013,12 @@ static int nfs_read_req(struct file_priv *priv, uint64_t offset,
if (IS_ERR(nfs_packet))
return PTR_ERR(nfs_packet);
- p = (void *)nfs_packet->data + sizeof(struct rpc_reply) + 4;
+ p = (void *)nfs_packet->data + sizeof(struct rpc_reply);
+ status = ntoh32(net_read_uint32(p++));
+ if (status != NFS3_OK) {
+ pr_err("Read failed: %s\n", nfserrstr(status, &ret));
+ return ret;
+ }
p = nfs_read_post_op_attr(p, NULL);
@@ -981,7 +1077,7 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh,
char **target)
{
uint32_t data[1024];
- uint32_t *p;
+ uint32_t *p, status;
uint32_t len;
struct packet *nfs_packet;
@@ -1017,7 +1113,13 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh,
if (IS_ERR(nfs_packet))
return PTR_ERR(nfs_packet);
- p = (void *)nfs_packet->data + sizeof(struct rpc_reply) + 4;
+ p = (void *)nfs_packet->data + sizeof(struct rpc_reply);
+ status = ntoh32(net_read_uint32(p++));
+ if (status != NFS3_OK) {
+ int ret;
+ pr_err("Readlink failed: %s\n", nfserrstr(status, &ret));
+ return ret;
+ }
p = nfs_read_post_op_attr(p, NULL);
diff --git a/include/zero_page.h b/include/zero_page.h
new file mode 100644
index 0000000000..ad6861f240
--- /dev/null
+++ b/include/zero_page.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ZERO_PAGE_H
+#define __ZERO_PAGE_H
+
+#include <common.h>
+
+#if defined CONFIG_ARCH_HAS_ZERO_PAGE
+
+/*
+ * zero_page_faulting - fault when accessing the zero page
+ */
+void zero_page_faulting(void);
+
+/*
+ * zero_page_access - allow accesses to the zero page
+ *
+ * Disable the null pointer trap on the zero page if access to the zero page
+ * is actually required. Disable the trap with care and re-enable it
+ * immediately after the access to properly trap null pointers.
+ */
+void zero_page_access(void);
+
+#else
+
+static inline void zero_page_faulting(void)
+{
+}
+
+static inline void zero_page_access(void)
+{
+}
+
+#endif
+
+static inline bool zero_page_contains(unsigned long addr)
+{
+ return addr < PAGE_SIZE;
+}
+
+/*
+ * zero_page_memcpy - copy to or from an address located in the zero page
+ */
+static inline void *zero_page_memcpy(void *dest, const void *src, size_t count)
+{
+ void *ret;
+
+ zero_page_access();
+ ret = memcpy(dest, src, count);
+ zero_page_faulting();
+
+ return ret;
+}
+
+#endif /* __ZERO_PAGE_H */
diff --git a/lib/Kconfig b/lib/Kconfig
index 887f50ff00..e5831ecdb9 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -182,6 +182,9 @@ config ARCH_HAS_STACK_DUMP
config ARCH_HAS_DATA_ABORT_MASK
bool
+config ARCH_HAS_ZERO_PAGE
+ bool
+
config HAVE_EFFICIENT_UNALIGNED_ACCESS
bool
diff --git a/net/eth.c b/net/eth.c
index 85110ef695..626b35d5cc 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -1,18 +1,5 @@
-/*
- * (C) Copyright 2001-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: 2001-2004 Wolfgang Denk <wd@denx.de>, DENX Software Engineering
#include <common.h>
#include <command.h>
diff --git a/net/ifup.c b/net/ifup.c
index 4b69777c16..a74037939b 100644
--- a/net/ifup.c
+++ b/net/ifup.c
@@ -1,18 +1,8 @@
-/*
- * ifup.c - bring up network interfaces
- *
- * Copyright (c) 2014 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
- * 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 detaiifup.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2014 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+
+/* ifup.c - bring up network interfaces */
+
#define pr_fmt(fmt) "ifup: " fmt
#include <environment.h>
diff --git a/net/lib.c b/net/lib.c
index 8dc35c1e52..d4536441bd 100644
--- a/net/lib.c
+++ b/net/lib.c
@@ -1,24 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2015 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+// SPDX-FileCopyrightText: 1994-2000 Neil Russell
+// SPDX-FileCopyrightText: 2000 Roland Borde
+// SPDX-FileCopyrightText: 2000 Paolo Scaffardi
+// SPDX-FileCopyrightText: 2000-2002 Wolfgang Denk <wd@denx.de>
+
/*
* net.c - barebox networking support
*
- * Copyright (c) 2015 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
* based on U-Boot (LiMon) code
- *
- * Copyright 1994 - 2000 Neil Russell.
- * Copyright 2000 Roland Borde
- * Copyright 2000 Paolo Scaffardi
- * Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *
- * 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 <common.h>
diff --git a/net/net.c b/net/net.c
index e6ac4c68fa..4dffc1bd52 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1,24 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2010 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+// SPDX-FileCopyrightText: 1994-2000 Neil Russell
+// SPDX-FileCopyrightText: 2000 Roland Borde
+// SPDX-FileCopyrightText: 2000 Paolo Scaffardi
+// SPDX-FileCopyrightText: 2000-2002 Wolfgang Denk <wd@denx.de>
+
/*
* net.c - barebox networking support
*
- * Copyright (c) 2010 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
* based on U-Boot (LiMon) code
- *
- * Copyright 1994 - 2000 Neil Russell.
- * Copyright 2000 Roland Borde
- * Copyright 2000 Paolo Scaffardi
- * Copyright 2000-2002 Wolfgang Denk, wd@denx.de
- *
- * 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.
- *
*/
#define pr_fmt(fmt) "net: " fmt
diff --git a/net/netconsole.c b/net/netconsole.c
index 0fece65a23..43f78997b8 100644
--- a/net/netconsole.c
+++ b/net/netconsole.c
@@ -1,18 +1,7 @@
-/*
- * netconsole.c - network console support
- *
- * Copyright (c) 2010 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
- * 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.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: 2010 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+
+/* netconsole.c - network console support */
#define pr_fmt(fmt) "netconsole: " fmt
diff --git a/net/nfs.h b/net/nfs.h
index 7c7a648e46..e9ac5f299a 100644
--- a/net/nfs.h
+++ b/net/nfs.h
@@ -1,11 +1,5 @@
-/*
- * (C) Masami Komiya <mkomiya@sonare.it> 2004
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2, or (at
- * your option) any later version.
- */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2004 Masami Komiya <mkomiya@sonare.it> */
#ifndef __NFS_H__
#define __NFS_H__
diff --git a/net/rarp.h b/net/rarp.h
index 24659fde21..0986b02513 100644
--- a/net/rarp.h
+++ b/net/rarp.h
@@ -1,19 +1,5 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: 2000 Wolfgang Denk <wd@denx.de>, DENX Software Engineering */
#ifndef __RARP_H__
#define __RARP_H__
diff --git a/net/sntp.c b/net/sntp.c
index b4e6d6439c..45449fd95b 100644
--- a/net/sntp.c
+++ b/net/sntp.c
@@ -1,13 +1,4 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; version 2.
- *
- * 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.
- */
+// SPDX-License-Identifier: GPL-2.0-only
#include <common.h>
#include <asm/byteorder.h>
diff --git a/scripts/Kconfig b/scripts/Kconfig
index 20530b9ae3..b903486ecd 100644
--- a/scripts/Kconfig
+++ b/scripts/Kconfig
@@ -20,15 +20,6 @@ config MVEBU_HOSTTOOLS
This enables building the tools kwbimage to create an image suitable
for Marvell mvebu machines and kwboot to boot via UART.
-config MXS_HOSTTOOLS
- bool "mxs hosttools" if COMPILE_HOST_TOOLS
- depends on ARCH_MXS || COMPILE_HOST_TOOLS
- default y if ARCH_MXS
- help
- This builds the tools mxsimage and mxsboot which are needed to
- create bootable image files for mxs. You need openssl development
- files to compile this tool.
-
config OMAP3_USB_LOADER
bool "omap3 USB loader"
depends on ARCH_OMAP3 || COMPILE_HOST_TOOLS
diff --git a/scripts/Makefile b/scripts/Makefile
index 30b7ec540c..744f4dd0e7 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -21,7 +21,7 @@ hostprogs-always-$(CONFIG_ARCH_DAVINCI) += mkublheader
HOSTCFLAGS_zynq_mkimage.o = -I$(srctree) -I$(srctree)/arch/arm/mach-zynq/include
hostprogs-always-$(CONFIG_ARCH_ZYNQ) += zynq_mkimage
hostprogs-always-$(CONFIG_ARCH_SOCFPGA) += socfpga_mkimage
-hostprogs-always-$(CONFIG_MXS_HOSTTOOLS) += mxsimage mxsboot
+hostprogs-always-$(CONFIG_ARCH_MXS) += mxsimage mxsboot
hostprogs-always-$(CONFIG_ARCH_LAYERSCAPE) += pblimage
hostprogs-always-$(CONFIG_ARCH_STM32MP) += stm32image
KBUILD_HOSTCFLAGS += -I$(srctree)/scripts/include/