diff mbox series

[U-Boot,2/8] arm: K3: Add support for AM654 SoC definition

Message ID 20180821143055.29012-3-lokeshvutla@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Initial support Texas Instrument's AM654 Platform | expand

Commit Message

Lokesh Vutla Aug. 21, 2018, 2:30 p.m. UTC
The AM654 device is designed for industrial automation and PLC
controller class platforms among other applications. Introduce
base support for AM654 SoC.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-k3/Kconfig              | 31 ++++++++++++++++++++++++++
 arch/arm/mach-k3/Makefile             |  6 +++++
 arch/arm/mach-k3/am6_init.c           | 32 +++++++++++++++++++++++++++
 arch/arm/mach-k3/include/mach/clock.h | 16 ++++++++++++++
 4 files changed, 85 insertions(+)
 create mode 100644 arch/arm/mach-k3/Makefile
 create mode 100644 arch/arm/mach-k3/am6_init.c
 create mode 100644 arch/arm/mach-k3/include/mach/clock.h

Comments

Tom Rini Aug. 24, 2018, 2:11 p.m. UTC | #1
On Tue, Aug 21, 2018 at 08:00:49PM +0530, Lokesh Vutla wrote:

> The AM654 device is designed for industrial automation and PLC
> controller class platforms among other applications. Introduce
> base support for AM654 SoC.
[snip]
> +config NON_SECURE_MSRAM_SIZE
> +	hex "Size of the MCU OC-MSRAM"
> +	default 0x80000
> +	help
> +	  Describes the total size of the MCU MSRAM. This doesn't
> +	  specify the total size of SPL as ROM can use some part
> +	  of this RAM. Once ROM gives control to SPL then this
> +	  complete size can be usable.
> +
> +config MAX_DOWNLODABLE_IMAGE_SIZE
> +	hex "Maximum size of the image"
> +	default 0x58000
> +	help
> +	  Describes the maximum size of the image that ROM can download
> +	  from any boot media.
> +
> +config MCU_SCRATCHPAD_BASE
> +	hex "Base address of Scratchpad RAM"
> +	default 0x40280000 if SOC_K3_AM6
> +	help
> +	  Describes the base address of MCU Scratchpad RAM.
> +
> +config MCU_SCRATCHPAD_SIZE
> +	hex "Size of Scratchpad RAM"
> +	default 0x200 if SOC_K3_AM6
> +	help
> +	  Describes the size of MCU Scratchpad RAM.

These are very generic names.  And are these really things that can be
configured and changed by the user?  MAX_DOWNLODABLE_IMAGE_SIZE is
something we usually set in CONFIG_SPL_MAX_SIZE but I imagine the
overall architecture means that perhaps that's not the exact variable
we're talking about here.
Lokesh Vutla Aug. 24, 2018, 2:58 p.m. UTC | #2
On Friday 24 August 2018 07:41 PM, Tom Rini wrote:
> On Tue, Aug 21, 2018 at 08:00:49PM +0530, Lokesh Vutla wrote:
> 
>> The AM654 device is designed for industrial automation and PLC
>> controller class platforms among other applications. Introduce
>> base support for AM654 SoC.
> [snip]
>> +config NON_SECURE_MSRAM_SIZE
>> +	hex "Size of the MCU OC-MSRAM"
>> +	default 0x80000
>> +	help
>> +	  Describes the total size of the MCU MSRAM. This doesn't
>> +	  specify the total size of SPL as ROM can use some part
>> +	  of this RAM. Once ROM gives control to SPL then this
>> +	  complete size can be usable.
>> +
>> +config MAX_DOWNLODABLE_IMAGE_SIZE
>> +	hex "Maximum size of the image"
>> +	default 0x58000
>> +	help
>> +	  Describes the maximum size of the image that ROM can download
>> +	  from any boot media.
>> +
>> +config MCU_SCRATCHPAD_BASE
>> +	hex "Base address of Scratchpad RAM"
>> +	default 0x40280000 if SOC_K3_AM6
>> +	help
>> +	  Describes the base address of MCU Scratchpad RAM.
>> +
>> +config MCU_SCRATCHPAD_SIZE
>> +	hex "Size of Scratchpad RAM"
>> +	default 0x200 if SOC_K3_AM6
>> +	help
>> +	  Describes the size of MCU Scratchpad RAM.
> 
> These are very generic names.  And are these really things that can be
> configured and changed by the user?  MAX_DOWNLODABLE_IMAGE_SIZE is

You are right. These are not configurable by user, but changes from SoC
to SoC within K3 family. Will fix it in v2 by dropping the prompt string.

Thanks and regards,
Lokesh

