mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 16/23] ARM: omap: Add AM35XX support
Date: Fri, 14 Dec 2018 15:17:23 +0100	[thread overview]
Message-ID: <20181214141730.26181-17-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20181214141730.26181-1-s.hauer@pengutronix.de>

Not much to be done here. The AM35xx is very similar to OMAP3.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/Kconfig                    |  6 ++++++
 arch/arm/mach-omap/include/mach/omap3-clock.h |  2 ++
 arch/arm/mach-omap/include/mach/sys_info.h    |  2 ++
 arch/arm/mach-omap/omap3_clock.c              | 14 +++++++++-----
 arch/arm/mach-omap/omap3_generic.c            |  3 +++
 5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 34d37dcd7e..5537f5101a 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -48,6 +48,12 @@ config ARCH_AM33XX
 	help
 	  Say Y here if you are using Texas Instrument's AM33xx based platform
 
+config ARCH_AM35XX
+	bool
+	select ARCH_OMAP3
+	help
+	  Say Y here if you are using Texas Instrument's AM35XX based platform
+
 config OMAP_GPMC
 	prompt "Support for GPMC configuration"
 	bool
diff --git a/arch/arm/mach-omap/include/mach/omap3-clock.h b/arch/arm/mach-omap/include/mach/omap3-clock.h
index 7c52da754f..849964ab3e 100644
--- a/arch/arm/mach-omap/include/mach/omap3-clock.h
+++ b/arch/arm/mach-omap/include/mach/omap3-clock.h
@@ -64,6 +64,8 @@
 #define CM_CLKSEL_CAM		0X0f40
 #define CM_FCLKEN_PER		0X1000
 #define CM_ICLKEN_PER		0X1010
+#define CM_IDLEST_PER		0X1020
+#define CM_AUTOIDLE_PER		0X1030
 #define CM_CLKSEL_PER		0X1040
 #define CM_CLKSEL1_EMU		0X1140
 #define CM_FCLKEN_USBH		0x1400
diff --git a/arch/arm/mach-omap/include/mach/sys_info.h b/arch/arm/mach-omap/include/mach/sys_info.h
index e36f49df8a..57bfb3c680 100644
--- a/arch/arm/mach-omap/include/mach/sys_info.h
+++ b/arch/arm/mach-omap/include/mach/sys_info.h
@@ -43,6 +43,7 @@
 #define CPU_3350	0x3350
 #define CPU_3430	0x3430
 #define CPU_3630	0x3630
+#define CPU_AM35XX	0x3500
 
 /**
  * Define CPU revisions
@@ -84,6 +85,7 @@
 #define OMAP_HAWKEYE_34XX	0xB7AE /* OMAP34xx */
 #define OMAP_HAWKEYE_36XX	0xB891 /* OMAP36xx */
 #define OMAP_HAWKEYE_335X	0xB944 /* AM335x */
+#define OMAP_HAWKEYE_AM35XX	0xb868 /* AM35xx */
 
 /** These are implemented by the System specific code in omapX-generic.c */
 u32 get_cpu_type(void);
diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c
index 6700f56f39..0159574f30 100644
--- a/arch/arm/mach-omap/omap3_clock.c
+++ b/arch/arm/mach-omap/omap3_clock.c
@@ -617,11 +617,12 @@ void prcm_init(void)
 	sr32(OMAP3_CM_REG(CLKEN_PLL_MPU), 0, 3, PLL_LOW_POWER_BYPASS);
 	wait_on_value((0x1 << 0), 0, OMAP3_CM_REG(IDLEST_PLL_MPU), LDELAY);
 
