Skip to content

Commit

Permalink
Merge branch 'for-next/misc'
Browse files Browse the repository at this point in the history
  • Loading branch information
saschahauer committed Dec 15, 2021
2 parents abad145 + 2962e19 commit a2501c9
Show file tree
Hide file tree
Showing 607 changed files with 1,639 additions and 682 deletions.
2 changes: 2 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ config ARCH_ARM64_VIRT
select SYS_SUPPORTS_64BIT_KERNEL
select ARM_AMBA
select BOARD_ARM_VIRT
select HW_HAS_PCI

endchoice

Expand Down Expand Up @@ -307,6 +308,7 @@ source "arch/arm/mach-zynqmp/Kconfig"
config BOARD_ARM_VIRT
bool
select BOARD_ARM_GENERIC_DT
select BOARD_QEMU_VIRT
select OF_OVERLAY

config BOARD_ARM_GENERIC_DT
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boards/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ obj-$(CONFIG_MACH_PM9263) += pm9263/
obj-$(CONFIG_MACH_PM9G45) += pm9g45/
obj-$(CONFIG_MACH_PROTONIC_IMX6) += protonic-imx6/
obj-$(CONFIG_MACH_PROTONIC_IMX8M) += protonic-imx8m/
obj-$(CONFIG_MACH_PROTONIC_STM32MP1) += protonic-stm32mp1/
obj-$(CONFIG_MACH_QIL_A9260) += qil-a926x/
obj-$(CONFIG_MACH_QIL_A9G20) += qil-a926x/
obj-$(CONFIG_MACH_RADXA_ROCK) += radxa-rock/
Expand Down Expand Up @@ -166,7 +167,6 @@ 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_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/
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boards/protonic-stm32mp1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lwl-y += lowlevel.o
obj-y += board.o
127 changes: 127 additions & 0 deletions arch/arm/boards/protonic-stm32mp1/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland
// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix

#include <bootsource.h>
#include <common.h>
#include <init.h>
#include <mach/bbu.h>
#include <of_device.h>

/* board specific flags */
#define PRT_STM32_BOOTSRC_SD BIT(2)
#define PRT_STM32_BOOTSRC_EMMC BIT(1)
#define PRT_STM32_BOOTSRC_SPI_NOR BIT(0)

struct prt_stm32_machine_data {
u32 flags;
};

struct prt_stm32_boot_dev {
char *name;
char *env;
char *dev;
int flags;
int boot_idx;
enum bootsource boot_src;
};

static const struct prt_stm32_boot_dev prt_stm32_boot_devs[] = {
{
.name = "emmc",
.env = "/chosen/environment-emmc",
.dev = "/dev/mmc1.ssbl",
.flags = PRT_STM32_BOOTSRC_EMMC,
.boot_src = BOOTSOURCE_MMC,
.boot_idx = 1,
}, {
.name = "qspi",
.env = "/chosen/environment-qspi",
.dev = "/dev/flash.ssbl",
.flags = PRT_STM32_BOOTSRC_SPI_NOR,
.boot_src = BOOTSOURCE_SPI_NOR,
.boot_idx = -1,
}, {
/* SD is optional boot source and should be last device in the
* list. */
.name = "sd",
.env = "/chosen/environment-sd",
.dev = "/dev/mmc0.ssbl",
.flags = PRT_STM32_BOOTSRC_SD,
.boot_src = BOOTSOURCE_MMC,
.boot_idx = 0,
},
};

static int prt_stm32_probe(struct device_d *dev)
{
const struct prt_stm32_machine_data *dcfg;
char *env_path_back = NULL, *env_path = NULL;
int ret, i;

dcfg = of_device_get_match_data(dev);
if (!dcfg) {
ret = -EINVAL;
goto exit_get_dcfg;
}

for (i = 0; i < ARRAY_SIZE(prt_stm32_boot_devs); i++) {
const struct prt_stm32_boot_dev *bd = &prt_stm32_boot_devs[i];
int bbu_flags = 0;

/* skip not supported boot sources */
if (!(bd->flags & dcfg->flags))
continue;

/* first device is build-in device */
if (!env_path_back)
env_path_back = bd->env;

if (bd->boot_src == bootsource_get() && (bd->boot_idx == -1 ||
bd->boot_idx == bootsource_get_instance())) {
bbu_flags = BBU_HANDLER_FLAG_DEFAULT;
env_path = bd->env;
}

ret = stm32mp_bbu_mmc_register_handler(bd->name, bd->dev,
bbu_flags);
if (ret < 0)
dev_warn(dev, "Failed to enable %s bbu (%pe)\n",
bd->name, ERR_PTR(ret));
}

if (!env_path)
env_path = env_path_back;
ret = of_device_enable_path(env_path);
if (ret < 0)
dev_warn(dev, "Failed to enable environment partition '%s' (%pe)\n",
env_path, ERR_PTR(ret));

return 0;

exit_get_dcfg:
dev_err(dev, "Failed to get dcfg: %pe\n", ERR_PTR(ret));
return ret;
}

