Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f6528e1 authored by Jayachandran C's avatar Jayachandran C Committed by John Crispin
Browse files

MIPS: Netlogic: Add support for built in DTB



Provide a config option to embed a device tree for XLP evaluation
boards. This DTB will be used if the firmware does not pass in a
device tree pointer.

Signed-off-by: default avatarJayachandran C <jayachandranc@netlogicmicro.com>
Patchwork: http://patchwork.linux-mips.org/patch/4103/


Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
parent a9f16821
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -830,6 +830,7 @@ config NLM_XLP_BOARD
	select ZONE_DMA if 64BIT
	select ZONE_DMA if 64BIT
	select SYNC_R4K
	select SYNC_R4K
	select SYS_HAS_EARLY_PRINTK
	select SYS_HAS_EARLY_PRINTK
	select USE_OF
	help
	help
	  This board is based on Netlogic XLP Processor.
	  This board is based on Netlogic XLP Processor.
	  Say Y here if you have a XLP based board.
	  Say Y here if you have a XLP based board.
+15 −0
Original line number Original line Diff line number Diff line
if NLM_XLP_BOARD || NLM_XLR_BOARD

if NLM_XLP_BOARD
config DT_XLP_EVP
	bool "Built-in device tree for XLP EVP/SVP boards"
	default y
	help
	  Add an FDT blob for XLP EVP and SVP boards into the kernel.
	  This DTB will be used if the firmware does not pass in a DTB
          pointer to the kernel.  The corresponding DTS file is at
          arch/mips/netlogic/dts/xlp_evp.dts
endif

config NLM_COMMON
config NLM_COMMON
	bool
	bool

endif
+1 −0
Original line number Original line Diff line number Diff line
obj-$(CONFIG_NLM_COMMON)	+=	common/
obj-$(CONFIG_NLM_COMMON)	+=	common/
obj-$(CONFIG_CPU_XLR)		+=	xlr/
obj-$(CONFIG_CPU_XLR)		+=	xlr/
obj-$(CONFIG_CPU_XLP)		+=	xlp/
obj-$(CONFIG_CPU_XLP)		+=	xlp/
obj-$(CONFIG_CPU_XLP)		+=	dts/
+4 −0
Original line number Original line Diff line number Diff line
obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o

$(obj)/%.dtb: $(obj)/%.dts
	$(call if_changed,dtc)
+11 −1
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ unsigned long nlm_common_ebase = 0x0;
/* default to uniprocessor */
/* default to uniprocessor */
uint32_t nlm_coremask = 1, nlm_cpumask  = 1;
uint32_t nlm_coremask = 1, nlm_cpumask  = 1;
int  nlm_threads_per_core = 1;
int  nlm_threads_per_core = 1;
extern u32 __dtb_start[];


static void nlm_linux_exit(void)
static void nlm_linux_exit(void)
{
{
@@ -97,9 +98,18 @@ void __init prom_init(void)
{
{
	void *fdtp;
	void *fdtp;


	fdtp = (void *)(long)fw_arg0;
	xlp_mmu_init();
	xlp_mmu_init();
	nlm_hal_init();
	nlm_hal_init();

	/*
	 * If no FDT pointer is passed in, use the built-in FDT.
	 * device_tree_init() does not handle CKSEG0 pointers in
	 * 64-bit, so convert pointer.
	 */
	fdtp = (void *)(long)fw_arg0;
	if (!fdtp)
		fdtp = __dtb_start;
	fdtp = phys_to_virt(__pa(fdtp));
	early_init_devtree(fdtp);
	early_init_devtree(fdtp);


	nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));
	nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1));