From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 15/19] ARM: Add ls1028a lowlevel init
Date: Thu, 4 Jan 2024 15:17:42 +0100 [thread overview]
Message-ID: <20240104141746.165014-16-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240104141746.165014-1-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-layerscape/Makefile | 2 +
arch/arm/mach-layerscape/lowlevel-ls1028a.c | 42 +++++++++++++++++++++
include/mach/layerscape/layerscape.h | 7 ++++
3 files changed, 51 insertions(+)
create mode 100644 arch/arm/mach-layerscape/lowlevel-ls1028a.c
diff --git a/arch/arm/mach-layerscape/Makefile b/arch/arm/mach-layerscape/Makefile
index 8f288851ff..e4bb1b42f2 100644
--- a/arch/arm/mach-layerscape/Makefile
+++ b/arch/arm/mach-layerscape/Makefile
@@ -12,3 +12,5 @@ obj-$(CONFIG_BOOTM) += pblimage.o
lwl-$(CONFIG_ARCH_LS1021) += lowlevel-ls102xa.o
obj-$(CONFIG_ARCH_LS1021) += restart.o ls102xa_stream_id.o
+
+lwl-$(CONFIG_ARCH_LS1028) += lowlevel-ls1028a.o
diff --git a/arch/arm/mach-layerscape/lowlevel-ls1028a.c b/arch/arm/mach-layerscape/lowlevel-ls1028a.c
new file mode 100644
index 0000000000..fd013b2b52
--- /dev/null
+++ b/arch/arm/mach-layerscape/lowlevel-ls1028a.c
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0+
+#include <common.h>
+#include <io.h>
+#include <asm/syscounter.h>
+#include <asm/system.h>
+#include <mach/layerscape/errata.h>
+#include <mach/layerscape/lowlevel.h>
+#include <soc/fsl/immap_lsch3.h>
+#include <soc/fsl/scfg.h>
+
+static void ls1028a_timer_init(void)
+{
+ u32 __iomem *cntcr = IOMEM(LSCH3_TIMER_ADDR);
+ u32 __iomem *cltbenr = IOMEM(LSCH3_PMU_CLTBENR);
+
+ u32 __iomem *pctbenr = IOMEM(LSCH3_PCTBENR_OFFSET);
+
+ /* Enable timebase for all clusters.
+ * It is safe to do so even some clusters are not enabled.
+ */
+ out_le32(cltbenr, 0xf);
+
+ /*
+ * In certain Layerscape SoCs, the clock for each core's
+ * has an enable bit in the PMU Physical Core Time Base Enable
+ * Register (PCTBENR), which allows the watchdog to operate.
+ */
+ setbits_le32(pctbenr, 0xff);
+
+ /* Enable clock for timer
+ * This is a global setting.
+ */
+ out_le32(cntcr, 0x1);
+}
+
+void ls1028a_init_lowlevel(void)
+{
+ scfg_init(SCFG_ENDIANESS_LITTLE);
+ set_cntfrq(25000000);
+ ls1028a_timer_init();
+ ls1028a_errata();
+}
diff --git a/include/mach/layerscape/layerscape.h b/include/mach/layerscape/layerscape.h
index c3dfe4d860..95c230b8f3 100644
--- a/include/mach/layerscape/layerscape.h
+++ b/include/mach/layerscape/layerscape.h
@@ -9,6 +9,13 @@
#define LS1021A_DDR_SDRAM_BASE 0x80000000
#define LS1021A_DDR_FREQ 1600000000
+#define LS1028A_DDR_SDRAM_BASE 0x80000000
+#define LS1028A_DDR_SDRAM_LOWMEM_SIZE 0x80000000
+#define LS1028A_DDR_SDRAM_HIGHMEM_BASE 0x2080000000
+#define LS1028A_SECURE_DRAM_SIZE SZ_64M
+#define LS1028A_SP_SHARED_DRAM_SIZE SZ_2M
+#define LS1028A_TZC400_BASE 0x01100000
+
enum bootsource ls1046a_bootsource_get(void);
enum bootsource ls1021a_bootsource_get(void);
--
2.39.2
next prev parent reply other threads:[~2024-01-04 14:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 14:17 [PATCH 00/19] ARM: add Layerscape LS1028a support Sascha Hauer
2024-01-04 14:17 ` [PATCH 01/19] soc/fsl: import immap_lsch3 from U-Boot Sascha Hauer
2024-01-04 14:17 ` [PATCH 02/19] soc/fsl/immap_lsch2.h: cleanup Sascha Hauer
2024-01-04 14:17 ` [PATCH 03/19] ARM: layerscape: decide SCFG endianess during runtime Sascha Hauer
2024-01-04 14:17 ` [PATCH 04/19] ARM: layerscape: cleanup erratum_a009007 Sascha Hauer
2024-01-04 14:17 ` [PATCH 05/19] ARM: layerscape: cleanup erratum_a008997 Sascha Hauer
2024-01-04 14:17 ` [PATCH 06/19] ARM: layerscape: cleanup erratum_a009798 Sascha Hauer
2024-01-04 14:17 ` [PATCH 07/19] ARM: layerscape: drop wrong errata workaround Sascha Hauer
2024-01-04 14:17 ` [PATCH 08/19] ARM: layerscape: cleanup erratum_a009008 Sascha Hauer
2024-01-29 17:27 ` Uwe Kleine-König
2024-01-04 14:17 ` [PATCH 09/19] ARM: Layerscape: pass base addresses to errata functions Sascha Hauer
2024-01-04 14:17 ` [PATCH 10/19] ARM: Layerscape: add layerscape_uart_putc() Sascha Hauer
2024-01-04 14:17 ` [PATCH 11/19] ARM: layerscape: implement ls1028a errata Sascha Hauer
2024-01-04 14:17 ` [PATCH 12/19] ARM: layerscape: implement ls1028a debug_ll Sascha Hauer
2024-01-04 14:17 ` [PATCH 13/19] include: <asm-generic/bug.h>: implement ASSERT() Sascha Hauer
2024-01-04 14:17 ` [PATCH 14/19] ARM: Layerscape: add tzc400 support Sascha Hauer
2024-01-29 17:32 ` Uwe Kleine-König
2024-01-04 14:17 ` Sascha Hauer [this message]
2024-01-04 14:17 ` [PATCH 16/19] ARM: atf: add bl31 v2 calling method Sascha Hauer
2024-01-04 14:17 ` [PATCH 17/19] mci: imx-esdhc-pbl: factor out common function Sascha Hauer
2024-01-04 14:17 ` [PATCH 18/19] mci: imx-esdhc-pbl: implement esdhc xload for ls1028a Sascha Hauer
2024-01-29 17:36 ` Uwe Kleine-König
2024-01-30 7:11 ` Sascha Hauer
2024-01-04 14:17 ` [PATCH 19/19] ARM: Layerscape: add basic support for NXP LS1028a RDB Sascha Hauer
2024-01-04 16:32 ` Uwe Kleine-König
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=20240104141746.165014-16-s.hauer@pengutronix.de \
--to=s.hauer@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