Skip to content

Commit

Permalink
Merge branch 'next/misc2' into for-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Walmsley committed Nov 23, 2019
2 parents 5ba9aa5 + 2cc6c4a commit 8eace9f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
16 changes: 8 additions & 8 deletions arch/riscv/Kconfig.socs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
menu "SoC selection"

config SOC_SIFIVE
bool "SiFive SoCs"
select SERIAL_SIFIVE
select SERIAL_SIFIVE_CONSOLE
select CLK_SIFIVE
select CLK_SIFIVE_FU540_PRCI
select SIFIVE_PLIC
help
This enables support for SiFive SoC platform hardware.
bool "SiFive SoCs"
select SERIAL_SIFIVE
select SERIAL_SIFIVE_CONSOLE
select CLK_SIFIVE
select CLK_SIFIVE_FU540_PRCI
select SIFIVE_PLIC
help
This enables support for SiFive SoC platform hardware.

endmenu
32 changes: 32 additions & 0 deletions arch/riscv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,37 @@ static void setup_zero_page(void)
memset((void *)empty_zero_page, 0, PAGE_SIZE);
}

#ifdef CONFIG_DEBUG_VM
static inline void print_mlk(char *name, unsigned long b, unsigned long t)
{
pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
(((t) - (b)) >> 10));
}

static inline void print_mlm(char *name, unsigned long b, unsigned long t)
{
pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld MB)\n", name, b, t,
(((t) - (b)) >> 20));
}

static void print_vm_layout(void)
{
pr_notice("Virtual kernel memory layout:\n");
print_mlk("fixmap", (unsigned long)FIXADDR_START,
(unsigned long)FIXADDR_TOP);
print_mlm("pci io", (unsigned long)PCI_IO_START,
(unsigned long)PCI_IO_END);
print_mlm("vmemmap", (unsigned long)VMEMMAP_START,
(unsigned long)VMEMMAP_END);
print_mlm("vmalloc", (unsigned long)VMALLOC_START,
(unsigned long)VMALLOC_END);
print_mlm("lowmem", (unsigned long)PAGE_OFFSET,
(unsigned long)high_memory);
}
#else
static void print_vm_layout(void) { }
#endif /* CONFIG_DEBUG_VM */

void __init mem_init(void)
{
#ifdef CONFIG_FLATMEM
Expand All @@ -56,6 +87,7 @@ void __init mem_init(void)
memblock_free_all();

mem_init_print_info(NULL);
print_vm_layout();
}

#ifdef CONFIG_BLK_DEV_INITRD
Expand Down

0 comments on commit 8eace9f

Please sign in to comment.