static const struct prt_stm32_machine_data prt_stm32_prtt1a = {
.flags = PRT_STM32_BOOTSRC_SD | PRT_STM32_BOOTSRC_SPI_NOR,
};

static const struct prt_stm32_machine_data prt_stm32_prtt1c = {
.flags = PRT_STM32_BOOTSRC_SD | PRT_STM32_BOOTSRC_EMMC,
};

static const struct of_device_id prt_stm32_of_match[] = {
{ .compatible = "prt,prtt1a", .data = &prt_stm32_prtt1a },
{ .compatible = "prt,prtt1c", .data = &prt_stm32_prtt1c },
{ .compatible = "prt,prtt1s", .data = &prt_stm32_prtt1a },
{ /* sentinel */ },
};

static struct driver_d prt_stm32_board_driver = {
.name = "board-protonic-stm32",
.probe = prt_stm32_probe,
.of_compatible = prt_stm32_of_match,
};
postcore_platform_driver(prt_stm32_board_driver);
58 changes: 58 additions & 0 deletions arch/arm/boards/protonic-stm32mp1/lowlevel.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland

#include <common.h>
#include <debug_ll.h>
#include <mach/entry.h>

extern char __dtb_z_stm32mp151_prtt1a_start[];
extern char __dtb_z_stm32mp151_prtt1c_start[];
extern char __dtb_z_stm32mp151_prtt1s_start[];

static void setup_uart(void)
{
/* first stage has set up the UART, so nothing to do here */
putc_ll('>');
}

ENTRY_FUNCTION(start_prtt1a, r0, r1, r2)
{
void *fdt;

stm32mp_cpu_lowlevel_init();

if (IS_ENABLED(CONFIG_DEBUG_LL))
setup_uart();

fdt = __dtb_z_stm32mp151_prtt1a_start + get_runtime_offset();

stm32mp1_barebox_entry(fdt);
}

ENTRY_FUNCTION(start_prtt1c, r0, r1, r2)
{
void *fdt;

stm32mp_cpu_lowlevel_init();

if (IS_ENABLED(CONFIG_DEBUG_LL))
setup_uart();

fdt = __dtb_z_stm32mp151_prtt1c_start + get_runtime_offset();

stm32mp1_barebox_entry(fdt);
}

