2013-08-03 14:40:59 +02:00
|
|
|
#include <assert.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <machine/cpu.h>
|
|
|
|
#include <minix/type.h>
|
2013-12-13 14:12:50 +01:00
|
|
|
#include <minix/board.h>
|
2013-08-03 14:40:59 +02:00
|
|
|
#include <io.h>
|
|
|
|
|
|
|
|
#include "kernel/kernel.h"
|
|
|
|
#include "kernel/proc.h"
|
|
|
|
#include "kernel/vm.h"
|
|
|
|
#include "kernel/proto.h"
|
|
|
|
#include "arch_proto.h"
|
|
|
|
#include "omap_reset.h"
|
|
|
|
|
2013-12-13 14:12:50 +01:00
|
|
|
#define AM335X_CM_BASE 0x44E00000
|
|
|
|
#define AM335X_CM_SIZE 0x1000
|
|
|
|
|
|
|
|
#define AM335X_PRM_DEVICE_OFFSET 0xf00
|
|
|
|
#define AM335X_PRM_RSTCTRL_REG 0x00
|
|
|
|
#define AM335X_RST_GLOBAL_WARM_SW_BIT 0
|
|
|
|
|
|
|
|
#define DM37XX_CM_BASE 0x48307000
|
|
|
|
#define DM37XX_CM_SIZE 0x1000
|
|
|
|
#define DM37XX_PRM_RSTCTRL_REG 0x250
|
|
|
|
#define DM37XX_RST_DPLL3_BIT 2
|
2013-08-03 14:40:59 +02:00
|
|
|
|
|
|
|
struct omap_reset
|
|
|
|
{
|
|
|
|
vir_bytes base;
|
|
|
|
vir_bytes size;
|
|
|
|
};
|
|
|
|
|
2013-12-13 14:12:50 +01:00
|
|
|
static struct omap_reset omap_reset;
|
2013-08-03 14:40:59 +02:00
|
|
|
|
|
|
|
static kern_phys_map reset_phys_map;
|
|
|
|
|
|
|
|
void
|
|
|
|
omap3_reset_init(void)
|
|
|
|
{
|
2013-12-17 16:20:37 +01:00
|
|
|
if(BOARD_IS_BBXM(machine.board_id)) {
|
2013-12-13 14:12:50 +01:00
|
|
|
omap_reset.base = DM37XX_CM_BASE;
|
|
|
|
omap_reset.size = DM37XX_CM_SIZE;
|
2013-12-17 16:20:37 +01:00
|
|
|
} else if(BOARD_IS_BB(machine.board_id)) {
|
2013-12-13 14:12:50 +01:00
|
|
|
omap_reset.base = AM335X_CM_BASE;
|
|
|
|
omap_reset.size = AM335X_CM_SIZE;
|
|
|
|
}
|
|
|
|
|
2013-08-03 14:40:59 +02:00
|
|
|
kern_phys_map_ptr(omap_reset.base, omap_reset.size, &reset_phys_map,
|
2013-08-26 18:43:05 +02:00
|
|
|
(vir_bytes) &omap_reset.base);
|
2013-08-03 14:40:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
omap3_reset(void)
|
|
|
|
{
|
2013-12-17 16:20:37 +01:00
|
|
|
if(BOARD_IS_BBXM(machine.board_id)) {
|
2013-12-13 14:12:50 +01:00
|
|
|
mmio_set((omap_reset.base + DM37XX_PRM_RSTCTRL_REG), (1 << DM37XX_RST_DPLL3_BIT));
|
2013-12-17 16:20:37 +01:00
|
|
|
} else if(BOARD_IS_BB(machine.board_id)) {
|
2013-12-13 14:12:50 +01:00
|
|
|
mmio_set((omap_reset.base + AM335X_PRM_DEVICE_OFFSET + AM335X_PRM_RSTCTRL_REG), (1 << AM335X_RST_GLOBAL_WARM_SW_BIT));
|
|
|
|
}
|
2013-08-03 14:40:59 +02:00
|
|
|
}
|