1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * arch/xtensa/platform-iss/setup.c
6 * Platform specific initialization.
8 * Authors: Chris Zankel <chris@zankel.net>
9 * Joe Taylor <joe@tensilica.com>
11 * Copyright 2001 - 2005 Tensilica Inc.
12 * Copyright 2017 Cadence Design Systems Inc.
14 #include <linux/memblock.h>
15 #include <linux/stddef.h>
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/errno.h>
19 #include <linux/reboot.h>
20 #include <linux/kdev_t.h>
21 #include <linux/types.h>
22 #include <linux/major.h>
23 #include <linux/blkdev.h>
24 #include <linux/console.h>
25 #include <linux/delay.h>
26 #include <linux/stringify.h>
27 #include <linux/notifier.h>
29 #include <asm/platform.h>
30 #include <asm/bootparam.h>
31 #include <asm/setup.h>
33 #include <platform/simcall.h>
36 void __init
platform_init(bp_tag_t
* bootparam
)
40 void platform_halt(void)
42 pr_info(" ** Called platform_halt() **\n");
46 void platform_power_off(void)
48 pr_info(" ** Called platform_power_off() **\n");
51 void platform_restart(void)
53 /* Flush and reset the mmu, simulate a processor reset, and
54 * jump to the reset vector. */
56 /* control never gets here */
59 void platform_heartbeat(void)
64 iss_panic_event(struct notifier_block
*this, unsigned long event
, void *ptr
)
70 static struct notifier_block iss_panic_block
= {
71 .notifier_call
= iss_panic_event
,
74 void __init
platform_setup(char **p_cmdline
)
76 static void *argv
[COMMAND_LINE_SIZE
/ sizeof(void *)] __initdata
;
77 static char cmdline
[COMMAND_LINE_SIZE
] __initdata
;
78 int argc
= simc_argc();
79 int argv_size
= simc_argv_size();
82 if (argv_size
> sizeof(argv
)) {
83 pr_err("%s: command line too long: argv_size = %d\n",
89 simc_argv((void *)argv
);
91 for (i
= 1; i
< argc
; ++i
) {
94 strcat(cmdline
, argv
[i
]);
100 atomic_notifier_chain_register(&panic_notifier_list
, &iss_panic_block
);