m68k: add mcf5307 cpu support

Add Freescale MCF5307 cpu support.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
This commit is contained in:
angelo@sysam.it 2015-02-12 01:40:00 +01:00 committed by Tom Rini
parent 06fd66a4aa
commit e77e65dfc2
12 changed files with 742 additions and 2 deletions

View file

@ -15,7 +15,8 @@
#define CONFIG_CF_V2
#endif
#if defined(CONFIG_MCF532x) || defined(CONFIG_MCF5301x)
#if defined(CONFIG_MCF530x) || defined(CONFIG_MCF532x) || \
defined(CONFIG_MCF5301x)
#define CONFIG_CF_V3
#endif

View file

@ -240,6 +240,30 @@
#endif
#endif /* CONFIG_M5282 */
#ifdef CONFIG_M5307
#include <asm/immap_5307.h>
#include <asm/m5307.h>
#define CONFIG_SYS_UART_BASE (MMAP_UART0 + \
(CONFIG_SYS_UART_PORT * 0x40))
#define CONFIG_SYS_INTR_BASE (MMAP_INTC)
#define CONFIG_SYS_NUM_IRQS (64)
/* Timer */
#ifdef CONFIG_MCFTMR
#define CONFIG_SYS_UDELAY_BASE (MMAP_DTMR0)
#define CONFIG_SYS_TMR_BASE (MMAP_DTMR1)
#define CONFIG_SYS_TMRPND_REG (((volatile intctrl_t *) \
(CONFIG_SYS_INTR_BASE))->ipr)
#define CONFIG_SYS_TMRINTR_NO (31)
#define CONFIG_SYS_TMRINTR_MASK (0x00000400)
#define CONFIG_SYS_TMRINTR_PEND (CONFIG_SYS_TMRINTR_MASK)
#define CONFIG_SYS_TMRINTR_PRI (MCFSIM_ICR_AUTOVEC | \
MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3)
#define CONFIG_SYS_TIMER_PRESCALER (((gd->bus_clk / 1000000) - 1) << 8)
#endif
#endif /* CONFIG_M5307 */
#if defined(CONFIG_MCF5301x)
#include <asm/immap_5301x.h>
#include <asm/m5301x.h>

View file

@ -0,0 +1,118 @@
/*
* (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
*
* SPDX-License-Identifier: GPL-2.0+
*
*/
#ifndef __IMMAP_5307__
#define __IMMAP_5307__
#define MMAP_SIM (CONFIG_SYS_MBAR + 0x00000000)
#define MMAP_INTC (CONFIG_SYS_MBAR + 0x00000040)
#define MMAP_CSM (CONFIG_SYS_MBAR + 0x00000080)
#define MMAP_DRAMC (CONFIG_SYS_MBAR + 0x00000100)
#define MMAP_DTMR0 (CONFIG_SYS_MBAR + 0x00000140)
#define MMAP_DTMR1 (CONFIG_SYS_MBAR + 0x00000180)
#define MMAP_UART0 (CONFIG_SYS_MBAR + 0x000001C0)
#define MMAP_UART1 (CONFIG_SYS_MBAR + 0x00000200)
#define MMAP_GPIO (CONFIG_SYS_MBAR + 0x00000244)
typedef struct sim {
u8 rsr;
u8 sypcr;
u8 swivr;
u8 swsr;
u16 par;
u8 irqpar;
u8 res1;
u8 pllcr;
u8 res2;
u16 res3;
u8 mpark;
u8 res4;
u16 res5;
u32 res6;
} sim_t;
typedef struct intctrl {
u32 ipr;
u32 imr;
u16 res7;
u8 res8;
u8 avr;
u8 icr0;
u8 icr1;
u8 icr2;
u8 icr3;
u8 icr4;
u8 icr5;
u8 icr6;
u8 icr7;
u8 icr8;
u8 icr9;
u16 res9;
} intctrl_t;
typedef struct csm {
u16 csar0; /* Chip-select Address */
u16 res1;
u32 csmr0; /* Chip-select Mask */
u16 res2;
u16 cscr0; /* Chip-select Control */
u16 csar1;
u16 res3;
u32 csmr1;
u16 res4;
u16 cscr1;
u16 csar2;
u16 res5;
u32 csmr2;
u16 res6;
u16 cscr2;
u16 csar3;
u16 res7;
u32 csmr3;
u16 res8;
u16 cscr3;
u16 csar4;
u16 res9;
u32 csmr4;
u16 res10;
u16 cscr4;
u16 csar5;
u16 res11;
u32 csmr5;
u16 res12;
u16 cscr5;
u16 csar6;
u16 res13;
u32 csmr6;
u16 res14;
u16 cscr6;
u16 csar7;
u16 res15;
u32 csmr7;
u16 res16;
u16 cscr7;
} csm_t;
typedef struct sdramctrl {
u16 dcr;
u16 res1;
u32 res2;
u32 dacr0;
u32 dmr0;
u32 dacr1;
u32 dmr1;
} sdramctrl_t;
typedef struct gpio {
u16 paddr;
u16 res1;
u16 padat;
u16 res2;
} gpio_t;
#endif /* __IMMAP_5307__ */

View file

@ -0,0 +1,70 @@
/*
* (C) Copyright 2014 Angelo Dureghello <angelo@sysam.it>
*
* SPDX-License-Identifier: GPL-2.0+
*
*/
#ifndef mcf5307_h
#define mcf5307_h
/*
* Size of internal RAM (RAMBAR)
*/
#define INT_RAM_SIZE 4096
/* Bit definitions and macros for SYPCR */
#define SYPCR_SWTAVAL 0x02
#define SYPCR_SWTA 0x04
#define SYPCR_SWT(x) ((x&0x3)<<3)
#define SYPCR_SWP 0x20
#define SYPCR_SWRI 0x40
#define SYPCR_SWE 0x80
/* Bit definitions and macros for CSMR */
#define CSMR_V 0x01
#define CSMR_UD 0x02
#define CSMR_UC 0x04
#define CSMR_SD 0x08
#define CSMR_SC 0x10
#define CSMR_CI 0x20
#define CSMR_AM 0x40
#define CSMR_WP 0x100
/* Bit definitions and macros for DACR (SDRAM) */
#define DACR_PM_CONTINUOUS 0x04
#define DACR_IP_PRECHG_ALL 0x08
#define DACR_PORT_SZ_32 0
#define DACR_PORT_SZ_8 (1<<4)
#define DACR_PORT_SZ_16 (2<<4)
#define DACR_IMRS_INIT_CMD (1<<6)
#define DACR_CMD_PIN(x) ((x&7)<<8)
#define DACR_CASL(x) ((x&3)<<12)
#define DACR_RE (1<<15)
/* Bit definitions and macros for CSCR */
#define CSCR_BSTW 0x08
#define CSCR_BSTR 0x10
#define CSCR_BEM 0x20
#define CSCR_PS(x) ((x&0x3)<<6)
#define CSCR_AA 0x100
#define CSCR_WS ((x&0xf)<<10)
/* Bit definitions for the ICR family of registers */
#define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
#define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
#define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
#define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
#define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
#define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
#define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
#define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
#define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
#define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
#define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
#define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
#define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
#endif /* mcf5307_h */

View file

@ -17,7 +17,8 @@
/****************************************************************************/
/* DMA Timer module registers */
typedef struct dtimer_ctrl {
#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5272)
#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || \
defined(CONFIG_M5272) || defined(CONFIG_M5307)
u16 tmr; /* 0x00 Mode register */
u16 res1; /* 0x02 */
u16 trr; /* 0x04 Reference register */