David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
| 4 | * |
| 5 | * This file is based on the arch/mips/ddb5xxx/common/prom.c |
| 6 | * |
| 7 | * Copyright 2001 MontaVista Software Inc. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 8 | */ |
| 9 | #include <linux/init.h> |
| 10 | #include <linux/mm.h> |
| 11 | #include <linux/sched.h> |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 12 | #include <linux/memblock.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 13 | |
| 14 | #include <asm/addrspace.h> |
| 15 | #include <asm/bootinfo.h> |
| 16 | #include <asm/emma/emma2rh.h> |
| 17 | |
| 18 | const char *get_system_type(void) |
| 19 | { |
| 20 | #ifdef CONFIG_NEC_MARKEINS |
| 21 | return "NEC EMMA2RH Mark-eins"; |
| 22 | #else |
| 23 | #error Unknown NEC board |
| 24 | #endif |
| 25 | } |
| 26 | |
| 27 | /* [jsun@junsun.net] PMON passes arguments in C main() style */ |
| 28 | void __init prom_init(void) |
| 29 | { |
| 30 | int argc = fw_arg0; |
| 31 | char **arg = (char **)fw_arg1; |
| 32 | int i; |
| 33 | |
| 34 | /* if user passes kernel args, ignore the default one */ |
| 35 | if (argc > 1) |
| 36 | arcs_cmdline[0] = '\0'; |
| 37 | |
| 38 | /* arg[0] is "g", the rest is boot parameters */ |
| 39 | for (i = 1; i < argc; i++) { |
| 40 | if (strlen(arcs_cmdline) + strlen(arg[i]) + 1 |
| 41 | >= sizeof(arcs_cmdline)) |
| 42 | break; |
| 43 | strcat(arcs_cmdline, arg[i]); |
| 44 | strcat(arcs_cmdline, " "); |
| 45 | } |
| 46 | |
| 47 | #ifdef CONFIG_NEC_MARKEINS |
| 48 | add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM); |
| 49 | #else |
| 50 | #error Unknown NEC board |
| 51 | #endif |
| 52 | } |
| 53 | |
| 54 | void __init prom_free_prom_memory(void) |
| 55 | { |
| 56 | } |