summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/boards/aarch64-qemu-virt.rst3
-rw-r--r--Documentation/boards/mips/qemu-malta.rst2
-rw-r--r--Makefile2
-rw-r--r--arch/arm/Kconfig32
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/boards/Makefile4
-rw-r--r--arch/arm/boards/highbank/Makefile4
l---------arch/arm/boards/highbank/defaultenv-highbank/boot.d/010-ahci-boot1
l---------arch/arm/boards/highbank/defaultenv-highbank/boot.d/011-ahci1
l---------arch/arm/boards/highbank/defaultenv-highbank/boot.d/020-mmc-boot1
l---------arch/arm/boards/highbank/defaultenv-highbank/boot.d/021-mmc1
l---------arch/arm/boards/highbank/defaultenv-highbank/boot.d/030-net1
l---------arch/arm/boards/highbank/defaultenv-highbank/boot.d/031-net-eth11
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/boot/ahci16
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/boot/ahci-boot16
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/boot/mmc16
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/boot/mmc-boot16
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/boot/net13
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/boot/net-eth113
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/data/oftree4
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/init/001-dtb-probe7
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/init/automount22
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/nv/boot.default1
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/nv/bootm.oftree1
-rw-r--r--arch/arm/boards/highbank/defaultenv-highbank/nv/linux.bootargs.console1
-rw-r--r--arch/arm/boards/highbank/init.c144
-rw-r--r--arch/arm/boards/highbank/lowlevel.c17
-rw-r--r--arch/arm/boards/qemu-virt/board.c10
-rw-r--r--arch/arm/boards/qemu-virt64/Makefile3
-rw-r--r--arch/arm/boards/qemu-virt64/defaultenv-qemu-virt64/config8
-rw-r--r--arch/arm/boards/qemu-virt64/init.c64
-rw-r--r--arch/arm/boards/qemu-virt64/lowlevel.c21
-rw-r--r--arch/arm/boards/qemu-virt64/lowlevel_init.S12
-rw-r--r--arch/arm/configs/highbank_defconfig59
-rw-r--r--arch/arm/configs/qemu_virt64_defconfig52
-rw-r--r--arch/arm/cpu/board-dt-2nd-aarch64.S26
-rw-r--r--arch/arm/cpu/board-dt-2nd.c4
-rw-r--r--arch/arm/include/asm/image.h59
-rw-r--r--arch/arm/include/asm/system_info.h11
-rw-r--r--arch/arm/mach-highbank/Kconfig16
-rw-r--r--arch/arm/mach-highbank/Makefile4
-rw-r--r--arch/arm/mach-highbank/cache-l2x0.c40
-rw-r--r--arch/arm/mach-highbank/core.c47
-rw-r--r--arch/arm/mach-highbank/core.h2
-rw-r--r--arch/arm/mach-highbank/devices.c74
-rw-r--r--arch/arm/mach-highbank/include/mach/debug_ll.h14
-rw-r--r--arch/arm/mach-highbank/include/mach/devices.h17
-rw-r--r--arch/arm/mach-highbank/include/mach/hardware.h14
-rw-r--r--arch/arm/mach-highbank/include/mach/sysregs.h57
-rw-r--r--arch/arm/mach-highbank/reset.c41
-rw-r--r--arch/arm/mach-highbank/smc.S28
-rw-r--r--arch/arm/mach-qemu/Kconfig18
-rw-r--r--arch/arm/mach-qemu/Makefile1
-rw-r--r--arch/arm/mach-qemu/include/mach/debug_ll.h24
-rw-r--r--arch/arm/mach-qemu/include/mach/devices.h13
-rw-r--r--arch/arm/mach-qemu/virt_devices.c30
-rw-r--r--arch/arm/mach-vexpress/Kconfig3
-rw-r--r--arch/sandbox/os/common.c4
-rw-r--r--commands/readline.c6
-rw-r--r--common/Kconfig3
-rw-r--r--common/hush.c2
-rw-r--r--common/parser.c2
-rw-r--r--drivers/gpio/gpio-pl061.c6
-rw-r--r--drivers/mtd/nand/nand_mxs.c87
-rw-r--r--drivers/net/e1000/eeprom.c12
-rw-r--r--drivers/net/phy/phy.c2
-rw-r--r--drivers/of/base.c2
-rw-r--r--include/glob.h6
-rw-r--r--include/printk.h2
-rw-r--r--include/zero_page.h2
-rw-r--r--lib/glob.c24
71 files changed, 235 insertions, 1039 deletions
diff --git a/Documentation/boards/aarch64-qemu-virt.rst b/Documentation/boards/aarch64-qemu-virt.rst
index 5f6cd882d5..42e7d00bfe 100644
--- a/Documentation/boards/aarch64-qemu-virt.rst
+++ b/Documentation/boards/aarch64-qemu-virt.rst
@@ -8,7 +8,8 @@ Running barebox on QEMU aarch64 virt machine
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Usage::
+
$ qemu-system-aarch64 -m 2048M \
-cpu cortex-a57 -machine virt \
-display none -serial stdio \
- -kernel ../barebox/barebox
+ -kernel ./images/barebox-dt-2nd.img
diff --git a/Documentation/boards/mips/qemu-malta.rst b/Documentation/boards/mips/qemu-malta.rst
index 470be32f1f..e188ae8c64 100644
--- a/Documentation/boards/mips/qemu-malta.rst
+++ b/Documentation/boards/mips/qemu-malta.rst
@@ -33,7 +33,7 @@ QEMU run string:
.. code-block:: sh
qemu-system-mipsel -nodefaults -M malta -m 256 \
- -devica VGA -serial stdio -monitor null \
+ -device VGA -serial stdio -monitor null \
-bios barebox-flash-image
diff --git a/Makefile b/Makefile
index 6d44314f0a..a52694360e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 2021
-PATCHLEVEL = 02
+PATCHLEVEL = 03
SUBLEVEL = 0
EXTRAVERSION =
NAME = None
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index cdb934136e..d2e3661892 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -45,6 +45,7 @@ config ARCH_BCM283X
select GPIOLIB
select CLKDEV_LOOKUP
select COMMON_CLK
+ select COMMON_CLK_OF_PROVIDER
select CLOCKSOURCE_BCM283X
select ARM_AMBA
select HAS_DEBUG_LL
@@ -82,17 +83,6 @@ config ARCH_EP93XX
select CPU_ARM920T
select GENERIC_GPIO
-config ARCH_HIGHBANK
- bool "Calxeda Highbank"
- select HAS_DEBUG_LL
- select ARCH_HAS_L2X0
- select CPU_V7
- select ARM_AMBA
- select AMBA_SP804
- select CLKDEV_LOOKUP
- select COMMON_CLK
- select GPIOLIB
-
config ARCH_IMX
bool "Freescale iMX-based"
select GPIOLIB
@@ -278,9 +268,16 @@ config ARCH_ZYNQMP
select SYS_SUPPORTS_64BIT_KERNEL
select HAS_MACB
-config ARCH_QEMU
- bool "ARM QEMU boards"
- select HAS_DEBUG_LL
+config ARCH_ARM64_VIRT
+ bool "ARM64 QEMU Virt board"
+ select CPU_V8
+ select HAVE_PBL_MULTI_IMAGES
+ select OFDEVICE
+ select OFTREE
+ select RELOCATABLE
+ select SYS_SUPPORTS_64BIT_KERNEL
+ select ARM_AMBA
+ select BOARD_ARM_VIRT
endchoice
@@ -291,7 +288,6 @@ source "arch/arm/mach-clps711x/Kconfig"
source "arch/arm/mach-davinci/Kconfig"
source "arch/arm/mach-digic/Kconfig"
source "arch/arm/mach-ep93xx/Kconfig"
-source "arch/arm/mach-highbank/Kconfig"
source "arch/arm/mach-imx/Kconfig"
source "arch/arm/mach-layerscape/Kconfig"
source "arch/arm/mach-mxs/Kconfig"
@@ -308,9 +304,13 @@ source "arch/arm/mach-vexpress/Kconfig"
source "arch/arm/mach-tegra/Kconfig"
source "arch/arm/mach-uemd/Kconfig"
source "arch/arm/mach-zynq/Kconfig"
-source "arch/arm/mach-qemu/Kconfig"
source "arch/arm/mach-zynqmp/Kconfig"
+config BOARD_ARM_VIRT
+ bool
+ select BOARD_ARM_GENERIC_DT
+ select OF_OVERLAY
+
config BOARD_ARM_GENERIC_DT
select LIBFDT
select ARM_AMBA
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 9dc0897e58..a46d9d6bde 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -88,7 +88,6 @@ machine-$(CONFIG_ARCH_CLPS711X) := clps711x
machine-$(CONFIG_ARCH_DAVINCI) := davinci
machine-$(CONFIG_ARCH_DIGIC) := digic
machine-$(CONFIG_ARCH_EP93XX) := ep93xx
-machine-$(CONFIG_ARCH_HIGHBANK) := highbank
machine-$(CONFIG_ARCH_IMX) := imx
machine-$(CONFIG_ARCH_LAYERSCAPE) := layerscape
machine-$(CONFIG_ARCH_MXS) := mxs
@@ -106,7 +105,6 @@ machine-$(CONFIG_ARCH_TEGRA) := tegra
machine-$(CONFIG_ARCH_UEMD) := uemd
machine-$(CONFIG_ARCH_ZYNQ) := zynq
machine-$(CONFIG_ARCH_ZYNQMP) := zynqmp
-machine-$(CONFIG_ARCH_QEMU) := qemu
# Board directory name. This list is sorted alphanumerically
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index f8cdd90ed6..7a3645df11 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -60,7 +60,6 @@ obj-$(CONFIG_MACH_GUF_SANTARO) += guf-santaro/
obj-$(CONFIG_MACH_GUF_VINCELL) += guf-vincell/
obj-$(CONFIG_MACH_GW_VENTANA) += gateworks-ventana/
obj-$(CONFIG_MACH_HABA_KNX_LITE) += haba-knx/
-obj-$(CONFIG_MACH_HIGHBANK) += highbank/
obj-$(CONFIG_MACH_IMX21ADS) += freescale-mx21-ads/
obj-$(CONFIG_MACH_IMX233_OLINUXINO) += imx233-olinuxino/
obj-$(CONFIG_MACH_IMX27ADS) += freescale-mx27-ads/
@@ -163,8 +162,7 @@ obj-$(CONFIG_MACH_ZEDBOARD) += avnet-zedboard/
obj-$(CONFIG_MACH_ZYLONITE) += zylonite/
obj-$(CONFIG_MACH_VARISCITE_MX6) += variscite-mx6/
obj-$(CONFIG_MACH_VSCOM_BALTOS) += vscom-baltos/
-obj-$(CONFIG_MACH_QEMU_VIRT64) += qemu-virt64/
-obj-$(CONFIG_MACH_VIRT) += qemu-virt/
+obj-$(CONFIG_BOARD_ARM_VIRT) += qemu-virt/
obj-$(CONFIG_MACH_WARP7) += element14-warp7/
obj-$(CONFIG_MACH_WEBASTO_CCBV2) += webasto-ccbv2/
obj-$(CONFIG_MACH_VF610_TWR) += freescale-vf610-twr/
diff --git a/arch/arm/boards/highbank/Makefile b/arch/arm/boards/highbank/Makefile
deleted file mode 100644
index e5e4536cd1..0000000000
--- a/arch/arm/boards/highbank/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-obj-y += init.o
-
-lwl-y += lowlevel.o
-bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-highbank
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/010-ahci-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/010-ahci-boot
deleted file mode 120000
index 3672f0495e..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/010-ahci-boot
+++ /dev/null
@@ -1 +0,0 @@
-../boot/ahci-boot \ No newline at end of file
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/011-ahci b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/011-ahci
deleted file mode 120000
index 36b3b2815b..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/011-ahci
+++ /dev/null
@@ -1 +0,0 @@
-../boot/ahci \ No newline at end of file
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/020-mmc-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/020-mmc-boot
deleted file mode 120000
index 85c19bbd66..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/020-mmc-boot
+++ /dev/null
@@ -1 +0,0 @@
-../boot/mmc-boot \ No newline at end of file
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/021-mmc b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/021-mmc
deleted file mode 120000
index 5af95d0ac7..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/021-mmc
+++ /dev/null
@@ -1 +0,0 @@
-../boot/mmc \ No newline at end of file
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/030-net b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/030-net
deleted file mode 120000
index 70b8ea3965..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/030-net
+++ /dev/null
@@ -1 +0,0 @@
-../boot/net \ No newline at end of file
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/031-net-eth1 b/arch/arm/boards/highbank/defaultenv-highbank/boot.d/031-net-eth1
deleted file mode 120000
index 5a30a308c7..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot.d/031-net-eth1
+++ /dev/null
@@ -1 +0,0 @@
-../boot/net-eth1 \ No newline at end of file
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci b/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci
deleted file mode 100644
index 46a8c1b321..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-path="/mnt/ahci"
-
-global.bootm.image="${path}/zImage"
-
-. /env/data/oftree
-
-oftree=${path}/oftree
-if [ -f $oftree ]; then
- global.bootm.oftree="$oftree"
-fi
-
-# The rootdevice may actually be mmcblk1p2 if a card
-# is inserted to the back MMC slot
-global.linux.bootargs.dyn.root="root=/dev/sda2"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci-boot
deleted file mode 100644
index 919eac54a7..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot/ahci-boot
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-path="/mnt/ahci-boot"
-
-global.bootm.image="${path}/zImage"
-
-. /env/data/oftree
-
-oftree=${path}/oftree
-if [ -f $oftree ]; then
- global.bootm.oftree="$oftree"
-fi
-
-# The rootdevice may actually be mmcblk1p2 if a card
-# is inserted to the back MMC slot
-global.linux.bootargs.dyn.root="root=/dev/sda2"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc b/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc
deleted file mode 100644
index 0fff5b4a81..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-path="/mnt/mmc"
-
-global.bootm.image="${path}/zimage"
-
-. /env/data/oftree
-
-oftree=${path}/oftree
-if [ -f $oftree ]; then
- global.bootm.oftree="$oftree"
-fi
-
-# The rootdevice may actually be mmcblk1p2 if a card
-# is inserted to the back MMC slot
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc-boot b/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc-boot
deleted file mode 100644
index f3ae301e1b..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot/mmc-boot
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-path="/mnt/mmc-boot"
-
-global.bootm.image="${path}/zimage"
-
-. /env/data/oftree
-
-oftree=${path}/oftree
-if [ -f $oftree ]; then
- global.bootm.oftree="$oftree"
-fi
-
-# The rootdevice may actually be mmcblk1p2 if a card
-# is inserted to the back MMC slot
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot/net b/arch/arm/boards/highbank/defaultenv-highbank/boot/net
deleted file mode 100644
index 6a700087fb..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot/net
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-ethact eth0
-
-path="/mnt/tftp"
-
-. /env/data/oftree
-
-global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
-#global.bootm.oftree="${path}/${global.user}-oftree-${global.hostname}"
-nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
-bootargs-ip
-global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/boot/net-eth1 b/arch/arm/boards/highbank/defaultenv-highbank/boot/net-eth1
deleted file mode 100644
index 1c70bdf3f0..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/boot/net-eth1
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-ethact eth1
-
-path="/mnt/tftp"
-
-. /env/data/oftree
-
-global.bootm.image="${path}/${global.user}-linux-${global.hostname}"
-#global.bootm.oftree="${path}/${global.user}-oftree-${global.hostname}"
-nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
-bootargs-ip
-global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/data/oftree b/arch/arm/boards/highbank/defaultenv-highbank/data/oftree
deleted file mode 100644
index 9a94b310c3..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/data/oftree
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-#device tree provided by the firmware
-global.bootm.oftree="/dev/dtb"
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/init/001-dtb-probe b/arch/arm/boards/highbank/defaultenv-highbank/init/001-dtb-probe
deleted file mode 100644
index 610db1500e..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/init/001-dtb-probe
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-if [ -e /dev/dtb ]
-then
- oftree -l /dev/dtb
- oftree -p
-fi
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/init/automount b/arch/arm/boards/highbank/defaultenv-highbank/init/automount
deleted file mode 100644
index eb5c07a739..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/init/automount
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# automount tftp server based on $eth0.serverip
-
-mkdir -p /mnt/tftp
-automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp'
-
-# SD card slot, boot partition
-mkdir -p /mnt/mmc-boot
-automount -d /mnt/mmc 'mount /dev/disk0.boot /mnt/mmc-boot'
-
-# SD card slot, first partition
-mkdir -p /mnt/mmc
-automount -d /mnt/mmc 'mount /dev/disk0.0 /mnt/mmc'
-
-# AHCI, boot partition
-mkdir -p /mnt/ahci-boot
-automount -d /mnt/ahci 'mount /dev/ata0.boot /mnt/ahci-boot'
-
-# AHCI, first partition
-mkdir -p /mnt/ahci
-automount -d /mnt/ahci 'mount /dev/ata0.0 /mnt/ahci'
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/nv/boot.default b/arch/arm/boards/highbank/defaultenv-highbank/nv/boot.default
deleted file mode 100644
index c47e1b2bca..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/nv/boot.default
+++ /dev/null
@@ -1 +0,0 @@
-/env/boot.d
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/nv/bootm.oftree b/arch/arm/boards/highbank/defaultenv-highbank/nv/bootm.oftree
deleted file mode 100644
index c373173805..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/nv/bootm.oftree
+++ /dev/null
@@ -1 +0,0 @@
-/dev/dtb
diff --git a/arch/arm/boards/highbank/defaultenv-highbank/nv/linux.bootargs.console b/arch/arm/boards/highbank/defaultenv-highbank/nv/linux.bootargs.console
deleted file mode 100644
index 826debe7c2..0000000000
--- a/arch/arm/boards/highbank/defaultenv-highbank/nv/linux.bootargs.console
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0
diff --git a/arch/arm/boards/highbank/init.c b/arch/arm/boards/highbank/init.c
deleted file mode 100644
index 32e217321a..0000000000
--- a/arch/arm/boards/highbank/init.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <init.h>
-#include <asm/armlinux.h>
-#include <asm/system_info.h>
-#include <generated/mach-types.h>
-#include <mach/devices.h>
-#include <mach/hardware.h>
-#include <mach/sysregs.h>
-#include <environment.h>
-#include <partition.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <of.h>
-#include <envfs.h>
-
-#define FIRMWARE_DTB_BASE 0x1000
-
-#define HB_OPP_VERSION 0
-
-struct fdt_header *fdt = NULL;
-
-static int hb_fixup(struct device_node *root, void *unused)
-{
- struct device_node *node;
- u32 reg = readl(sregs_base + HB_SREG_A9_PWRDOM_DATA);
- u32 *opp_table = (u32 *)HB_SYSRAM_OPP_TABLE_BASE;
- u32 dtb_table[2*10];
- u32 i;
- u32 num_opps;
- __be32 latency;
-
- if (!(reg & HB_PWRDOM_STAT_SATA)) {
- for_each_compatible_node_from(node, root, NULL, "calxeda,hb-ahci")
- of_property_write_string(node, "status", "disabled");
- }
-
- if (!(reg & HB_PWRDOM_STAT_EMMC)) {
- for_each_compatible_node_from(node, root, NULL, "calxeda,hb-sdhci")
- of_property_write_string(node, "status", "disabled");
- }
-
- if ((opp_table[0] >> 16) != HB_OPP_VERSION)
- return 0;
-
- node = of_find_node_by_path("/cpus/cpu@0");
- if (!node)
- return 0;
-
- num_opps = opp_table[0] & 0xff;
-
- for (i = 0; i < num_opps; i++) {
- dtb_table[2 * i] = cpu_to_be32(opp_table[3 + 3 * i]);
- dtb_table[2 * i + 1] = cpu_to_be32(opp_table[2 + 3 * i]);
- }
-
- latency = cpu_to_be32(opp_table[1]);
-
- of_set_property(node, "transition-latency", &latency, 4, 1);
- of_set_property(node, "operating-points", dtb_table, 8 * num_opps, 1);
-
- return 0;
-}
-
-static int highbank_mem_init(void)
-{
- struct device_node *root, *np;
- int ret;
-
- /* load by the firmware at 0x1000 */
- fdt = IOMEM(FIRMWARE_DTB_BASE);
-
- root = of_unflatten_dtb(fdt);
- if (IS_ERR(root)) {
- pr_warn("no dtb found at 0x1000 use default configuration\n");
- fdt = NULL;
- goto not_found;
- }
-
- of_set_root_node(root);
-
- np = of_find_node_by_path("/memory");
- if (!np) {
- pr_warn("no memory node use default configuration\n");
- goto not_found;
- }
-
- ret = of_add_memory(np, true);
- if (ret) {
- pr_warn("memory node: probe failed use default configuration\n");
- goto not_found;
- }
-
- pr_info("highbank: dtb probed memory size\n");
-
- return 0;
-not_found:
- highbank_add_ddram(4089 << 20);
- return 0;
-}
-mem_initcall(highbank_mem_init);
-
-static int highbank_devices_init(void)
-{
- of_register_fixup(hb_fixup, NULL);
- if (!fdt) {
- highbank_register_gpio(0);
- highbank_register_gpio(1);
- highbank_register_gpio(2);
- highbank_register_gpio(3);
- highbank_register_ahci();
- highbank_register_xgmac(0);
- highbank_register_xgmac(1);
- } else {
- fdt = of_get_fixed_tree(NULL);
- add_mem_device("dtb", (unsigned long)fdt, be32_to_cpu(fdt->totalsize),
- IORESOURCE_MEM_WRITEABLE);
- devfs_add_partition("ram0", FIRMWARE_DTB_BASE, SZ_64K, DEVFS_PARTITION_FIXED, "firmware-dtb");
- }
-
- devfs_add_partition("nvram", 0x00000, SZ_16K, DEVFS_PARTITION_FIXED, "env0");
-
- if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
- defaultenv_append_directory(defaultenv_highbank);
-
- return 0;
-}
-device_initcall(highbank_devices_init);
-
-static int highbank_console_init(void)
-{
- barebox_set_model("Calxeda Highbank");
- barebox_set_hostname("highbank");
-
- highbank_register_uart();
-
- return 0;
-}
-console_initcall(highbank_console_init);
diff --git a/arch/arm/boards/highbank/lowlevel.c b/arch/arm/boards/highbank/lowlevel.c
deleted file mode 100644
index 6363ec96df..0000000000
--- a/arch/arm/boards/highbank/lowlevel.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <linux/sizes.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <asm/system_info.h>
-
-void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
-{
- arm_cpu_lowlevel_init();
- barebox_arm_entry(0x00000000, SZ_512M, NULL);
-}
diff --git a/arch/arm/boards/qemu-virt/board.c b/arch/arm/boards/qemu-virt/board.c
index 9d8c90eb5b..d0a7e3da4f 100644
--- a/arch/arm/boards/qemu-virt/board.c
+++ b/arch/arm/boards/qemu-virt/board.c
@@ -9,6 +9,12 @@
#include <asm/system_info.h>
#include <asm/barebox-arm.h>
+#ifdef CONFIG_64BIT
+#define MACHINE "virt64"
+#else
+#define MACHINE "virt"
+#endif
+
extern char __dtb_overlay_of_flash_start[];
static int replace_dtb(void) {
@@ -43,14 +49,14 @@ pure_initcall(replace_dtb);
static int virt_probe(struct device_d *dev)
{
- char *hostname = "virt";
+ const char *hostname = MACHINE;
if (cpu_is_cortex_a7())
hostname = "virt-a7";
else if (cpu_is_cortex_a15())
hostname = "virt-a15";
- barebox_set_model("ARM QEMU virt");
+ barebox_set_model("ARM QEMU " MACHINE);
barebox_set_hostname(hostname);
return 0;
diff --git a/arch/arm/boards/qemu-virt64/Makefile b/arch/arm/boards/qemu-virt64/Makefile
deleted file mode 100644
index b394dde0a1..0000000000
--- a/arch/arm/boards/qemu-virt64/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-obj-y += init.o
-lwl-y += lowlevel.o lowlevel_init.o
-bbenv-$(CONFIG_DEFAULT_ENVIRONMENT_GENERIC) += defaultenv-qemu-virt64
diff --git a/arch/arm/boards/qemu-virt64/defaultenv-qemu-virt64/config b/arch/arm/boards/qemu-virt64/defaultenv-qemu-virt64/config
deleted file mode 100644
index 781dbfefa6..0000000000
--- a/arch/arm/boards/qemu-virt64/defaultenv-qemu-virt64/config
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-autoboot_timeout=3
-
-bootargs="console=ttyAMA0,115200"
-
-# set a fancy prompt (if support is compiled in)
-PS1="\e[1;31m[barebox@\h]:\w\e[0m\n# "
diff --git a/arch/arm/boards/qemu-virt64/init.c b/arch/arm/boards/qemu-virt64/init.c
deleted file mode 100644
index 19cfcae1f0..0000000000
--- a/arch/arm/boards/qemu-virt64/init.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2016 Raphaël Poggi <poggi.raph@gmail.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <init.h>
-#include <asm/armlinux.h>
-#include <asm/system_info.h>
-#include <asm/pgtable64.h>
-#include <mach/devices.h>
-#include <environment.h>
-#include <linux/sizes.h>
-#include <io.h>
-#include <envfs.h>
-#include <globalvar.h>
-#include <asm/mmu.h>
-
-static int virt_mem_init(void)
-{
- virt_add_ddram(SZ_2G);
-
- return 0;
-}
-mem_initcall(virt_mem_init);
-
-static int virt_env_init(void)
-{
- add_cfi_flash_device(0, 0x00000000, SZ_128M, 0);
-
- devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self0");
- devfs_add_partition("nor0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0");
-
- if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
- defaultenv_append_directory(defaultenv_qemu_virt64);
-
- return 0;
-}
-device_initcall(virt_env_init);
-
-static int virt_console_init(void)
-{
- virt_register_uart(0);
-
- return 0;
-}
-console_initcall(virt_console_init);
-
-static int virt_core_init(void)
-{
- char *hostname = "virt64";
-
- if (cpu_is_cortex_a53())
- hostname = "virt64-a53";
- else if (cpu_is_cortex_a57())
- hostname = "virt64-a57";
-
- barebox_set_model("ARM QEMU virt64");
- barebox_set_hostname(hostname);
-
- return 0;
-}
-postcore_initcall(virt_core_init);
diff --git a/arch/arm/boards/qemu-virt64/lowlevel.c b/arch/arm/boards/qemu-virt64/lowlevel.c
deleted file mode 100644
index fcb052369a..0000000000
--- a/arch/arm/boards/qemu-virt64/lowlevel.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <linux/sizes.h>
-#include <asm/barebox-arm-head.h>
-#include <asm/barebox-arm.h>
-#include <asm/system_info.h>
-
-void qemu_virt64_start(uint32_t, uint32_t, uint32_t);
-
-void noinline qemu_virt64_start(uint32_t r0, uint32_t r1, uint32_t r2)
-{
- arm_cpu_lowlevel_init();
- arm_setup_stack(0x40000000 + SZ_2G - SZ_16K);
-
- barebox_arm_entry(0x40000000, SZ_2G, NULL);
-}
diff --git a/arch/arm/boards/qemu-virt64/lowlevel_init.S b/arch/arm/boards/qemu-virt64/lowlevel_init.S
deleted file mode 100644
index 1967fadb6c..0000000000
--- a/arch/arm/boards/qemu-virt64/lowlevel_init.S
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-#include <linux/linkage.h>
-#include <asm/barebox-arm64.h>
-
-/* The DRAM is already setup */
-#define STACK_TOP 0x80000000
-
-ENTRY_PROC(barebox_arm_reset_vector)
- mov x0, #STACK_TOP
- mov sp, x0
- b qemu_virt64_start
-ENTRY_PROC_END(barebox_arm_reset_vector)
diff --git a/arch/arm/configs/highbank_defconfig b/arch/arm/configs/highbank_defconfig
deleted file mode 100644
index 8a045d8fe2..0000000000
--- a/arch/arm/configs/highbank_defconfig
+++ /dev/null
@@ -1,59 +0,0 @@
-CONFIG_ARCH_HIGHBANK=y
-CONFIG_AEABI=y
-CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
-CONFIG_PBL_IMAGE=y
-CONFIG_MMU=y
-CONFIG_MALLOC_SIZE=0xa00000
-CONFIG_MALLOC_TLSF=y
-CONFIG_PROMPT="vexpress: "
-CONFIG_GLOB=y
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_MENU=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_BOOTM_VERBOSE=y
-CONFIG_BOOTM_INITRD=y
-CONFIG_BOOTM_OFTREE=y
-CONFIG_BOOTM_OFTREE_UIMAGE=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_MEMINFO=y
-# CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_LOGIN=y
-CONFIG_CMD_MENU=y
-CONFIG_CMD_MENU_MANAGEMENT=y
-CONFIG_CMD_PASSWD=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_POWEROFF=y
-CONFIG_CMD_OFTREE=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_DRIVER_NET_CALXEDA_XGMAC=y
-# CONFIG_SPI is not set
-CONFIG_DISK=y
-CONFIG_DISK_AHCI=y
-CONFIG_GPIO_PL061=y
-CONFIG_FS_TFTP=y
-CONFIG_DIGEST_SHA1_GENERIC=y
-CONFIG_DIGEST_SHA256_GENERIC=y
diff --git a/arch/arm/configs/qemu_virt64_defconfig b/arch/arm/configs/qemu_virt64_defconfig
index 6f9bb9591c..17509ce9d6 100644
--- a/arch/arm/configs/qemu_virt64_defconfig
+++ b/arch/arm/configs/qemu_virt64_defconfig
@@ -1,26 +1,38 @@
-CONFIG_TEXT_BASE=0x41000000
-CONFIG_ARCH_QEMU=y
+CONFIG_ARCH_ARM64_VIRT=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_MMU=y
# CONFIG_MMU_EARLY is not set
-CONFIG_PROMPT="qemu-virt64: "
-CONFIG_GLOB=y
+CONFIG_KALLSYMS=y
+CONFIG_PROMPT=""
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
-CONFIG_PARTITION=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
+CONFIG_IMD=y
+CONFIG_CONSOLE_ACTIVATE_NONE=y
+CONFIG_CONSOLE_ALLOW_COLOR=y
+CONFIG_PARTITION_DISK_EFI=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_POLLER=y
+CONFIG_STATE=y
+CONFIG_BOOTCHOOSER=y
+CONFIG_RESET_SOURCE=y
+CONFIG_MACHINE_ID=y
CONFIG_LONGHELP=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_PRINTENV=y
+CONFIG_CMD_MAGICVAR=y
+CONFIG_CMD_MAGICVAR_HELP=y
CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_FILETYPE=y
+CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_UNCOMPRESS=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_ECHO_E=y
@@ -31,11 +43,37 @@ CONFIG_CMD_MENU_MANAGEMENT=y
CONFIG_CMD_PASSWD=y
CONFIG_CMD_READLINE=y
CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_DETECT=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_POWEROFF=y
+CONFIG_CMD_BAREBOX_UPDATE=y
+CONFIG_CMD_OF_DIFF=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OF_DISPLAY_TIMINGS=y
+CONFIG_CMD_OF_FIXUP_STATUS=y
+CONFIG_CMD_OF_OVERLAY=y
CONFIG_CMD_OFTREE=y
+CONFIG_CMD_STATE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+CONFIG_OF_BAREBOX_ENV_IN_FS=y
CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_VIRTIO_CONSOLE=y
# CONFIG_SPI is not set
CONFIG_MTD=y
CONFIG_DRIVER_CFI=y
CONFIG_CFI_BUFFER_WRITE=y
+CONFIG_DISK=y
+CONFIG_DISK_WRITE=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_HWRNG=y
+CONFIG_HW_RANDOM_VIRTIO=y
+# CONFIG_PINCTRL is not set
+CONFIG_VIRTIO_MMIO=y
+CONFIG_FS_EXT4=y
+CONFIG_FS_FAT=y
+CONFIG_FS_PSTORE=y
+CONFIG_FS_PSTORE_CONSOLE=y
CONFIG_DIGEST_SHA1_GENERIC=y
-CONFIG_DIGEST_SHA256_GENERIC=y
diff --git a/arch/arm/cpu/board-dt-2nd-aarch64.S b/arch/arm/cpu/board-dt-2nd-aarch64.S
index 0540a1690d..d2c9f132ce 100644
--- a/arch/arm/cpu/board-dt-2nd-aarch64.S
+++ b/arch/arm/cpu/board-dt-2nd-aarch64.S
@@ -1,11 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <linux/linkage.h>
#include <asm/barebox-arm64.h>
+#include <asm/image.h>
-ENTRY_PROC(start_dt_2nd)
- adr x1, stack
+#define IMAGE_FLAGS \
+ (ARM64_IMAGE_FLAG_PAGE_SIZE_4K << ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT) | \
+ (ARM64_IMAGE_FLAG_PHYS_BASE << ARM64_IMAGE_FLAG_PHYS_BASE_SHIFT)
+
+.section .text_head_entry_start_dt_2nd
+ENTRY("start_dt_2nd")
+ adr x1, 0 /* code0 */
+ b 2f /* code1 */
+ .xword 0x80000 /* Image load offset */
+ .xword _barebox_image_size /* Effective Image size */
+ .xword IMAGE_FLAGS /* Kernel flags */
+ .xword 0 /* reserved */
+ .xword 0 /* reserved */
+ .xword 0 /* reserved */
+ .ascii ARM64_IMAGE_MAGIC /* magic number */
+ .int 0 /* reserved (PE-COFF offset) */
+ .asciz "barebox" /* unused for now */
+2:
mov sp, x1
+ /* Stack now grows into the 0x80000 image load offset specified
+ * above. This is more than enough until FDT /memory is decoded.
+ */
b dt_2nd_aarch64
-.word 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
-stack:
ENTRY_PROC_END(start_dt_2nd)
diff --git a/arch/arm/cpu/board-dt-2nd.c b/arch/arm/cpu/board-dt-2nd.c
index bb13180785..6f6f535918 100644
--- a/arch/arm/cpu/board-dt-2nd.c
+++ b/arch/arm/cpu/board-dt-2nd.c
@@ -29,9 +29,7 @@ void dt_2nd_aarch64(void *fdt);
void dt_2nd_aarch64(void *fdt)
{
- unsigned long image_start = (unsigned long)_text + global_variable_offset();
-
- arm_setup_stack(image_start);
+ /* entry point already set up stack */
relocate_to_current_adr();
setup_c();
diff --git a/arch/arm/include/asm/image.h b/arch/arm/include/asm/image.h
new file mode 100644
index 0000000000..c2b13213c7
--- /dev/null
+++ b/arch/arm/include/asm/image.h
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __ASM_IMAGE_H
+#define __ASM_IMAGE_H
+
+#define ARM64_IMAGE_MAGIC "ARM\x64"
+
+#define ARM64_IMAGE_FLAG_BE_SHIFT 0
+#define ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT (ARM64_IMAGE_FLAG_BE_SHIFT + 1)
+#define ARM64_IMAGE_FLAG_PHYS_BASE_SHIFT \
+ (ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT + 2)
+#define ARM64_IMAGE_FLAG_BE_MASK 0x1
+#define ARM64_IMAGE_FLAG_PAGE_SIZE_MASK 0x3
+#define ARM64_IMAGE_FLAG_PHYS_BASE_MASK 0x1
+
+#define ARM64_IMAGE_FLAG_LE 0
+#define ARM64_IMAGE_FLAG_BE 1
+#define ARM64_IMAGE_FLAG_PAGE_SIZE_4K 1
+#define ARM64_IMAGE_FLAG_PAGE_SIZE_16K 2
+#define ARM64_IMAGE_FLAG_PAGE_SIZE_64K 3
+#define ARM64_IMAGE_FLAG_PHYS_BASE 1
+
+#ifndef __ASSEMBLY__
+
+#define arm64_image_flag_field(flags, field) \
+ (((flags) >> field##_SHIFT) & field##_MASK)
+
+/*
+ * struct arm64_image_header - arm64 kernel image header
+ * See Documentation/arm64/booting.rst for details
+ *
+ * @code0: Executable code, or
+ * @mz_header alternatively used for part of MZ header
+ * @code1: Executable code
+ * @text_offset: Image load offset
+ * @image_size: Effective Image size
+ * @flags: kernel flags
+ * @reserved: reserved
+ * @magic: Magic number
+ * @reserved5: reserved, or
+ * @pe_header: alternatively used for PE COFF offset
+ */
+
+struct arm64_image_header {
+ __le32 code0;
+ __le32 code1;
+ __le64 text_offset;
+ __le64 image_size;
+ __le64 flags;
+ __le64 res2;
+ __le64 res3;
+ __le64 res4;
+ __le32 magic;
+ __le32 res5;
+};
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_IMAGE_H */
diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
index a27b79e6dd..1e3dfc845c 100644
--- a/arch/arm/include/asm/system_info.h
+++ b/arch/arm/include/asm/system_info.h
@@ -42,12 +42,6 @@
#define CPU_IS_CORTEX_A15 0x410fc0f0
#define CPU_IS_CORTEX_A15_MASK 0xff0ffff0
-#define CPU_IS_CORTEX_A53 0x410fd034
-#define CPU_IS_CORTEX_A53_MASK 0xff0ffff0
-
-#define CPU_IS_CORTEX_A57 0x411fd070
-#define CPU_IS_CORTEX_A57_MASK 0xff0ffff0
-
#define CPU_IS_PXA250 0x69052100
#define CPU_IS_PXA250_MASK 0xfffff7f0
@@ -125,11 +119,6 @@
#else
#define ARM_ARCH CPU_ARCH_ARMv8
#endif
-#define cpu_is_cortex_a53() cpu_is_arm(CORTEX_A53)
-#define cpu_is_cortex_a57() cpu_is_arm(CORTEX_A57)
-#else
-#define cpu_is_cortex_a53() (0)
-#define cpu_is_cortex_a57() (0)
#endif
#ifndef __ASSEMBLY__
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
deleted file mode 100644
index 8a22348798..0000000000
--- a/arch/arm/mach-highbank/Kconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-if ARCH_HIGHBANK
-
-config ARCH_TEXT_BASE
- hex
- default 0x03f00000
-
-choice
- prompt "Calxeda Board type"
-
-config MACH_HIGHBANK
- bool "Calxeda Highbank"
- select OFTREE
-
-endchoice
-
-endif
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile
deleted file mode 100644
index 6a7330f633..0000000000
--- a/arch/arm/mach-highbank/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-obj-y += core.o
-obj-y += devices.o
-obj-y += reset.o
-obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o smc.o
diff --git a/arch/arm/mach-highbank/cache-l2x0.c b/arch/arm/mach-highbank/cache-l2x0.c
deleted file mode 100644
index 28d5f6c7dc..0000000000
--- a/arch/arm/mach-highbank/cache-l2x0.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * 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 of
- * the License.
- *
- * 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>
-#include <init.h>
-#include <io.h>
-
-#include <asm/mmu.h>
-#include <asm/cache-l2x0.h>
-
-#include "core.h"
-
-static void highbank_l2x0_disable(void)
-{
- /* Disable PL310 L2 Cache controller */
- highbank_smc1(0x102, 0x0);
-}
-
-static int highbank_l2x0_init(void)
-{
- /* Enable PL310 L2 Cache controller */
- highbank_smc1(0x102, 0x1);
- l2x0_init(IOMEM(0xfff12000), 0, ~0UL);
- outer_cache.disable = highbank_l2x0_disable;
-
- return 0;
-}
-postmmu_initcall(highbank_l2x0_init);
diff --git a/arch/arm/mach-highbank/core.c b/arch/arm/mach-highbank/core.c
deleted file mode 100644
index 967d13f939..0000000000
--- a/arch/arm/mach-highbank/core.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <init.h>
-#include <io.h>
-
-#include <linux/clk.h>
-#include <linux/clkdev.h>
-#include <linux/amba/bus.h>
-
-#include <asm/hardware/arm_timer.h>
-
-#include <mach/devices.h>
-#include <mach/hardware.h>
-#include <mach/sysregs.h>
-
-void __iomem *sregs_base = IOMEM(HB_SREG_A9_BASE);
-
-static void highbank_clk_init(void)
-{
- struct clk *clk;
-
- clk = clk_fixed("dummy_apb_pclk", 0);
- clk_register_clkdev(clk, "apb_pclk", NULL);
-
- clk = clk_fixed("pclk", 150000000);
- clk_register_clkdev(clk, NULL, "sp804");
- clk_register_clkdev(clk, NULL, "uart-pl011");
-}
-
-static void highbank_sp804_init(void)
-{
- amba_apb_device_add(NULL, "sp804", DEVICE_ID_SINGLE, 0xfff34000, 4096, NULL, 0);
-}
-
-static int highbank_init(void)
-{
- highbank_clk_init();
- highbank_sp804_init();
-
- return 0;
-}
-postcore_initcall(highbank_init);
diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h
deleted file mode 100644
index e3f19b2e56..0000000000
--- a/arch/arm/mach-highbank/core.h
+++ /dev/null
@@ -1,2 +0,0 @@
-
-extern void highbank_smc1(int fn, int arg);
diff --git a/arch/arm/mach-highbank/devices.c b/arch/arm/mach-highbank/devices.c
deleted file mode 100644
index 8f9b8e0f45..0000000000
--- a/arch/arm/mach-highbank/devices.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <linux/sizes.h>
-
-#include <linux/amba/bus.h>
-
-#include <asm/memory.h>
-
-#include <mach/devices.h>
-
-void highbank_add_ddram(u32 size)
-{
- arm_add_mem_device("ram1", 0x00000000, size);
- add_mem_device("nvram", 0xfff88000, SZ_32K, IORESOURCE_MEM_WRITEABLE);
-}
-
-void highbank_register_uart(void)
-{
- amba_apb_device_add(NULL, "uart-pl011", DEVICE_ID_SINGLE, 0xfff36000, 4096, NULL, 0);
-}
-
-void highbank_register_ahci(void)
-{
- add_generic_device("ahci", DEVICE_ID_SINGLE, NULL, 0xffe08000,
- 0x10000, IORESOURCE_MEM, NULL);
-}
-
-void highbank_register_xgmac(unsigned id)
-{
- resource_size_t start;
-
- switch (id) {
- case 0:
- start = 0xfff50000;
- break;
- case 1:
- start = 0xfff51000;
- break;
- default:
- return;
- }
-
- add_generic_device("hb-xgmac", id, NULL, start, 0x1000,
- IORESOURCE_MEM, NULL);
-}
-
-void highbank_register_gpio(unsigned id)
-{
- resource_size_t start;
-
- switch (id) {
- case 0:
- start = 0xfff30000;
- break;
- case 1:
- start = 0xfff31000;
- break;
- case 2:
- start = 0xfff32000;
- break;
- case 3:
- start = 0xfff33000;
- break;
- default:
- return;
- }
-
- amba_apb_device_add(NULL, "pl061_gpio", id, start, 0x1000, NULL, 0);
-}
diff --git a/arch/arm/mach-highbank/include/mach/debug_ll.h b/arch/arm/mach-highbank/include/mach/debug_ll.h
deleted file mode 100644
index 5d0fae80e7..0000000000
--- a/arch/arm/mach-highbank/include/mach/debug_ll.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2013 Jean-Christophe PLAGNIOL-VILLARD <plagniol@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#ifndef __MACH_DEBUG_LL_H__
-#define __MACH_DEBUG_LL_H__
-
-#define DEBUG_LL_UART_ADDR 0xfff36000
-
-#include <debug_ll/pl011.h>
-
-#endif
diff --git a/arch/arm/mach-highbank/include/mach/devices.h b/arch/arm/mach-highbank/include/mach/devices.h
deleted file mode 100644
index 2cf2b6161c..0000000000
--- a/arch/arm/mach-highbank/include/mach/devices.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#ifndef __ASM_ARCH_DEVICES_H__
-#define __ASM_ARCH_DEVICES_H__
-
-void highbank_add_ddram(u32 size);
-
-void highbank_register_uart(void);
-void highbank_register_ahci(void);
-void highbank_register_xgmac(unsigned id);
-void highbank_register_gpio(unsigned id);
-
-#endif /* __ASM_ARCH_DEVICES_H__ */
diff --git a/arch/arm/mach-highbank/include/mach/hardware.h b/arch/arm/mach-highbank/include/mach/hardware.h
deleted file mode 100644
index db7fff242f..0000000000
--- a/arch/arm/mach-highbank/include/mach/hardware.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2010-2011 Calxeda, Inc
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#ifndef __MACH_HARDWARE_H__
-#define __MACH_HARDWARE_H__
-
-#define HB_SREG_A9_BASE 0xfff3c000
-#define HB_SYSRAM_OPP_TABLE_BASE 0xfff8f000
-
-#endif /* __MACH_HARDWARE_H__ */
diff --git a/arch/arm/mach-highbank/include/mach/sysregs.h b/arch/arm/mach-highbank/include/mach/sysregs.h
deleted file mode 100644
index 2f058f2d96..0000000000
--- a/arch/arm/mach-highbank/include/mach/sysregs.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2011 Calxeda, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope 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, see <http://www.gnu.org/licenses/>.
- */
-#ifndef _MACH_HIGHBANK__SYSREGS_H_
-#define _MACH_HIGHBANK__SYSREGS_H_
-
-#include <io.h>
-
-extern void __iomem *sregs_base;
-
-#define HB_SREG_A9_PWR_REQ 0xf00
-#define HB_SREG_A9_BOOT_STAT 0xf04
-#define HB_SREG_A9_BOOT_DATA 0xf08
-#define HB_SREG_A9_PWRDOM_DATA 0xf20
-
-#define HB_PWRDOM_STAT_SATA 0x80000000
-#define HB_PWRDOM_STAT_PCI 0x40000000
-#define HB_PWRDOM_STAT_EMMC 0x20000000
-
-#define HB_PWR_SUSPEND 0
-#define HB_PWR_SOFT_RESET 1
-#define HB_PWR_HARD_RESET 2
-#define HB_PWR_SHUTDOWN 3
-
-static inline void hingbank_set_pwr_suspend(void)
-{
- writel(HB_PWR_SUSPEND, sregs_base + HB_SREG_A9_PWR_REQ);
-}
-
-static inline void hingbank_set_pwr_shutdown(void)
-{
- writel(HB_PWR_SHUTDOWN, sregs_base + HB_SREG_A9_PWR_REQ);
-}
-
-static inline void hingbank_set_pwr_soft_reset(void)
-{
- writel(HB_PWR_SOFT_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
-}
-
-static inline void hingbank_set_pwr_hard_reset(void)
-{
- writel(HB_PWR_HARD_RESET, sregs_base + HB_SREG_A9_PWR_REQ);
-}
-
-#endif
diff --git a/arch/arm/mach-highbank/reset.c b/arch/arm/mach-highbank/reset.c
deleted file mode 100644
index ea3908ec2b..0000000000
--- a/arch/arm/mach-highbank/reset.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <io.h>
-#include <poweroff.h>
-#include <restart.h>
-#include <init.h>
-
-#include <mach/devices.h>
-#include <mach/sysregs.h>
-
-static void __noreturn highbank_restart_soc(struct restart_handler *rst)
-{
- hingbank_set_pwr_hard_reset();
- asm(" wfi");
-
- hang();
-}
-
-static void __noreturn highbank_poweroff(struct poweroff_handler *handler)
-{
- shutdown_barebox();
-
- hingbank_set_pwr_shutdown();
- asm(" wfi");
-
- while(1);
-}
-
-static int highbank_init(void)
-{
- restart_handler_register_fn("soc", highbank_restart_soc);
- poweroff_handler_register_fn(highbank_poweroff);
-
- return 0;
-}
-coredevice_initcall(highbank_init);
diff --git a/arch/arm/mach-highbank/smc.S b/arch/arm/mach-highbank/smc.S
deleted file mode 100644
index cc932a3931..0000000000
--- a/arch/arm/mach-highbank/smc.S
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copied from omap44xx-smc.S Copyright (C) 2010 Texas Instruments, Inc.
- * Copyright 2012 Calxeda, Inc.
- *
- * This program is free software,you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/linkage.h>
-
-/*
- * This is common routine to manage secure monitor API
- * used to modify the PL310 secure registers.
- * 'r0' contains the value to be modified and 'r12' contains
- * the monitor API number.
- * Function signature : void highbank_smc1(u32 fn, u32 arg)
- */
-
-ENTRY(highbank_smc1)
- .arch_extension sec
- stmfd sp!, {r4-r11, lr}
- mov r12, r0
- mov r0, r1
- dsb
- smc #0
- ldmfd sp!, {r4-r11, pc}
-ENDPROC(highbank_smc1)
diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig
deleted file mode 100644
index d30bae4c6f..0000000000
--- a/arch/arm/mach-qemu/Kconfig
+++ /dev/null
@@ -1,18 +0,0 @@
-if ARCH_QEMU
-
-config ARCH_TEXT_BASE
- hex
- default 0x40000000
-
-choice
- prompt "ARM Board type"
-
-config MACH_QEMU_VIRT64
- bool "QEMU arm64 virt machine"
- select CPU_V8
- select SYS_SUPPORTS_64BIT_KERNEL
- select ARM_AMBA
- select HAVE_CONFIGURABLE_MEMORY_LAYOUT
-
-endchoice
-endif
diff --git a/arch/arm/mach-qemu/Makefile b/arch/arm/mach-qemu/Makefile
deleted file mode 100644
index ece277ce0e..0000000000
--- a/arch/arm/mach-qemu/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-$(CONFIG_MACH_QEMU_VIRT64) += virt_devices.o
diff --git a/arch/arm/mach-qemu/include/mach/debug_ll.h b/arch/arm/mach-qemu/include/mach/debug_ll.h
deleted file mode 100644
index d59f68ea19..0000000000
--- a/arch/arm/mach-qemu/include/mach/debug_ll.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2013 Jean-Christophe PLAGNIOL-VILLARD <plagniol@jcrosoft.com>
- *
- * GPLv2 only
- */
-
-#ifndef __MACH_DEBUG_LL_H__
-#define __MACH_DEBUG_LL_H__
-
-#include <linux/amba/serial.h>
-#include <io.h>
-
-#define DEBUG_LL_PHYS_BASE 0x10000000
-#define DEBUG_LL_PHYS_BASE_RS1 0x1c000000
-
-#ifdef MP
-#define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE
-#else
-#define DEBUG_LL_UART_ADDR DEBUG_LL_PHYS_BASE_RS1
-#endif
-
-#include <debug_ll/pl011.h>
-
-#endif
diff --git a/arch/arm/mach-qemu/include/mach/devices.h b/arch/arm/mach-qemu/include/mach/devices.h
deleted file mode 100644
index 9872c61b49..0000000000
--- a/arch/arm/mach-qemu/include/mach/devices.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (C) 2016 Raphaël Poggi <poggi.raph@gmail.com>
- *
- * GPLv2 only
- */
-
-#ifndef __ASM_ARCH_DEVICES_H__
-#define __ASM_ARCH_DEVICES_H__
-
-void virt_add_ddram(u32 size);
-void virt_register_uart(unsigned id);
-
-#endif /* __ASM_ARCH_DEVICES_H__ */
diff --git a/arch/arm/mach-qemu/virt_devices.c b/arch/arm/mach-qemu/virt_devices.c
deleted file mode 100644
index 999f463125..0000000000
--- a/arch/arm/mach-qemu/virt_devices.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2016 Raphaël Poggi <poggi.raph@gmail.com>
- *
- * GPLv2 only
- */
-
-#include <common.h>
-#include <linux/amba/bus.h>
-#include <asm/memory.h>
-#include <mach/devices.h>
-#include <linux/ioport.h>
-
-void virt_add_ddram(u32 size)
-{
- arm_add_mem_device("ram0", 0x40000000, size);
-}
-
-void virt_register_uart(unsigned id)
-{
- resource_size_t start;
-
- switch (id) {
- case 0:
- start = 0x09000000;
- break;
- default:
- return;
- }
- amba_apb_device_add(NULL, "uart-pl011", id, start, 4096, NULL, 0);
-}
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 557c9653f4..b72684caa7 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -9,8 +9,7 @@ config MACH_VEXPRESS
config MACH_VIRT
bool "QEMU virt"
+ select BOARD_ARM_VIRT
select ARM_PSCI_CLIENT
- select BOARD_ARM_GENERIC_DT
- select OF_OVERLAY
endif
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index f6b352f2d6..4eb6d37fff 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -321,7 +321,7 @@ int linux_open_hostfile(struct hf_info *hf)
{
char *buf = NULL;
struct stat s;
- int fd;
+ int fd = -1;
printf("add %s %sbacked by file %s%s\n", hf->devname,
hf->filename ? "" : "initially un", hf->filename ?: "",
@@ -408,7 +408,7 @@ int linux_open_hostfile(struct hf_info *hf)
return 0;
err_out:
- if (fd > 0)
+ if (fd >= 0)
close(fd);
free(buf);
return -1;
diff --git a/commands/readline.c b/commands/readline.c
index 403ac8563a..57c8fbd7bc 100644
--- a/commands/readline.c
+++ b/commands/readline.c
@@ -10,14 +10,16 @@
static int do_readline(int argc, char *argv[])
{
- char *buf = xzalloc(CONFIG_CBSIZE);
+ char *buf;
if (argc < 3)
return COMMAND_ERROR_USAGE;
+ buf = xzalloc(CONFIG_CBSIZE);
+
command_slice_release();
- if (readline(argv[1], buf, CONFIG_CBSIZE) < 0) {
+ if (readline(argv[1], buf, CONFIG_CBSIZE - 1) < 0) {
command_slice_acquire();
free(buf);
return COMMAND_ERROR;
diff --git a/common/Kconfig b/common/Kconfig
index b1f4543e03..56064d12c5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -115,6 +115,7 @@ config USBGADGET_START
default y
config BOOT
+ select GLOB
bool
config FASTBOOT_BASE
@@ -406,6 +407,7 @@ choice
select PARAMETER
select BINFMT
select STDDEV
+ select GLOB
help
Enable hush support. This is the most advanced shell available
for barebox.
@@ -417,6 +419,7 @@ choice
select PARAMETER
select STDDEV
select CMD_SETENV
+ select GLOB
help
simple shell. No if/then, no return values from commands, no loops
diff --git a/common/hush.c b/common/hush.c
index 763e6cf74b..0475401321 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -451,7 +451,7 @@ static void get_user_input(struct in_str *i)
command_slice_release();
- n = readline(prompt, console_buffer, CONFIG_CBSIZE);
+ n = readline(prompt, console_buffer, CONFIG_CBSIZE - 1);
command_slice_acquire();
diff --git a/common/parser.c b/common/parser.c
index fb9ef42e7f..584d4b0efe 100644
--- a/common/parser.c
+++ b/common/parser.c
@@ -270,7 +270,7 @@ int run_shell(void)
login();
for (;;) {
- len = readline (CONFIG_PROMPT, console_buffer, CONFIG_CBSIZE);
+ len = readline (CONFIG_PROMPT, console_buffer, CONFIG_CBSIZE - 1);
if (len > 0)
strcpy (lastcommand, console_buffer);
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index c17c265440..f34aba9da9 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -147,7 +147,11 @@ static struct amba_driver pl061_gpio_driver = {
.probe = pl061_probe,
};
-coredevice_platform_driver(pl061_gpio_driver);
+static int __init pl061_gpio_init(void)
+{
+ return amba_driver_register(&pl061_gpio_driver);
+}
+coredevice_initcall(pl061_gpio_init);
MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
MODULE_DESCRIPTION("PL061 GPIO driver");
diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
index 434da49d3e..96ae71364e 100644
--- a/drivers/mtd/nand/nand_mxs.c
+++ b/drivers/mtd/nand/nand_mxs.c
@@ -215,7 +215,6 @@ struct mxs_nand_info {
uint8_t *data_buf;
uint8_t *oob_buf;
- uint8_t marking_block_bad;
uint8_t raw_oob_mode;
/* Functions with altered behaviour */
@@ -223,8 +222,6 @@ struct mxs_nand_info {
loff_t from, struct mtd_oob_ops *ops);
int (*hooked_write_oob)(struct mtd_info *mtd,
loff_t to, struct mtd_oob_ops *ops);
- int (*hooked_block_markbad)(struct mtd_info *mtd,
- loff_t ofs);
/* DMA descriptors */
struct mxs_dma_desc **desc;
@@ -1074,27 +1071,6 @@ static int mxs_nand_hook_write_oob(struct mtd_info *mtd, loff_t to,
}
/*
- * Mark a block bad in NAND.
- *
- * This function is a veneer that replaces the function originally installed by
- * the NAND Flash MTD code.
- */
-static int mxs_nand_hook_block_markbad(struct mtd_info *mtd, loff_t ofs)
-{
- struct nand_chip *chip = mtd_to_nand(mtd);
- struct mxs_nand_info *nand_info = chip->priv;
- int ret;
-
- nand_info->marking_block_bad = 1;
-
- ret = nand_info->hooked_block_markbad(mtd, ofs);
-
- nand_info->marking_block_bad = 0;
-
- return ret;
-}
-
-/*
* There are several places in this driver where we have to handle the OOB and
* block marks. This is the function where things are the most complicated, so
* this is where we try to explain it all. All the other places refer back to
@@ -1177,36 +1153,14 @@ static int mxs_nand_ecc_read_oob(struct nand_chip *chip, int page)
*/
static int mxs_nand_ecc_write_oob(struct nand_chip *chip, int page)
{
- struct mtd_info *mtd = nand_to_mtd(chip);
- struct mxs_nand_info *nand_info = chip->priv;
- int column;
- uint8_t block_mark = 0;
-
/*
* There are fundamental incompatibilities between the i.MX GPMI NFC and
* the NAND Flash MTD model that make it essentially impossible to write
* the out-of-band bytes.
- *
- * We permit *ONE* exception. If the *intent* of writing the OOB is to
- * mark a block bad, we can do that.
*/
- if (!nand_info->marking_block_bad) {
- printf("NXS NAND: Writing OOB isn't supported\n");
- return -EIO;
- }
-
- column = nand_info->version == GPMI_VERSION_TYPE_MX23 ? 0 : mtd->writesize;
- /* Write the block mark. */
- chip->legacy.cmdfunc(chip, NAND_CMD_SEQIN, column, page);
- chip->legacy.write_buf(chip, &block_mark, 1);
- chip->legacy.cmdfunc(chip, NAND_CMD_PAGEPROG, -1, -1);
-
- /* Check if it worked. */
- if (chip->legacy.waitfunc(chip) & NAND_STATUS_FAIL)
- return -EIO;
-
- return 0;
+ printf("MXS NAND: Writing OOB isn't supported\n");
+ return -EIO;
}
/*
@@ -1228,6 +1182,37 @@ static int mxs_nand_block_bad(struct nand_chip *chip , loff_t ofs)
}
/*
+ * Mark a block as bad in NAND.
+ */
+static int mxs_nand_block_markbad(struct nand_chip *chip , loff_t ofs)
+{
+ struct mtd_info *mtd = nand_to_mtd(chip);
+ struct mxs_nand_info *nand_info = chip->priv;
+ int column, page, chipnr, status;
+ uint8_t block_mark = 0;
+
+ chipnr = (int)(ofs >> chip->chip_shift);
+ nand_select_target(chip, chipnr);
+
+ column = nand_info->version == GPMI_VERSION_TYPE_MX23 ? 0 : mtd->writesize;
+ page = (int)(ofs >> chip->page_shift);
+ /* Write the block mark. */
+ chip->legacy.cmdfunc(chip, NAND_CMD_SEQIN, column, page);
+ chip->legacy.write_buf(chip, &block_mark, 1);
+ chip->legacy.cmdfunc(chip, NAND_CMD_PAGEPROG, -1, -1);
+
+ /* Check if it worked. */
+ status = chip->legacy.waitfunc(chip);
+
+ nand_deselect_target(chip);
+
+ if (status & NAND_STATUS_FAIL)
+ return -EIO;
+
+ return 0;
+}
+
+/*
* Nominally, the purpose of this function is to look for or create the bad
* block table. In fact, since the we call this function at the very end of
* the initialization process started by nand_scan(), and we doesn't have a
@@ -1273,11 +1258,6 @@ static int mxs_nand_scan_bbt(struct nand_chip *chip)
mtd->_write_oob = mxs_nand_hook_write_oob;
}
- if (mtd->_block_markbad != mxs_nand_hook_block_markbad) {
- nand_info->hooked_block_markbad = mtd->_block_markbad;
- mtd->_block_markbad = mxs_nand_hook_block_markbad;
- }
-
/* We use the reference implementation for bad block management. */
return nand_create_bbt(chip);
}
@@ -2201,6 +2181,7 @@ static int mxs_nand_probe(struct device_d *dev)
chip->legacy.dev_ready = mxs_nand_device_ready;
chip->legacy.select_chip = mxs_nand_select_chip;
chip->legacy.block_bad = mxs_nand_block_bad;
+ chip->legacy.block_markbad = mxs_nand_block_markbad;
chip->legacy.read_byte = mxs_nand_read_byte;
diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index 900be2f09b..5a7d8675ce 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -1614,12 +1614,12 @@ int e1000_register_eeprom(struct e1000_hw *hw)
}
if (eecd & E1000_EECD_I210_FLASH_DETECTED) {
- hw->mtd.parent = hw->dev;
- hw->mtd.read = e1000_mtd_read;
- hw->mtd.write = e1000_mtd_write;
- hw->mtd.erase = e1000_mtd_erase;
- hw->mtd.lock = e1000_mtd_lock;
- hw->mtd.unlock = e1000_mtd_unlock;
+ hw->mtd.dev.parent = hw->dev;
+ hw->mtd._read = e1000_mtd_read;
+ hw->mtd._write = e1000_mtd_write;
+ hw->mtd._erase = e1000_mtd_erase;
+ hw->mtd._lock = e1000_mtd_lock;
+ hw->mtd._unlock = e1000_mtd_unlock;
hw->mtd.size = eeprom->word_size * 2;
hw->mtd.writesize = 1;
hw->mtd.subpage_sft = 0;
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 622acbe40d..e8e8dad5bd 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -571,7 +571,7 @@ int phy_wait_aneg_done(struct phy_device *phydev)
}
do {
- genphy_update_link(phydev);
+ phy_update_status(phydev);
if (phydev->link == 1)
return 0;
} while (!is_timeout(start, PHY_AN_TIMEOUT * SECOND));
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8759099d74..6fe02649ee 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2273,6 +2273,8 @@ const struct of_device_id of_default_bus_match_table[] = {
{
.compatible = "simple-bus",
}, {
+ .compatible = "simple-pm-bus",
+ }, {
.compatible = "simple-mfd",
}, {
/* sentinel */
diff --git a/include/glob.h b/include/glob.h
index 5f532e6652..ec0ac66f87 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -177,6 +177,7 @@ extern int glob __P ((__const char *__restrict __pattern, int __flags,
int (*__errfunc) (__const char *, int),
glob_t *__restrict __pglob));
+extern void globfree __P ((glob_t *__pglob));
#else
static inline int glob __P ((__const char *__restrict __pattern, int __flags,
int (*__errfunc) (__const char *, int),
@@ -184,9 +185,12 @@ static inline int glob __P ((__const char *__restrict __pattern, int __flags,
{
return GLOB_ABORTED;
}
+
+static inline void globfree __P ((glob_t *__pglob))
+{
+}
#endif
/* Free storage allocated in PGLOB by a previous `glob' call. */
-extern void globfree __P ((glob_t *__pglob));
#else
extern int glob __P ((__const char *__restrict __pattern, int __flags,
int (*__errfunc) (__const char *, int),
diff --git a/include/printk.h b/include/printk.h
index f92e477298..94a25ec9eb 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -160,7 +160,7 @@ extern void print_hex_dump(const char *level, const char *prefix_str,
int prefix_type, int rowsize, int groupsize,
const void *buf, size_t len, bool ascii);
-#if LOGLEVEL <= MSG_DEBUG
+#if LOGLEVEL >= MSG_DEBUG
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
groupsize, buf, len, ascii) \
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
diff --git a/include/zero_page.h b/include/zero_page.h
index ad6861f240..519e65be76 100644
--- a/include/zero_page.h
+++ b/include/zero_page.h
@@ -4,7 +4,7 @@
#include <common.h>
-#if defined CONFIG_ARCH_HAS_ZERO_PAGE
+#if defined CONFIG_ARCH_HAS_ZERO_PAGE && defined CONFIG_MMU
/*
* zero_page_faulting - fault when accessing the zero page
diff --git a/lib/glob.c b/lib/glob.c
index 32f7afdce8..8523bad9a7 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -406,6 +406,18 @@ static int glob_in_dir(const char *pattern, const char *directory,
}
return nfound == 0 ? GLOB_NOMATCH : 0;
}
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+void globfree(glob_t *pglob)
+{
+ if (pglob->gl_pathv != NULL) {
+ int i = pglob->gl_flags & GLOB_DOOFFS ? pglob->gl_offs : 0;
+ for (; i < pglob->gl_pathc; ++i)
+ if (pglob->gl_pathv[i] != NULL)
+ free((__ptr_t) pglob->gl_pathv[i]);
+ free((__ptr_t) pglob->gl_pathv);
+ }
+}
#endif /* CONFIG_GLOB */
#ifdef CONFIG_FAKE_GLOB
@@ -443,15 +455,3 @@ glob_t *pglob;
return 0;
}
#endif /* CONFIG_FAKE_GLOB */
-
-/* Free storage allocated in PGLOB by a previous `glob' call. */
-void globfree(glob_t *pglob)
-{
- if (pglob->gl_pathv != NULL) {
- int i = pglob->gl_flags & GLOB_DOOFFS ? pglob->gl_offs : 0;
- for (; i < pglob->gl_pathc; ++i)
- if (pglob->gl_pathv[i] != NULL)
- free((__ptr_t) pglob->gl_pathv[i]);
- free((__ptr_t) pglob->gl_pathv);
- }
-}