> something we usually set in CONFIG_SPL_MAX_SIZE but I imagine the
> overall architecture means that perhaps that's not the exact variable
> we're talking about here.
>
Tom Rini Aug. 24, 2018, 3:01 p.m. UTC | #3
On Fri, Aug 24, 2018 at 08:28:17PM +0530, Lokesh Vutla wrote:
> 
> 
> On Friday 24 August 2018 07:41 PM, Tom Rini wrote:
> > On Tue, Aug 21, 2018 at 08:00:49PM +0530, Lokesh Vutla wrote:
> > 
> >> The AM654 device is designed for industrial automation and PLC
> >> controller class platforms among other applications. Introduce
> >> base support for AM654 SoC.
> > [snip]
> >> +config NON_SECURE_MSRAM_SIZE
> >> +	hex "Size of the MCU OC-MSRAM"
> >> +	default 0x80000
> >> +	help
> >> +	  Describes the total size of the MCU MSRAM. This doesn't
> >> +	  specify the total size of SPL as ROM can use some part
> >> +	  of this RAM. Once ROM gives control to SPL then this
> >> +	  complete size can be usable.
> >> +
> >> +config MAX_DOWNLODABLE_IMAGE_SIZE
> >> +	hex "Maximum size of the image"
> >> +	default 0x58000
> >> +	help
> >> +	  Describes the maximum size of the image that ROM can download
> >> +	  from any boot media.
> >> +
> >> +config MCU_SCRATCHPAD_BASE
> >> +	hex "Base address of Scratchpad RAM"
> >> +	default 0x40280000 if SOC_K3_AM6
> >> +	help
> >> +	  Describes the base address of MCU Scratchpad RAM.
> >> +
> >> +config MCU_SCRATCHPAD_SIZE
> >> +	hex "Size of Scratchpad RAM"
> >> +	default 0x200 if SOC_K3_AM6
> >> +	help
> >> +	  Describes the size of MCU Scratchpad RAM.
> > 
> > These are very generic names.  And are these really things that can be
> > configured and changed by the user?  MAX_DOWNLODABLE_IMAGE_SIZE is
> 
> You are right. These are not configurable by user, but changes from SoC
> to SoC within K3 family. Will fix it in v2 by dropping the prompt string.
> 

Well, the names are also fairly generic.  Why not just #define
SYS_K3_xxx ?
diff mbox series

Patch

diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index 552b84923e..c532fbd061 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -4,9 +4,40 @@  choice
 	prompt "Texas Instruments' K3 based SoC select"
 	optional
 
+config SOC_K3_AM6
+	bool "TI's K3 based AM6 SoC Family Support"
+
 endchoice
 
 config SYS_SOC
 	default "k3"
 
+config NON_SECURE_MSRAM_SIZE
+	hex "Size of the MCU OC-MSRAM"
+	default 0x80000
+	help
+	  Describes the total size of the MCU MSRAM. This doesn't
+	  specify the total size of SPL as ROM can use some part
+	  of this RAM. Once ROM gives control to SPL then this
+	  complete size can be usable.
+
+config MAX_DOWNLODABLE_IMAGE_SIZE
+	hex "Maximum size of the image"
+	default 0x58000
+	help
+	  Describes the maximum size of the image that ROM can download
+	  from any boot media.
+
+config MCU_SCRATCHPAD_BASE
+	hex "Base address of Scratchpad RAM"
+	default 0x40280000 if SOC_K3_AM6
+	help
+	  Describes the base address of MCU Scratchpad RAM.
+
+config MCU_SCRATCHPAD_SIZE
+	hex "Size of Scratchpad RAM"
+	default 0x200 if SOC_K3_AM6
+	help
+	  Describes the size of MCU Scratchpad RAM.
+
 endif
diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile
new file mode 100644
index 0000000000..356fc27b11
--- /dev/null
+++ b/arch/arm/mach-k3/Makefile
@@ -0,0 +1,6 @@ 
+# SPDX-License-Identifier:	GPL-2.0+
+#
+# Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
+#	Lokesh Vutla <lokeshvutla@ti.com>
+
+obj-$(CONFIG_SOC_K3_AM6) += am6_init.o
diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
new file mode 100644
index 0000000000..7a78e85938
--- /dev/null
+++ b/arch/arm/mach-k3/am6_init.c
@@ -0,0 +1,32 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * K3: Architecture initialization
+ *
+ * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
+ *	Lokesh Vutla <lokeshvutla@ti.com>
+ */
+
+#include <common.h>
+#include <spl.h>
+
+#ifdef CONFIG_SPL_BUILD
+void board_init_f(ulong dummy)
+{
+	/* Init DM early in-order to invoke system controller */
+	spl_early_init();
+
+	/* Prepare console output */
+	preloader_console_init();
+}
+
+u32 spl_boot_device(void)
+{
+	return BOOT_DEVICE_RAM;
+}
+#endif
+
+#ifndef CONFIG_SYSRESET
+void reset_cpu(ulong ignored)
+{
+}
+#endif
diff --git a/arch/arm/mach-k3/include/mach/clock.h b/arch/arm/mach-k3/include/mach/clock.h
new file mode 100644
index 0000000000..c4dbacb128
--- /dev/null
+++ b/arch/arm/mach-k3/include/mach/clock.h
@@ -0,0 +1,16 @@ 
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * K3: Common SoC clock definitions.
+ *
+ * (C) Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+ */
+#ifndef __ASM_ARCH_CLOCK_H
+#define __ASM_ARCH_CLOCK_H
+
+#include <config.h>
+
+/* Clock Defines */
+#define V_OSCK				24000000
+#define V_SCLK				V_OSCK
+
+#endif /* __ASM_ARCH_CLOCK_H */