arm: bcmbca: add bcm6858 SoC support under CONFIG_ARCH_BCMBCA

BCM6858 is a Broadcom B53 based PON Gateway SoC. It is part of the BCA
(Broadband Carrier Access origin) chipset family. Like other broadband
SoC, this patch adds it under CONFIG_BCM6858 chip config and
CONFIG_ARCH_BCMBCA platform config.

This initial support includes a bare-bone implementation and the
original dts is updated with the one from linux next git repository.

The u-boot image can be loaded from flash or network to the entry point
address in the memory and boot from there to the console.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
diff --git a/arch/arm/mach-bcmbca/Kconfig b/arch/arm/mach-bcmbca/Kconfig
index f35f02c..5b97773 100644
--- a/arch/arm/mach-bcmbca/Kconfig
+++ b/arch/arm/mach-bcmbca/Kconfig
@@ -93,6 +93,16 @@
 	  Broadcom BCM6856 is a dual core Brahma-B53 ARMv8 based xPON Gateway
 	  SoC. This SoC family includes BCM6856, BCM6836 and BCM4910.
 
+config BCM6858
+	bool "Support for Broadcom 6858 Family"
+	select ARM64
+	select SYS_ARCH_TIMER
+	select DM_SERIAL
+	select BCM6345_SERIAL
+	help
+	  Broadcom BCM6858 is a quad core Brahma-B53 ARMv8 based xPON Gateway
+	  SoC. This SoC family includes BCM6858, BCM49508, BCM5504X and BCM6545.
+
 config BCM6878
 	bool "Support for Broadcom 6878 Family"
 	select SYS_ARCH_TIMER
@@ -112,6 +122,7 @@
 source "arch/arm/mach-bcmbca/bcm6813/Kconfig"
 source "arch/arm/mach-bcmbca/bcm6846/Kconfig"
 source "arch/arm/mach-bcmbca/bcm6856/Kconfig"
+source "arch/arm/mach-bcmbca/bcm6858/Kconfig"
 source "arch/arm/mach-bcmbca/bcm6878/Kconfig"
 
 endif
diff --git a/arch/arm/mach-bcmbca/Makefile b/arch/arm/mach-bcmbca/Makefile
index 20f8275..c068094 100644
--- a/arch/arm/mach-bcmbca/Makefile
+++ b/arch/arm/mach-bcmbca/Makefile
@@ -15,4 +15,5 @@
 obj-$(CONFIG_BCM6813) += bcm6813/
 obj-$(CONFIG_BCM6846) += bcm6846/
 obj-$(CONFIG_BCM6856) += bcm6856/
+obj-$(CONFIG_BCM6858) += bcm6858/
 obj-$(CONFIG_BCM6878) += bcm6878/
diff --git a/arch/arm/mach-bcmbca/bcm6858/Kconfig b/arch/arm/mach-bcmbca/bcm6858/Kconfig
new file mode 100644
index 0000000..a6504ba
--- /dev/null
+++ b/arch/arm/mach-bcmbca/bcm6858/Kconfig
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2022 Broadcom Ltd
+#
+
+if BCM6858
+
+config TARGET_BCM96858
+	bool "Broadcom 6858 Reference Board"
+	depends on ARCH_BCMBCA
+
+config SYS_SOC
+	default "bcm6858"
+
+source "board/broadcom/bcmbca/Kconfig"
+
+endif
diff --git a/arch/arm/mach-bcmbca/bcm6858/Makefile b/arch/arm/mach-bcmbca/bcm6858/Makefile
new file mode 100644
index 0000000..6262497
--- /dev/null
+++ b/arch/arm/mach-bcmbca/bcm6858/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2022 Broadcom Ltd
+#
+obj-y += mmu_table.o
diff --git a/arch/arm/mach-bcmbca/bcm6858/mmu_table.c b/arch/arm/mach-bcmbca/bcm6858/mmu_table.c
new file mode 100644
index 0000000..8982910
--- /dev/null
+++ b/arch/arm/mach-bcmbca/bcm6858/mmu_table.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  Copyright 2022 Broadcom Ltd.
+ */
+#include <common.h>
+#include <asm/armv8/mmu.h>
+#include <linux/sizes.h>
+
+static struct mm_region bcm96858_mem_map[] = {
+		{
+				.virt = 0x00000000UL,
+				.phys = 0x00000000UL,
+				.size = 1UL * SZ_1G,
+				.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+						PTE_BLOCK_INNER_SHARE
+		},
+		{
+				/* SoC peripheral */
+				.virt = 0xff800000UL,
+				.phys = 0xff800000UL,
+				.size = 0x100000,
+				.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+						PTE_BLOCK_NON_SHARE |
+						PTE_BLOCK_PXN | PTE_BLOCK_UXN
+		},
+		{
+				/* List terminator */
+				0,
+		}
+};
+
+struct mm_region *mem_map = bcm96858_mem_map;