Skip to content

Commit

Permalink
ARM: mxs: remove system.c
Browse files Browse the repository at this point in the history
There is no user of function mxs_reset_block() now.  Let's move
mxs_restart() into mach-mxs.c as a static function and remove system.c
completely.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
  • Loading branch information
Shawn Guo committed Apr 1, 2013
1 parent 8f7cf88 commit 974a9af
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 140 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-mxs/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Common support
obj-y := ocotp.o system.o mm.o
obj-y := ocotp.o mm.o

obj-$(CONFIG_PM) += pm.o

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-mxs/include/mach/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#define __MACH_MXS_COMMON_H__

extern const u32 *mxs_get_ocotp(void);
extern int mxs_reset_block(void __iomem *);
extern void mxs_restart(char, const char *);
extern int mxs_saif_clkmux_select(unsigned int clkmux);

extern int mx23_clocks_init(void);
Expand Down
37 changes: 37 additions & 0 deletions arch/arm/mach-mxs/mach-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
#include <linux/irqchip/mxs.h>
#include <linux/micrel_phy.h>
#include <linux/mxsfb.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/phy.h>
#include <linux/pinctrl/consumer.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/system_misc.h>
#include <mach/common.h>
#include <mach/digctl.h>
#include <mach/mxs.h>
Expand Down Expand Up @@ -459,6 +461,41 @@ static void __init mxs_machine_init(void)
imx28_evk_post_init();
}

#define MX23_CLKCTRL_RESET_OFFSET 0x120
#define MX28_CLKCTRL_RESET_OFFSET 0x1e0
#define MXS_CLKCTRL_RESET_CHIP (1 << 1)

/*
* Reset the system. It is called by machine_restart().
*/
static void mxs_restart(char mode, const char *cmd)
{
struct device_node *np;
void __iomem *reset_addr;

np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
reset_addr = of_iomap(np, 0);
if (!reset_addr)
goto soft;

if (of_device_is_compatible(np, "fsl,imx23-clkctrl"))
reset_addr += MX23_CLKCTRL_RESET_OFFSET;
else
reset_addr += MX28_CLKCTRL_RESET_OFFSET;

/* reset the chip */
__mxs_setl(MXS_CLKCTRL_RESET_CHIP, reset_addr);

pr_err("Failed to assert the chip reset\n");

/* Delay to allow the serial port to show the message */
mdelay(50);

soft:
/* We'll take a jump through zero as a poor second */
soft_restart(0);
}

static const char *imx23_dt_compat[] __initdata = {
"fsl,imx23",
NULL,
Expand Down
137 changes: 0 additions & 137 deletions arch/arm/mach-mxs/system.c

This file was deleted.

0 comments on commit 974a9af

Please sign in to comment.