ENTRY_FUNCTION(start_prtt1s, r0, r1, r2)
{
void *fdt;

stm32mp_cpu_lowlevel_init();

if (IS_ENABLED(CONFIG_DEBUG_LL))
setup_uart();

fdt = __dtb_z_stm32mp151_prtt1s_start + get_runtime_offset();

stm32mp1_barebox_entry(fdt);
}
1 change: 0 additions & 1 deletion arch/arm/boards/qemu-virt/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
obj-y += board.o
obj-y += overlay-of-flash.dtb.o
1 change: 1 addition & 0 deletions arch/arm/boards/rockchip-rk3568-evb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdram-init.bin
35 changes: 33 additions & 2 deletions arch/arm/configs/qemu_virt64_defconfig
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
CONFIG_ARCH_ARM64_VIRT=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_ARM_PSCI_CLIENT=y
CONFIG_MMU=y
# CONFIG_MMU_EARLY is not set
CONFIG_MALLOC_SIZE=0x0
CONFIG_KALLSYMS=y
CONFIG_PROMPT=""
CONFIG_HUSH_FANCY_PROMPT=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
CONFIG_IMD=y
CONFIG_BOOTM_INITRD=y
CONFIG_BLSPEC=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_IOMEM=y
CONFIG_CMD_IMD=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_POLLER=y
CONFIG_CMD_SLICE=y
CONFIG_CMD_GO=y
CONFIG_CMD_LOADB=y
CONFIG_CMD_RESET=y
Expand All @@ -32,6 +38,7 @@ CONFIG_CMD_MAGICVAR=y
CONFIG_CMD_MAGICVAR_HELP=y
CONFIG_CMD_SAVEENV=y
CONFIG_CMD_FILETYPE=y
CONFIG_CMD_LN=y
CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_UNCOMPRESS=y
CONFIG_CMD_SLEEP=y
Expand All @@ -41,13 +48,16 @@ CONFIG_CMD_LOGIN=y
CONFIG_CMD_MENU=y
CONFIG_CMD_MENU_MANAGEMENT=y
CONFIG_CMD_PASSWD=y
CONFIG_CMD_SPLASH=y
CONFIG_CMD_FBTEST=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_SMC=y
CONFIG_CMD_BAREBOX_UPDATE=y
CONFIG_CMD_OF_DIFF=y
CONFIG_CMD_OF_NODE=y
Expand All @@ -56,23 +66,44 @@ CONFIG_CMD_OF_DISPLAY_TIMINGS=y
CONFIG_CMD_OF_FIXUP_STATUS=y
CONFIG_CMD_OF_OVERLAY=y
CONFIG_CMD_OFTREE=y
CONFIG_CMD_TIME=y
CONFIG_CMD_STATE=y
CONFIG_NET=y
CONFIG_NET_NFS=y
CONFIG_NET_NETCONSOLE=y
CONFIG_NET_DHCP=y
CONFIG_NET_SNTP=y
CONFIG_NET_FASTBOOT=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_OF_BAREBOX_ENV_IN_FS=y
CONFIG_OF_OVERLAY_LIVE=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_VIRTIO_CONSOLE=y
CONFIG_DRIVER_NET_VIRTIO=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_VIDEO=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_DRIVER_VIDEO_BOCHS_PCI=y
CONFIG_SOUND=y
CONFIG_STATE_DRV=y
CONFIG_VIRTIO_INPUT=y
CONFIG_HWRNG=y
CONFIG_HW_RANDOM_VIRTIO=y
# CONFIG_PINCTRL is not set
CONFIG_NVMEM=y
CONFIG_NVMEM_RMEM=y
CONFIG_PCI_ECAM_GENERIC=y
CONFIG_NVMEM_REBOOT_MODE=y
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_FS_EXT4=y
CONFIG_FS_NFS=y
CONFIG_FS_FAT=y
CONFIG_FS_PSTORE=y
CONFIG_FS_PSTORE_CONSOLE=y
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/stm32mp_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CONFIG_MACH_STM32MP15XX_DKX=y
CONFIG_MACH_LXA_MC1=y
CONFIG_MACH_SEEED_ODYSSEY=y
CONFIG_MACH_STM32MP15X_EV1=y
CONFIG_MACH_PROTONIC_STM32MP1=y
CONFIG_THUMB2_BAREBOX=y
CONFIG_ARM_BOARD_APPEND_ATAG=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ lwl-$(CONFIG_MACH_PROTONIC_IMX6) += \
imx6ul-prti6g.dtb.o \
imx6ull-jozacp.dtb.o
lwl-$(CONFIG_MACH_PROTONIC_IMX8M) += imx8mm-prt8mm.dtb.o
lwl-$(CONFIG_MACH_PROTONIC_STM32MP1) += \
stm32mp151-prtt1a.dtb.o \
stm32mp151-prtt1c.dtb.o \
stm32mp151-prtt1s.dtb.o
lwl-$(CONFIG_MACH_RADXA_ROCK) += rk3188-radxarock.dtb.o
lwl-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += rk3288-phycore-som.dtb.o
lwl-$(CONFIG_MACH_REALQ7) += imx6q-dmo-edmqmx6.dtb.o
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/dts/socfpga.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
};
};

&mmc {
reset-names = "reset";
};

&watchdog0 {
resets = <&rst L4WD0_RESET>;
};
Expand Down
20 changes: 20 additions & 0 deletions arch/arm/dts/stm32mp151-prtt1a.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
// SPDX-FileCopyrightText: 2021 David Jander, Protonic Holland
// SPDX-FileCopyrightText: 2021 Oleksij Rempel, Pengutronix
/dts-v1/;

#include "stm32mp151-prtt1l.dtsi"
#include "stm32mp151-prtt1l-net.dtsi"

/ {
model = "Protonic PRTT1A";
compatible = "prt,prtt1a", "st,stm32mp151";

chosen {
environment-sd {
compatible = "barebox,environment";
device-path = &sdmmc1, "partname:barebox-environment";
status = "disabled";
};
};
};
Loading

0 comments on commit a2501c9

Please sign in to comment.