-	if (cpu_type == CPU_3430) {
+	if (cpu_type == CPU_3430 || cpu_type == CPU_AM35XX) {
 		init_core_dpll_34x(cpu_rev, clk_index);
 		init_per_dpll_34x(cpu_rev, clk_index);
 		init_mpu_dpll_34x(cpu_rev, clk_index);
-		init_iva_dpll_34x(cpu_rev, clk_index);
+		if (cpu_type != CPU_AM35XX)
+			init_iva_dpll_34x(cpu_rev, clk_index);
 	}
 	else if (cpu_type == CPU_3630) {
 		init_core_dpll_36x(cpu_rev, clk_index);
@@ -676,7 +677,12 @@ static void per_clocks_enable(void)
 #define ICK_CAM_ON	0x00000001
 #define FCK_PER_ON	0x0003ffff
 #define ICK_PER_ON	0x0003ffff
-	sr32(OMAP3_CM_REG(FCLKEN_IVA2), 0, 32, FCK_IVA2_ON);
+
+	if (get_cpu_type() != CPU_AM35XX) {
+		sr32(OMAP3_CM_REG(FCLKEN_IVA2), 0, 32, FCK_IVA2_ON);
+		sr32(OMAP3_CM_REG(FCLKEN_CAM), 0, 32, FCK_CAM_ON);
+		sr32(OMAP3_CM_REG(ICLKEN_CAM), 0, 32, ICK_CAM_ON);
+	}
 	sr32(OMAP3_CM_REG(FCLKEN1_CORE), 0, 32, FCK_CORE1_ON);
 	sr32(OMAP3_CM_REG(ICLKEN1_CORE), 0, 32, ICK_CORE1_ON);
 	sr32(OMAP3_CM_REG(ICLKEN2_CORE), 0, 32, ICK_CORE2_ON);
@@ -684,8 +690,6 @@ static void per_clocks_enable(void)
 	sr32(OMAP3_CM_REG(ICLKEN_WKUP), 0, 32, ICK_WKUP_ON);
 	sr32(OMAP3_CM_REG(FCLKEN_DSS), 0, 32, FCK_DSS_ON);
 	sr32(OMAP3_CM_REG(ICLKEN_DSS), 0, 32, ICK_DSS_ON);
-	sr32(OMAP3_CM_REG(FCLKEN_CAM), 0, 32, FCK_CAM_ON);
-	sr32(OMAP3_CM_REG(ICLKEN_CAM), 0, 32, ICK_CAM_ON);
 	sr32(OMAP3_CM_REG(FCLKEN_PER), 0, 32, FCK_PER_ON);
 	sr32(OMAP3_CM_REG(ICLKEN_PER), 0, 32, ICK_PER_ON);
 
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index 3f91441d2e..348a00cdff 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -78,6 +78,9 @@ u32 get_cpu_type(void)
 	if (hawkeye == OMAP_HAWKEYE_34XX)
 		return CPU_3430;
 
+	if (hawkeye == OMAP_HAWKEYE_AM35XX)
+		return CPU_AM35XX;
+
 	if (hawkeye == OMAP_HAWKEYE_36XX)
 		return CPU_3630;
 
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-12-14 14:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 14:17 [PATCH 00/23] AM3517 support Sascha Hauer
2018-12-14 14:17 ` [PATCH 01/23] net: davinci-emac: fix buggy channel tear down Sascha Hauer
2018-12-14 14:17 ` [PATCH 02/23] net: davinci-emac: Add timeout to polling loop Sascha Hauer
2018-12-14 14:17 ` [PATCH 03/23] net: davinci-emac: switch to device tree support Sascha Hauer
2018-12-14 14:17 ` [PATCH 04/23] mci: omap: Improve error handling Sascha Hauer
2018-12-14 14:17 ` [PATCH 05/23] mci: omap: use IS_ENABLED() rather than #ifdef Sascha Hauer
2018-12-14 14:17 ` [PATCH 06/23] mtd: nand: omap: Use dev_dbg when a struct device * is available Sascha Hauer
2018-12-14 14:17 ` [PATCH 07/23] mtd: nand: omap: Fix hamming correct return values Sascha Hauer
2018-12-14 14:17 ` [PATCH 08/23] mtd: nand: omap: Disable subpage reads in hardware ecc mode Sascha Hauer
2018-12-14 14:17 ` [PATCH 09/23] mtd: nand: omap: remove unused function argument Sascha Hauer
2018-12-14 14:17 ` [PATCH 10/23] mtd: nand: omap: fix bch8_hw_romcode ecc layout Sascha Hauer
2018-12-14 14:17 ` [PATCH 11/23] mtd: nand: omap: set eccbytes correctly Sascha Hauer
2018-12-14 14:17 ` [PATCH 12/23] mtd: nand: omap: unbreak BCH8 support Sascha Hauer
2018-12-14 14:17 ` [PATCH 13/23] ARM: omap: Add missing include Sascha Hauer
2018-12-14 14:17 ` [PATCH 14/23] ARM: omap: dmtimer: Turn into a driver Sascha Hauer
2018-12-17 13:37   ` Teresa Remmet
2018-12-18  7:46     ` Sascha Hauer
2018-12-14 14:17 ` [PATCH 15/23] ARM: omap: 32ktimer: " Sascha Hauer
2018-12-14 14:17 ` Sascha Hauer [this message]
2018-12-14 14:17 ` [PATCH 17/23] ARM: omap: enable am33xx_uart_soft_reset for AM35xx Sascha Hauer
2018-12-14 14:17 ` [PATCH 18/23] ARM: omap3: Add support for reset reason detection Sascha Hauer
2018-12-14 14:17 ` [PATCH 19/23] ARM: omap: Add AM3517 specific mux configuration Sascha Hauer
2018-12-14 14:17 ` [PATCH 20/23] ARM: omap: Add emif4 support for AM3517 Sascha Hauer
2018-12-14 14:17 ` [PATCH 21/23] ARM: omap: AM3517: Change default clock rate " Sascha Hauer
2018-12-14 14:17 ` [PATCH 22/23] ARM: omap: Add board support for WAGO pfc200 platform Sascha Hauer
2019-01-07 11:40   ` Heinrich.Toews
2019-01-07 11:46     ` Sascha Hauer
2018-12-14 14:17 ` [PATCH 23/23] ARM: omap: am33xx_defconfig: Enable more boards and rename Sascha Hauer
2018-12-14 16:22 ` [PATCH 00/23] AM3517 support Ladislav Michl
2018-12-14 19:32   ` Sascha Hauer

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=20181214141730.26181-17-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