Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61c8621e authored by Tero Kristo's avatar Tero Kristo Committed by Tony Lindgren
Browse files

ARM: OMAP2+: PRM: provide generic API for system reset



This patch combines the various prm_warm_reset calls under a common
API prm_reset_system, and adds the SoC specific implementation under
prm_ll_data.

Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
Acked-by: default avatarPaul Walmsley <paul@pwsan.com>
Tested-by: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 4984eeaf
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -9,8 +9,7 @@
#include <linux/reboot.h>

#include "common.h"
#include "prm-regbits-33xx.h"
#include "prm33xx.h"
#include "prm.h"

/**
 * am3xx_restart - trigger a software restart of the SoC
@@ -24,5 +23,5 @@ void am33xx_restart(enum reboot_mode mode, const char *cmd)
{
	/* TODO: Handle mode and cmd if necessary */

	am33xx_prm_global_warm_sw_reset();
	omap_prm_reset_system();
}
+2 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@

#include "soc.h"
#include "common.h"
#include "prm2xxx.h"
#include "prm.h"

/*
 * reset_virt_prcm_set_ck, reset_sys_ck: pointers to the virt_prcm_set
@@ -40,8 +40,7 @@ void omap2xxx_restart(enum reboot_mode mode, const char *cmd)

	/* XXX Should save the cmd argument for use after the reboot */

	omap2xxx_prm_dpll_reset(); /* never returns */
	while (1);
	omap_prm_reset_system();
}

/**
+2 −5
Original line number Diff line number Diff line
@@ -14,10 +14,8 @@
#include <linux/init.h>
#include <linux/reboot.h>

#include "iomap.h"
#include "common.h"
#include "control.h"
#include "prm3xxx.h"
#include "prm.h"

/* Global address base setup code */

@@ -32,6 +30,5 @@
void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
{
	omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
	omap3xxx_prm_dpll3_reset(); /* never returns */
	while (1);
	omap_prm_reset_system();
}
+2 −4
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@

#include <linux/types.h>
#include <linux/reboot.h>
#include "prminst44xx.h"
#include "prm.h"

/**
 * omap44xx_restart - trigger a software restart of the SoC
@@ -22,7 +22,5 @@
void omap44xx_restart(enum reboot_mode mode, const char *cmd)
{
	/* XXX Should save 'cmd' into scratchpad for use after reboot */
	omap4_prminst_global_warm_sw_reset(); /* never returns */
	while (1)
		;
	omap_prm_reset_system();
}
+2 −0
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ struct prm_ll_data {
				  u16 offset, u16 st_offset);
	int (*is_hardreset_asserted)(u8 shift, u8 part, s16 prm_mod,
				     u16 offset);
	void (*reset_system)(void);
};

extern int prm_register(struct prm_ll_data *pld);
@@ -156,6 +157,7 @@ int omap_prm_is_hardreset_asserted(u8 shift, u8 part, s16 prm_mod, u16 offset);
extern u32 prm_read_reset_sources(void);
extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx);
extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx);
void omap_prm_reset_system(void);

void omap_prm_reconfigure_io_chain(void);

Loading