Skip to contentSkip to conversation

amlogic: add support for the SEI Robotic SEI510

PATCH RESEND Superseded Neil Armstrong 1 participant 6 messages Jul 29, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover amlogic: add support for the SEI Robotic SEI510

The SEI510 board is based on the Amlogic S905X2 SoC from the Amlogic G12A SoC family.

The board has the following specifications :
- Amlogic S905X2 ARM Cortex-A53 quad-core SoC
- XGB DDR4 SDRAM
- 10/100 Ethernet (Internal PHY)
- 1 x USB 3.0 Host
- eMMC
- SDcard
- Infrared receiver
- SDIO WiFi Module

The board default behaviour is for booting Android and triggers fastboot on recovery or reboot mode.

Jerome Brunet (1):
boards: meson: add g12a sei510

Neil Armstrong (4):
ARM: dts: Import Amlogic G12A SEI510 DT from Linux 5.3-rc1
configs: meson64: permit redefining ENV_SIZE
ARM: meson: Add support for fastboot_set_reboot_flag()
configs: sei510: disable PSCI_RESET to support fastboot reboot_flag

 arch/arm/dts/Makefile                |   1 +
 arch/arm/dts/meson-g12a-sei510.dts   | 502 +++++++++++++++++++++++++++
 arch/arm/include/asm/arch-meson/sm.h |  18 +
 arch/arm/mach-meson/board-common.c   |  33 ++
 arch/arm/mach-meson/sm.c             | 155 +++++++++
 board/amlogic/sei510/MAINTAINERS     |   5 +
 board/amlogic/sei510/Makefile        |   6 +
 board/amlogic/sei510/README          | 123 +++++++
 board/amlogic/sei510/sei510.c        |  26 ++
 configs/sei510_defconfig             |  75 ++++
 include/configs/meson64.h            |   2 +
 include/configs/sei510.h             | 137 ++++++++
 12 files changed, 1083 insertions(+)
 create mode 100644 arch/arm/dts/meson-g12a-sei510.dts
 create mode 100644 board/amlogic/sei510/MAINTAINERS
 create mode 100644 board/amlogic/sei510/Makefile
 create mode 100644 board/amlogic/sei510/README
 create mode 100644 board/amlogic/sei510/sei510.c
 create mode 100644 configs/sei510_defconfig
 create mode 100644 include/configs/sei510.h
Signature · 1 line
2.22.0
#1 lore raw

PATCH RESEND 1/5 ARM: dts: Import Amlogic G12A SEI510 DT from Linux 5.3-rc1

Import Linux 5.2-rc1 sei510 DT from 5f9e832c1370 ("Linus 5.3-rc1") for the meson-g12a-sei510 board.

---
 arch/arm/dts/Makefile              |   1 +
 arch/arm/dts/meson-g12a-sei510.dts | 502 +++++++++++++++++++++++++++++
 2 files changed, 503 insertions(+)
 create mode 100644 arch/arm/dts/meson-g12a-sei510.dts
arch/arm/dts/Makefile +1 -0
index 2baa368215..fdb0d66e97 100644
@@ -136,6 +136,7 @@ dtb-$(CONFIG_ARCH_MESON) += \
 	meson-gxm-khadas-vim2.dtb \
 	meson-axg-s400.dtb \
 	meson-g12a-u200.dtb \
+	meson-g12a-sei510.dtb \
 	meson-g12b-odroid-n2.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
 	tegra20-medcom-wide.dtb \
arch/arm/dts/meson-g12a-sei510.dts new file +502 -0

502 lines not on this page · raw message

Signature · 1 line
2.22.0
#2 lore raw

PATCH RESEND 2/5 configs: meson64: permit redefining ENV_SIZE

In reply to Neil Armstrong

Permit redefining ENV_SIZE for board specific configs.

---
 include/configs/meson64.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/meson64.h +2 -0
index d82a674270..e707a1893f 100644
@@ -38,7 +38,9 @@
 
 #define CONFIG_CPU_ARMV8
 #define CONFIG_REMAKE_ELF
+#ifndef CONFIG_ENV_SIZE
 #define CONFIG_ENV_SIZE			0x2000
+#endif
 #define CONFIG_SYS_MAXARGS		32
 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
 #define CONFIG_SYS_CBSIZE		1024
Signature · 1 line
2.22.0
#3 lore raw

PATCH RESEND 3/5 boards: meson: add g12a sei510

In reply to Neil Armstrong

From: Jerome Brunet <[email protected]>

The SEI510 board is based on the Amlogic S905X2 SoC from the Amlogic G12A SoC family.

The board has the following specifications :
- Amlogic S905X2 ARM Cortex-A53 quad-core SoC
- XGB DDR4 SDRAM
- 10/100 Ethernet (Internal PHY)
- 1 x USB 3.0 Host
- eMMC
- SDcard
- Infrared receiver
- SDIO WiFi Module

The board default behaviour is for booting Android and triggers fastboot on recovery or reboot mode.

USB vendor ID (used by fastboot) is 0x18d1 (Google) for default udev rules for existing android users work out of the box.

---
 arch/arm/include/asm/arch-meson/sm.h |  18 ++++
 arch/arm/mach-meson/sm.c             | 155 +++++++++++++++++++++++++++
 board/amlogic/sei510/MAINTAINERS     |   5 +
 board/amlogic/sei510/Makefile        |   6 ++
 board/amlogic/sei510/README          | 123 +++++++++++++++++++++
 board/amlogic/sei510/sei510.c        |  26 +++++
 configs/sei510_defconfig             |  74 +++++++++++++
 include/configs/sei510.h             | 137 +++++++++++++++++++++++
 8 files changed, 544 insertions(+)
 create mode 100644 board/amlogic/sei510/MAINTAINERS
 create mode 100644 board/amlogic/sei510/Makefile
 create mode 100644 board/amlogic/sei510/README
 create mode 100644 board/amlogic/sei510/sei510.c
 create mode 100644 configs/sei510_defconfig
 create mode 100644 include/configs/sei510.h
arch/arm/include/asm/arch-meson/sm.h +18 -0
index 60d04ae228..6ae52cc584 100644
@@ -6,7 +6,25 @@
 #ifndef __MESON_SM_H__
 #define __MESON_SM_H__
 
+enum {
+	REBOOT_REASON_COLD = 0,
+	REBOOT_REASON_NORMAL = 1,
+	REBOOT_REASON_RECOVERY = 2,
+	REBOOT_REASON_UPDATE = 3,
+	REBOOT_REASON_FASTBOOT = 4,
+	REBOOT_REASON_SUSPEND_OFF = 5,
+	REBOOT_REASON_HIBERNATE = 6,
+	REBOOT_REASON_BOOTLOADER = 7,
+	REBOOT_REASON_SHUTDOWN_REBOOT = 8,
+	REBOOT_REASON_RPMBP = 9,
+	REBOOT_REASON_CRASH_DUMP = 11,
+	REBOOT_REASON_KERNEL_PANIC = 12,
+	REBOOT_REASON_WATCHDOG_REBOOT = 13,
+};
+
 ssize_t meson_sm_read_efuse(uintptr_t offset, void *buffer, size_t size);
+int meson_sm_get_serial(void *buffer, size_t size);
+int meson_sm_get_reboot_reason(void);
 
 #define SM_SERIAL_SIZE	12
 
arch/arm/mach-meson/sm.c +155 -0

164 lines not on this page · raw message

board/amlogic/sei510/MAINTAINERS new file +5 -0
new file mode 100644
index 0000000000..792ae22176
@@ -0,0 +1,5 @@
+U200
+M:	Neil Armstrong <[email protected]>
+S:	Maintained
+F:	board/amlogic/sei510/
+F:	configs/sei510_defconfig
board/amlogic/sei510/Makefile new file +6 -0
new file mode 100644
index 0000000000..03399a3849
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 BayLibre, SAS
+# Author: Neil Armstrong <[email protected]>
+
+obj-y	:= sei510.o
board/amlogic/sei510/README new file +123 -0

123 lines not on this page · raw message

board/amlogic/sei510/sei510.c new file +26 -0
new file mode 100644
index 0000000000..a92fccd3fd
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <environment.h>
+#include <asm/io.h>
+#include <asm/arch/axg.h>
+#include <asm/arch/sm.h>
+#include <asm/arch/eth.h>
+#include <asm/arch/mem.h>
+
+int misc_init_r(void)
+{
+	meson_eth_init(PHY_INTERFACE_MODE_RMII,
+		       MESON_USE_INTERNAL_RMII_PHY);
+
+	meson_generate_serial_ethaddr();
+
+	env_set("serial#", "AMLG12ASEI510");
+
+	return 0;
+}
configs/sei510_defconfig new file +74 -0

74 lines not on this page · raw message

include/configs/sei510.h new file +137 -0

137 lines not on this page · raw message

Signature · 1 line
2.22.0
#4 lore raw

PATCH RESEND 4/5 ARM: meson: Add support for fastboot_set_reboot_flag()

In reply to Neil Armstrong

Add support for fastboot_set_reboot_flag() by storing the reboot flag in the common code to be used by the custom PSCI reboot handler.

---
 arch/arm/mach-meson/board-common.c | 33 ++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm/mach-meson/board-common.c +33 -0
index 18383f774e..c39643fc17 100644
@@ -14,6 +14,11 @@
 #include <asm/unaligned.h>
 #include <efi_loader.h>
 
+#if CONFIG_IS_ENABLED(FASTBOOT)
+#include <asm/psci.h>
+#include <fastboot.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 __weak int board_init(void)
@@ -142,7 +147,35 @@ int board_late_init(void)
 	return meson_board_late_init();
 }
 
+#if CONFIG_IS_ENABLED(FASTBOOT)
+static unsigned int reboot_reason = REBOOT_REASON_NORMAL;
+
+int fastboot_set_reboot_flag()
+{
+	reboot_reason = REBOOT_REASON_BOOTLOADER;
+
+	printf("Using reboot reason: 0x%x\n", reboot_reason);
+
+	return 0;
+}
+
+void reset_cpu(ulong addr)
+{
+	struct pt_regs regs;
+
+	regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_RESET;
+	regs.regs[1] = reboot_reason;
+
+	printf("Rebooting with reason: 0x%lx\n", regs.regs[1]);
+
+	smc_call(&regs);
+
+	while (1)
+		;
+}
+#else
 void reset_cpu(ulong addr)
 {
 	psci_system_reset();
 }
+#endif
Signature · 1 line
2.22.0
#5 lore raw

PATCH RESEND 5/5 configs: sei510: disable PSCI_RESET to support fastboot reboot_flag

In reply to Neil Armstrong

Disable the PSCI_RESET reboot handler to permit handling the reboot flag and calling the PSCI handler with the flag in parameter.

---
 configs/sei510_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/sei510_defconfig +1 -0
index 20534bd6b4..6c89d4a381 100644
@@ -7,6 +7,7 @@ CONFIG_MESON_G12A=y
 CONFIG_DEBUG_UART_BASE=0xff803000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_IDENT_STRING=" sei510"
+# CONFIG_PSCI_RESET is not set
 CONFIG_DEBUG_UART=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_OF_BOARD_SETUP=y
Signature · 1 line
2.22.0