Skip to content

Commit

Permalink
MIPS: ingenic: Add support for appended devicetree
Browse files Browse the repository at this point in the history
Add support for booting the kernel from an externally-appended
devicetree, if no devicetree was built-in.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
  • Loading branch information
Paul Cercueil authored and Paul Burton committed Feb 21, 2019
1 parent 69a07a4 commit 15205fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ config MACH_INGENIC
select GPIOLIB
select COMMON_CLK
select GENERIC_IRQ_CHIP
select BUILTIN_DTB
select BUILTIN_DTB if MIPS_NO_APPENDED_DTB
select USE_OF
select LIBFDT

Expand Down
14 changes: 10 additions & 4 deletions arch/mips/jz4740/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#define JZ4740_EMC_SDRAM_CTRL 0x80


static void __init jz4740_detect_mem(void)
{
void __iomem *jz_emc_base;
Expand Down Expand Up @@ -66,15 +65,22 @@ static unsigned long __init get_board_mach_type(const void *fdt)
void __init plat_mem_setup(void)
{
int offset;
void *dtb;

jz4740_reset_init();
__dt_setup_arch(__dtb_start);

offset = fdt_path_offset(__dtb_start, "/memory");
if (__dtb_start != __dtb_end)
dtb = __dtb_start;
else
dtb = (void *)fw_passed_dtb;

__dt_setup_arch(dtb);

offset = fdt_path_offset(dtb, "/memory");
if (offset < 0)
jz4740_detect_mem();

mips_machtype = get_board_mach_type(__dtb_start);
mips_machtype = get_board_mach_type(dtb);
}

void __init device_tree_init(void)
Expand Down

0 comments on commit 15205fc

Please sign in to comment.