mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [RFC 2/4] ARM: add sc6531e and F+ Ezzy 4 phone support
Date: Sat, 10 Jun 2023 13:32:18 +0300	[thread overview]
Message-ID: <20230610103220.566369-3-antonynpavlov@gmail.com> (raw)
In-Reply-To: <20230610103220.566369-1-antonynpavlov@gmail.com>

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/Kconfig                          |  9 +++++
 arch/arm/Makefile                         |  1 +
 arch/arm/boards/Makefile                  |  1 +
 arch/arm/boards/ezzy-4/Makefile           |  3 ++
 arch/arm/boards/ezzy-4/env/init/automount | 27 +++++++++++++
 arch/arm/boards/ezzy-4/lowlevel.c         | 19 +++++++++
 arch/arm/configs/ezzy-4_defconfig         | 49 +++++++++++++++++++++++
 arch/arm/dts/Makefile                     |  1 +
 arch/arm/dts/ezzy-4.dts                   | 22 ++++++++++
 arch/arm/mach-sc6531e/Kconfig             | 17 ++++++++
 arch/arm/mach-sc6531e/Makefile            |  3 ++
 11 files changed, 152 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e76ee0f6dfe..b46d73f5084 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -84,6 +84,14 @@ config ARCH_DIGIC
 	help
 	  Support for Canon's digital cameras that use the DIGIC4 chip.
 
+config ARCH_SC6531E
+	bool "SC6531E-based devices"
+	depends on 32BIT
+	select CPU_ARM926T
+	select GPIOLIB
+	help
+	  Support for feature phones based on the SC6531E chipset.
+
 config ARCH_EP93XX
 	bool "Cirrus Logic EP93xx"
 	depends on 32BIT
@@ -330,6 +338,7 @@ source "arch/arm/mach-nomadik/Kconfig"
 source "arch/arm/mach-omap/Kconfig"
 source "arch/arm/mach-pxa/Kconfig"
 source "arch/arm/mach-rockchip/Kconfig"
+source "arch/arm/mach-sc6531e/Kconfig"
 source "arch/arm/mach-socfpga/Kconfig"
 source "arch/arm/mach-stm32mp/Kconfig"
 source "arch/arm/mach-versatile/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 2208b071ac1..96a32aca8b4 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -104,6 +104,7 @@ machine-$(CONFIG_ARCH_OMAP)		+= omap
 machine-$(CONFIG_ARCH_PXA)		+= pxa
 machine-$(CONFIG_ARCH_ROCKCHIP)		+= rockchip
 machine-$(CONFIG_ARCH_SAMSUNG)		+= samsung
+machine-$(CONFIG_ARCH_SC6531E)		+= sc6531e
 machine-$(CONFIG_ARCH_SOCFPGA)		+= socfpga
 machine-$(CONFIG_ARCH_STM32MP)		+= stm32mp
 machine-$(CONFIG_ARCH_VERSATILE)	+= versatile
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 2877debad53..8abd8872757 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_MACH_EMBEST_MARSBOARD)		+= embest-marsboard/
 obj-$(CONFIG_MACH_EMBEST_RIOTBOARD)		+= embest-riotboard/
 obj-$(CONFIG_MACH_ELTEC_HIPERCAM)		+= eltec-hipercam/
 obj-y						+= freescale-mx51-babbage/
+obj-$(CONFIG_MACH_EZZY4)			+= ezzy-4/
 obj-$(CONFIG_MACH_FREESCALE_MX53_LOCO)		+= freescale-mx53-qsb/
 obj-$(CONFIG_MACH_FREESCALE_MX53_VMX53)		+= freescale-mx53-vmx53/
 obj-$(CONFIG_MACH_FREESCALE_MX7_SABRESD)	+= freescale-mx7-sabresd/
