microblaze: consolidate GPIO reset handling

Now that platform.c only has the GPIO reset handling left, move the
initcall to reset.c and remove platform.c.

Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Rob Herring 2018-06-19 15:36:20 -06:00 committed by Michal Simek
parent 2dbeb7040a
commit 45df561a7a
4 changed files with 7 additions and 30 deletions

View File

@ -23,8 +23,6 @@ extern char *klimit;
extern void mmu_reset(void); extern void mmu_reset(void);
# endif /* CONFIG_MMU */ # endif /* CONFIG_MMU */
extern void of_platform_reset_gpio_probe(void);
void time_init(void); void time_init(void);
void init_IRQ(void); void init_IRQ(void);
void machine_early_init(const char *cmdline, unsigned int ram, void machine_early_init(const char *cmdline, unsigned int ram,

View File

@ -16,7 +16,7 @@ extra-y := head.o vmlinux.lds
obj-y += dma.o exceptions.o \ obj-y += dma.o exceptions.o \
hw_exception_handler.o irq.o \ hw_exception_handler.o irq.o \
platform.o process.o prom.o ptrace.o \ process.o prom.o ptrace.o \
reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o
obj-y += cpu/ obj-y += cpu/

View File

@ -1,22 +0,0 @@
/*
* Copyright 2008 Michal Simek <monstr@monstr.eu>
*
* based on virtex.c file
*
* Copyright 2007 Secret Lab Technologies Ltd.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*/
#include <linux/init.h>
#include <linux/of_platform.h>
#include <asm/setup.h>
static int __init microblaze_device_probe(void)
{
of_platform_reset_gpio_probe();
return 0;
}
device_initcall(microblaze_device_probe);

View File

@ -18,7 +18,7 @@
static int handle; /* reset pin handle */ static int handle; /* reset pin handle */
static unsigned int reset_val; static unsigned int reset_val;
void of_platform_reset_gpio_probe(void) static int of_platform_reset_gpio_probe(void)
{ {
int ret; int ret;
handle = of_get_named_gpio(of_find_node_by_path("/"), handle = of_get_named_gpio(of_find_node_by_path("/"),
@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void)
if (!gpio_is_valid(handle)) { if (!gpio_is_valid(handle)) {
pr_info("Skipping unavailable RESET gpio %d (%s)\n", pr_info("Skipping unavailable RESET gpio %d (%s)\n",
handle, "reset"); handle, "reset");
return; return -ENODEV;
} }
ret = gpio_request(handle, "reset"); ret = gpio_request(handle, "reset");
if (ret < 0) { if (ret < 0) {
pr_info("GPIO pin is already allocated\n"); pr_info("GPIO pin is already allocated\n");
return; return ret;
} }
/* get current setup value */ /* get current setup value */
@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void)
pr_info("RESET: Registered gpio device: %d, current val: %d\n", pr_info("RESET: Registered gpio device: %d, current val: %d\n",
handle, reset_val); handle, reset_val);
return; return 0;
err: err:
gpio_free(handle); gpio_free(handle);
return; return ret;
} }
device_initcall(of_platform_reset_gpio_probe);
static void gpio_system_reset(void) static void gpio_system_reset(void)