diff --git a/arch/arm/boards/ezzy-4/Makefile b/arch/arm/boards/ezzy-4/Makefile
new file mode 100644
index 00000000000..458f5209008
--- /dev/null
+++ b/arch/arm/boards/ezzy-4/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/ezzy-4/env/init/automount b/arch/arm/boards/ezzy-4/env/init/automount
new file mode 100644
index 00000000000..6be2b6508a0
--- /dev/null
+++ b/arch/arm/boards/ezzy-4/env/init/automount
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+version
+echo
+help
+echo
+cpuinfo
+echo
+iomem
+echo
+meminfo
+echo
+of_dump
+echo
+drvinfo
+echo
+
+timeout 3
+echo
+
+echo sleep 0
+sleep 1
+echo sleep 1
+sleep 1
+echo sleep 2
+sleep 1
+echo sleep 3
diff --git a/arch/arm/boards/ezzy-4/lowlevel.c b/arch/arm/boards/ezzy-4/lowlevel.c
new file mode 100644
index 00000000000..e06ac493bc6
--- /dev/null
+++ b/arch/arm/boards/ezzy-4/lowlevel.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+extern char __dtb_ezzy_4_start[];
+
+void __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
+{
+	void *fdt;
+
+	arm_cpu_lowlevel_init();
+
+	fdt = __dtb_ezzy_4_start + get_runtime_offset();
+
+	barebox_arm_entry(0x14000000, SZ_4M, fdt);
+}
diff --git a/arch/arm/configs/ezzy-4_defconfig b/arch/arm/configs/ezzy-4_defconfig
new file mode 100644
index 00000000000..4701f78fc6a
--- /dev/null
+++ b/arch/arm/configs/ezzy-4_defconfig
@@ -0,0 +1,49 @@
+CONFIG_TEXT_BASE=0x14300000
+CONFIG_ARCH_SC6531E=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_PBL_IMAGE=y
+CONFIG_IMAGE_COMPRESSION_NONE=y
+CONFIG_MALLOC_SIZE=0x100000
+CONFIG_PROMPT="ezzy-4 > "
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/ezzy-4/env"
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_INITCALLS=y
+CONFIG_DEBUG_PBL=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_MEMINFO=y
+# CONFIG_CMD_BOOTM is not set
+# CONFIG_CMD_BOOTU is not set
+CONFIG_CMD_GO=y
+# CONFIG_CMD_MOUNT is not set
+# CONFIG_CMD_UMOUNT is not set
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_MD5SUM=y
+# CONFIG_CMD_PWD is not set
+CONFIG_CMD_SHA1SUM=y
+CONFIG_CMD_LET=y
+CONFIG_CMD_MSLEEP=y
+CONFIG_CMD_SLEEP=y
+# CONFIG_CMD_CLEAR is not set
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_MM=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_LED=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_UPTIME=y
+CONFIG_OFDEVICE=y
+# CONFIG_SPI is not set
+CONFIG_CLOCKSOURCE_DUMMY_RATE=2000
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_GPIO_OF=y
+CONFIG_ZLIB=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 98f4c4e0194..ef21d1ab60c 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -8,6 +8,7 @@ lwl-$(CONFIG_MACH_ADVANTECH_ROM_742X) += imx6dl-advantech-rom-7421.dtb.o
 lwl-$(CONFIG_MACH_AFI_GF) += am335x-afi-gf.dtb.o
 lwl-$(CONFIG_MACH_BEAGLEBONE) += am335x-bone.dtb.o am335x-boneblack.dtb.o am335x-bone-common.dtb.o
 lwl-$(CONFIG_MACH_CANON_A1100) += canon-a1100.dtb.o
+lwl-$(CONFIG_MACH_EZZY4) += ezzy-4.dtb.o
 lwl-$(CONFIG_MACH_CLEP7212) += ep7212-clep7212.dtb.o
 lwl-$(CONFIG_MACH_CM_FX6) += imx6dl-cm-fx6.dtb.o imx6q-cm-fx6.dtb.o imx6q-utilite.dtb.o
 lwl-$(CONFIG_MACH_DFI_FS700_M60) += imx6q-dfi-fs700-m60-6q.dtb.o imx6dl-dfi-fs700-m60-6s.dtb.o
diff --git a/arch/arm/dts/ezzy-4.dts b/arch/arm/dts/ezzy-4.dts
new file mode 100644
index 00000000000..7b326bb23c8
--- /dev/null
+++ b/arch/arm/dts/ezzy-4.dts
@@ -0,0 +1,22 @@
+/dts-v1/;
+
+/ {
+	model = "F+ Ezzy 4";
+	compatible = "f+,ezzy-4";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	chosen { };
+
+	memory {
+		device_type = "memory";
+		reg = <0x14000000 0x00400000>;
+	};
+
+	timer: timer@81003000 {
+		compatible = "sc6531e-timer";
+		reg = <0x81003000 0x100>;
+		status = "okay";
+	};
+};
diff --git a/arch/arm/mach-sc6531e/Kconfig b/arch/arm/mach-sc6531e/Kconfig
new file mode 100644
index 00000000000..f0c4b16550c
--- /dev/null
+++ b/arch/arm/mach-sc6531e/Kconfig
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+if ARCH_SC6531E
+
+choice
+	prompt "board type"
+
+config MACH_EZZY4
+	bool "F+ Ezzy 4"
+
+endchoice
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x00001900 if MACH_EZZY4
+
+endif
diff --git a/arch/arm/mach-sc6531e/Makefile b/arch/arm/mach-sc6531e/Makefile
new file mode 100644
index 00000000000..1c2b374603c
--- /dev/null
+++ b/arch/arm/mach-sc6531e/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj- := __dummy__.o
-- 
2.39.0




  parent reply	other threads:[~2023-06-10 10:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10 10:32 [RFC 0/4] Run barebox on sc6531e-based feature phone Antony Pavlov
2023-06-10 10:32 ` [RFC 1/4] clocksource: add sc6531e driver Antony Pavlov
2023-06-10 10:32 ` Antony Pavlov [this message]
2023-06-10 10:32 ` [RFC 3/4] sc6531e: add debug_ll support Antony Pavlov
2023-06-10 10:32 ` [RFC 4/4] Documentation: add sc6531e instructions Antony Pavlov
2023-07-04 12:03 ` [RFC 0/4] Run barebox on sc6531e-based feature phone Sascha Hauer
2023-07-05  9:37   ` Antony Pavlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230610103220.566369-3-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox