diff options
Diffstat (limited to 'arch/m68k/include/asm')
192 files changed, 6716 insertions, 8667 deletions
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index 1a922fad76f..c67c94a2d67 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -1,2 +1,36 @@ -include include/asm-generic/Kbuild.asm -header-y += cachectl.h +generic-y += barrier.h +generic-y += bitsperlong.h +generic-y += clkdev.h +generic-y += cputime.h +generic-y += device.h +generic-y += emergency-restart.h +generic-y += errno.h +generic-y += exec.h +generic-y += hash.h +generic-y += hw_irq.h +generic-y += ioctl.h +generic-y += ipcbuf.h +generic-y += irq_regs.h +generic-y += kdebug.h +generic-y += kmap_types.h +generic-y += kvm_para.h +generic-y += local.h +generic-y += local64.h +generic-y += mcs_spinlock.h +generic-y += mman.h +generic-y += mutex.h +generic-y += percpu.h +generic-y += preempt.h +generic-y += resource.h +generic-y += scatterlist.h +generic-y += sections.h +generic-y += shmparam.h +generic-y += siginfo.h +generic-y += spinlock.h +generic-y += statfs.h +generic-y += termios.h +generic-y += topology.h +generic-y += trace_clock.h +generic-y += types.h +generic-y += word-at-a-time.h +generic-y += xor.h diff --git a/arch/m68k/include/asm/MC68328.h b/arch/m68k/include/asm/MC68328.h index a337e56d09b..4ebf098b8a1 100644 --- a/arch/m68k/include/asm/MC68328.h +++ b/arch/m68k/include/asm/MC68328.h @@ -293,7 +293,7 @@  /*   * Here go the bitmasks themselves   */ -#define IMR_MSPIM 	(1 << SPIM _IRQ_NUM)	/* Mask SPI Master interrupt */ +#define IMR_MSPIM 	(1 << SPIM_IRQ_NUM)	/* Mask SPI Master interrupt */  #define	IMR_MTMR2	(1 << TMR2_IRQ_NUM)	/* Mask Timer 2 interrupt */  #define IMR_MUART	(1 << UART_IRQ_NUM)	/* Mask UART interrupt */	  #define	IMR_MWDT	(1 << WDT_IRQ_NUM)	/* Mask Watchdog Timer interrupt */ @@ -327,7 +327,7 @@  #define IWR_ADDR	0xfffff308  #define IWR		LONG_REF(IWR_ADDR) -#define IWR_SPIM 	(1 << SPIM _IRQ_NUM)	/* SPI Master interrupt */ +#define IWR_SPIM 	(1 << SPIM_IRQ_NUM)	/* SPI Master interrupt */  #define	IWR_TMR2	(1 << TMR2_IRQ_NUM)	/* Timer 2 interrupt */  #define IWR_UART	(1 << UART_IRQ_NUM)	/* UART interrupt */	  #define	IWR_WDT		(1 << WDT_IRQ_NUM)	/* Watchdog Timer interrupt */ @@ -357,7 +357,7 @@  #define ISR_ADDR	0xfffff30c  #define ISR		LONG_REF(ISR_ADDR) -#define ISR_SPIM 	(1 << SPIM _IRQ_NUM)	/* SPI Master interrupt */ +#define ISR_SPIM 	(1 << SPIM_IRQ_NUM)	/* SPI Master interrupt */  #define	ISR_TMR2	(1 << TMR2_IRQ_NUM)	/* Timer 2 interrupt */  #define ISR_UART	(1 << UART_IRQ_NUM)	/* UART interrupt */	  #define	ISR_WDT		(1 << WDT_IRQ_NUM)	/* Watchdog Timer interrupt */ @@ -391,7 +391,7 @@  #define IPR_ADDR	0xfffff310  #define IPR		LONG_REF(IPR_ADDR) -#define IPR_SPIM 	(1 << SPIM _IRQ_NUM)	/* SPI Master interrupt */ +#define IPR_SPIM 	(1 << SPIM_IRQ_NUM)	/* SPI Master interrupt */  #define	IPR_TMR2	(1 << TMR2_IRQ_NUM)	/* Timer 2 interrupt */  #define IPR_UART	(1 << UART_IRQ_NUM)	/* UART interrupt */	  #define	IPR_WDT		(1 << WDT_IRQ_NUM)	/* Watchdog Timer interrupt */ @@ -757,7 +757,7 @@  /* 'EZ328-compatible definitions */  #define TCN_ADDR	TCN1_ADDR -#define TCN		TCN +#define TCN		TCN1  /*   * Timer Unit 1 and 2 Status Registers diff --git a/arch/m68k/include/asm/MC68332.h b/arch/m68k/include/asm/MC68332.h deleted file mode 100644 index 6bb8f02685a..00000000000 --- a/arch/m68k/include/asm/MC68332.h +++ /dev/null @@ -1,152 +0,0 @@ - -/* include/asm-m68knommu/MC68332.h: '332 control registers - * - * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>, - * - */ - -#ifndef _MC68332_H_ -#define _MC68332_H_ - -#define BYTE_REF(addr) (*((volatile unsigned char*)addr)) -#define WORD_REF(addr) (*((volatile unsigned short*)addr)) - -#define PORTE_ADDR	0xfffa11 -#define PORTE	BYTE_REF(PORTE_ADDR) -#define DDRE_ADDR	0xfffa15 -#define DDRE	BYTE_REF(DDRE_ADDR) -#define PEPAR_ADDR	0xfffa17 -#define PEPAR	BYTE_REF(PEPAR_ADDR) - -#define PORTF_ADDR	0xfffa19 -#define PORTF	BYTE_REF(PORTF_ADDR) -#define DDRF_ADDR	0xfffa1d -#define DDRF	BYTE_REF(DDRF_ADDR) -#define PFPAR_ADDR	0xfffa1f -#define PFPAR	BYTE_REF(PFPAR_ADDR) - -#define PORTQS_ADDR	0xfffc15 -#define PORTQS	BYTE_REF(PORTQS_ADDR) -#define DDRQS_ADDR	0xfffc17 -#define DDRQS	BYTE_REF(DDRQS_ADDR) -#define PQSPAR_ADDR	0xfffc16 -#define PQSPAR	BYTE_REF(PQSPAR_ADDR) - -#define CSPAR0_ADDR 0xFFFA44 -#define CSPAR0 WORD_REF(CSPAR0_ADDR) -#define CSPAR1_ADDR 0xFFFA46 -#define CSPAR1 WORD_REF(CSPAR1_ADDR) -#define CSARBT_ADDR 0xFFFA48 -#define CSARBT WORD_REF(CSARBT_ADDR) -#define CSOPBT_ADDR 0xFFFA4A -#define CSOPBT WORD_REF(CSOPBT_ADDR) -#define CSBAR0_ADDR 0xFFFA4C -#define CSBAR0 WORD_REF(CSBAR0_ADDR) -#define CSOR0_ADDR 0xFFFA4E -#define CSOR0 WORD_REF(CSOR0_ADDR) -#define CSBAR1_ADDR 0xFFFA50 -#define CSBAR1 WORD_REF(CSBAR1_ADDR) -#define CSOR1_ADDR 0xFFFA52 -#define CSOR1 WORD_REF(CSOR1_ADDR) -#define CSBAR2_ADDR 0xFFFA54 -#define CSBAR2 WORD_REF(CSBAR2_ADDR) -#define CSOR2_ADDR 0xFFFA56 -#define CSOR2 WORD_REF(CSOR2_ADDR) -#define CSBAR3_ADDR 0xFFFA58 -#define CSBAR3 WORD_REF(CSBAR3_ADDR) -#define CSOR3_ADDR 0xFFFA5A -#define CSOR3 WORD_REF(CSOR3_ADDR) -#define CSBAR4_ADDR 0xFFFA5C -#define CSBAR4 WORD_REF(CSBAR4_ADDR) -#define CSOR4_ADDR 0xFFFA5E -#define CSOR4 WORD_REF(CSOR4_ADDR) -#define CSBAR5_ADDR 0xFFFA60 -#define CSBAR5 WORD_REF(CSBAR5_ADDR) -#define CSOR5_ADDR 0xFFFA62 -#define CSOR5 WORD_REF(CSOR5_ADDR) -#define CSBAR6_ADDR 0xFFFA64 -#define CSBAR6 WORD_REF(CSBAR6_ADDR) -#define CSOR6_ADDR 0xFFFA66 -#define CSOR6 WORD_REF(CSOR6_ADDR) -#define CSBAR7_ADDR 0xFFFA68 -#define CSBAR7 WORD_REF(CSBAR7_ADDR) -#define CSOR7_ADDR 0xFFFA6A -#define CSOR7 WORD_REF(CSOR7_ADDR) -#define CSBAR8_ADDR 0xFFFA6C -#define CSBAR8 WORD_REF(CSBAR8_ADDR) -#define CSOR8_ADDR 0xFFFA6E -#define CSOR8 WORD_REF(CSOR8_ADDR) -#define CSBAR9_ADDR 0xFFFA70 -#define CSBAR9 WORD_REF(CSBAR9_ADDR) -#define CSOR9_ADDR 0xFFFA72 -#define CSOR9 WORD_REF(CSOR9_ADDR) -#define CSBAR10_ADDR 0xFFFA74 -#define CSBAR10 WORD_REF(CSBAR10_ADDR) -#define CSOR10_ADDR 0xFFFA76 -#define CSOR10 WORD_REF(CSOR10_ADDR) - -#define CSOR_MODE_ASYNC	0x0000 -#define CSOR_MODE_SYNC	0x8000 -#define CSOR_MODE_MASK	0x8000 -#define CSOR_BYTE_DISABLE	0x0000 -#define CSOR_BYTE_UPPER		0x4000 -#define CSOR_BYTE_LOWER		0x2000 -#define CSOR_BYTE_BOTH		0x6000 -#define CSOR_BYTE_MASK		0x6000 -#define CSOR_RW_RSVD		0x0000 -#define CSOR_RW_READ		0x0800 -#define CSOR_RW_WRITE		0x1000 -#define CSOR_RW_BOTH		0x1800 -#define CSOR_RW_MASK		0x1800 -#define CSOR_STROBE_DS		0x0400 -#define CSOR_STROBE_AS		0x0000 -#define CSOR_STROBE_MASK	0x0400 -#define CSOR_DSACK_WAIT(x)	(wait << 6) -#define CSOR_DSACK_FTERM	(14 << 6) -#define CSOR_DSACK_EXTERNAL	(15 << 6) -#define CSOR_DSACK_MASK		0x03c0 -#define CSOR_SPACE_CPU		0x0000 -#define CSOR_SPACE_USER		0x0010 -#define CSOR_SPACE_SU		0x0020 -#define CSOR_SPACE_BOTH		0x0030 -#define CSOR_SPACE_MASK		0x0030 -#define CSOR_IPL_ALL		0x0000 -#define CSOR_IPL_PRIORITY(x)	(x << 1) -#define CSOR_IPL_MASK		0x000e -#define CSOR_AVEC_ON		0x0001 -#define CSOR_AVEC_OFF		0x0000 -#define CSOR_AVEC_MASK		0x0001 - -#define CSBAR_ADDR(x)		((addr >> 11) << 3)  -#define CSBAR_ADDR_MASK		0xfff8 -#define CSBAR_BLKSIZE_2K	0x0000 -#define CSBAR_BLKSIZE_8K	0x0001 -#define CSBAR_BLKSIZE_16K	0x0002 -#define CSBAR_BLKSIZE_64K	0x0003 -#define CSBAR_BLKSIZE_128K	0x0004 -#define CSBAR_BLKSIZE_256K	0x0005 -#define CSBAR_BLKSIZE_512K	0x0006 -#define CSBAR_BLKSIZE_1M	0x0007 -#define CSBAR_BLKSIZE_MASK	0x0007 - -#define CSPAR_DISC	0 -#define CSPAR_ALT	1 -#define CSPAR_CS8	2 -#define CSPAR_CS16	3 -#define CSPAR_MASK	3 - -#define CSPAR0_CSBOOT(x) (x << 0) -#define CSPAR0_CS0(x)	(x << 2) -#define CSPAR0_CS1(x)	(x << 4) -#define CSPAR0_CS2(x)	(x << 6) -#define CSPAR0_CS3(x)	(x << 8) -#define CSPAR0_CS4(x)	(x << 10) -#define CSPAR0_CS5(x)	(x << 12) - -#define CSPAR1_CS6(x)	(x << 0) -#define CSPAR1_CS7(x)	(x << 2) -#define CSPAR1_CS8(x)	(x << 4) -#define CSPAR1_CS9(x)	(x << 6) -#define CSPAR1_CS10(x)	(x << 8) - -#endif diff --git a/arch/m68k/include/asm/MC68EZ328.h b/arch/m68k/include/asm/MC68EZ328.h index 69b7f9139e5..d1bde58ab0d 100644 --- a/arch/m68k/include/asm/MC68EZ328.h +++ b/arch/m68k/include/asm/MC68EZ328.h @@ -1047,7 +1047,7 @@ typedef volatile struct {  #define WATCHDOG_EN	0x0001	/* Watchdog Enabled */  #define WATCHDOG_ISEL	0x0002	/* Select the watchdog interrupt */ -#define WATCHDOG_INTF	0x0080	/* Watchdog interrupt occcured */ +#define WATCHDOG_INTF	0x0080	/* Watchdog interrupt occurred */  #define WATCHDOG_CNT_MASK  0x0300	/* Watchdog Counter */  #define WATCHDOG_CNT_SHIFT 8 diff --git a/arch/m68k/include/asm/MC68VZ328.h b/arch/m68k/include/asm/MC68VZ328.h index 2b9bf626a0a..6bd1bf1f85e 100644 --- a/arch/m68k/include/asm/MC68VZ328.h +++ b/arch/m68k/include/asm/MC68VZ328.h @@ -1143,7 +1143,7 @@ typedef struct {  #define WATCHDOG_EN	0x0001	/* Watchdog Enabled */  #define WATCHDOG_ISEL	0x0002	/* Select the watchdog interrupt */ -#define WATCHDOG_INTF	0x0080	/* Watchdog interrupt occcured */ +#define WATCHDOG_INTF	0x0080	/* Watchdog interrupt occurred */  #define WATCHDOG_CNT_MASK  0x0300	/* Watchdog Counter */  #define WATCHDOG_CNT_SHIFT 8 diff --git a/arch/m68k/include/asm/a.out.h b/arch/m68k/include/asm/a.out.h deleted file mode 100644 index 3885fe43432..00000000000 --- a/arch/m68k/include/asm/a.out.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __M68K_A_OUT_H__ -#define __M68K_A_OUT_H__ - -struct exec -{ -  unsigned long a_info;		/* Use macros N_MAGIC, etc for access */ -  unsigned a_text;		/* length of text, in bytes */ -  unsigned a_data;		/* length of data, in bytes */ -  unsigned a_bss;		/* length of uninitialized data area for file, in bytes */ -  unsigned a_syms;		/* length of symbol table data in file, in bytes */ -  unsigned a_entry;		/* start address */ -  unsigned a_trsize;		/* length of relocation info for text, in bytes */ -  unsigned a_drsize;		/* length of relocation info for data, in bytes */ -}; - -#define N_TRSIZE(a)	((a).a_trsize) -#define N_DRSIZE(a)	((a).a_drsize) -#define N_SYMSIZE(a)	((a).a_syms) - -#endif /* __M68K_A_OUT_H__ */ diff --git a/arch/m68k/include/asm/amigahw.h b/arch/m68k/include/asm/amigahw.h index 7a19b5686a4..5ad568110f1 100644 --- a/arch/m68k/include/asm/amigahw.h +++ b/arch/m68k/include/asm/amigahw.h @@ -18,26 +18,7 @@  #include <linux/ioport.h> -    /* -     *  Different Amiga models -     */ - -#define AMI_UNKNOWN	(0) -#define AMI_500		(1) -#define AMI_500PLUS	(2) -#define AMI_600		(3) -#define AMI_1000	(4) -#define AMI_1200	(5) -#define AMI_2000	(6) -#define AMI_2500	(7) -#define AMI_3000	(8) -#define AMI_3000T	(9) -#define AMI_3000PLUS	(10) -#define AMI_4000	(11) -#define AMI_4000T	(12) -#define AMI_CDTV	(13) -#define AMI_CD32	(14) -#define AMI_DRACO	(15) +#include <asm/bootinfo-amiga.h>      /* @@ -46,11 +27,6 @@  extern unsigned long amiga_chipset; -#define CS_STONEAGE	(0) -#define CS_OCS		(1) -#define CS_ECS		(2) -#define CS_AGA		(3) -      /*       *  Miscellaneous @@ -266,7 +242,7 @@ struct CIA {  #define zTwoBase (0x80000000)  #define ZTWO_PADDR(x) (((unsigned long)(x))-zTwoBase) -#define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) +#define ZTWO_VADDR(x) ((void __iomem *)(((unsigned long)(x))+zTwoBase))  #define CUSTOM_PHYSADDR     (0xdff000)  #define amiga_custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) diff --git a/arch/m68k/include/asm/anchor.h b/arch/m68k/include/asm/anchor.h deleted file mode 100644 index 871c0d5cfc3..00000000000 --- a/arch/m68k/include/asm/anchor.h +++ /dev/null @@ -1,112 +0,0 @@ -/****************************************************************************/ - -/* - *	anchor.h -- Anchor CO-MEM Lite PCI host bridge part. - * - *	(C) Copyright 2000, Moreton Bay (www.moreton.com.au) - */ - -/****************************************************************************/ -#ifndef	anchor_h -#define	anchor_h -/****************************************************************************/ - -/* - *	Define basic addressing info. - */ -#if defined(CONFIG_M5407C3) -#define	COMEM_BASE	0xFFFF0000	/* Base of CO-MEM address space */ -#define	COMEM_IRQ	25		/* IRQ of anchor part */ -#else -#define	COMEM_BASE	0x80000000	/* Base of CO-MEM address space */ -#define	COMEM_IRQ	25		/* IRQ of anchor part */ -#endif - -/****************************************************************************/ - -/* - *	4-byte registers of CO-MEM, so adjust register addresses for - *	easy access. Handy macro for word access too. - */ -#define	LREG(a)		((a) >> 2) -#define	WREG(a)		((a) >> 1) - - -/* - *	Define base addresses within CO-MEM Lite register address space. - */ -#define	COMEM_I2O	0x0000		/* I2O registers */ -#define	COMEM_OPREGS	0x0400		/* Operation registers */ -#define	COMEM_PCIBUS	0x2000		/* Direct access to PCI bus */ -#define	COMEM_SHMEM	0x4000		/* Shared memory region */ - -#define	COMEM_SHMEMSIZE	0x4000		/* Size of shared memory */ - - -/* - *	Define CO-MEM Registers. - */ -#define	COMEM_I2OHISR	0x0030		/* I2O host interrupt status */ -#define	COMEM_I2OHIMR	0x0034		/* I2O host interrupt mask */ -#define	COMEM_I2OLISR	0x0038		/* I2O local interrupt status */ -#define	COMEM_I2OLIMR	0x003c		/* I2O local interrupt mask */ -#define	COMEM_IBFPFIFO	0x0040		/* I2O inbound free/post FIFO */ -#define	COMEM_OBPFFIFO	0x0044		/* I2O outbound post/free FIFO */ -#define	COMEM_IBPFFIFO	0x0048		/* I2O inbound post/free FIFO */ -#define	COMEM_OBFPFIFO	0x004c		/* I2O outbound free/post FIFO */ - -#define	COMEM_DAHBASE	0x0460		/* Direct access base address */ - -#define	COMEM_NVCMD	0x04a0		/* I2C serial command */ -#define	COMEM_NVREAD	0x04a4		/* I2C serial read */ -#define	COMEM_NVSTAT	0x04a8		/* I2C status */ - -#define	COMEM_DMALBASE	0x04b0		/* DMA local base address */ -#define	COMEM_DMAHBASE	0x04b4		/* DMA host base address */ -#define	COMEM_DMASIZE	0x04b8		/* DMA size */ -#define	COMEM_DMACTL	0x04bc		/* DMA control */ - -#define	COMEM_HCTL	0x04e0		/* Host control */ -#define	COMEM_HINT	0x04e4		/* Host interrupt control/status */ -#define	COMEM_HLDATA	0x04e8		/* Host to local data mailbox */ -#define	COMEM_LINT	0x04f4		/* Local interrupt contole status */ -#define	COMEM_LHDATA	0x04f8		/* Local to host data mailbox */ - -#define	COMEM_LBUSCFG	0x04fc		/* Local bus configuration */ - - -/* - *	Commands and flags for use with Direct Access Register. - */ -#define	COMEM_DA_IACK	0x00000000	/* Interrupt acknowledge (read) */ -#define	COMEM_DA_SPCL	0x00000010	/* Special cycle (write) */ -#define	COMEM_DA_MEMRD	0x00000004	/* Memory read cycle */ -#define	COMEM_DA_MEMWR	0x00000004	/* Memory write cycle */ -#define	COMEM_DA_IORD	0x00000002	/* I/O read cycle */ -#define	COMEM_DA_IOWR	0x00000002	/* I/O write cycle */ -#define	COMEM_DA_CFGRD	0x00000006	/* Configuration read cycle */ -#define	COMEM_DA_CFGWR	0x00000006	/* Configuration write cycle */ - -#define	COMEM_DA_ADDR(a)	((a) & 0xffffe000) - -#define	COMEM_DA_OFFSET(a)	((a) & 0x00001fff) - - -/* - *	The PCI bus will be limited in what slots will actually be used. - *	Define valid device numbers for different boards. - */ -#if defined(CONFIG_M5407C3) -#define	COMEM_MINDEV	14		/* Minimum valid DEVICE */ -#define	COMEM_MAXDEV	14		/* Maximum valid DEVICE */ -#define	COMEM_BRIDGEDEV	15		/* Slot bridge is in */ -#else -#define	COMEM_MINDEV	0		/* Minimum valid DEVICE */ -#define	COMEM_MAXDEV	3		/* Maximum valid DEVICE */ -#endif - -#define	COMEM_MAXPCI	(COMEM_MAXDEV+1)	/* Maximum PCI devices */ - - -/****************************************************************************/ -#endif	/* anchor_h */ diff --git a/arch/m68k/include/asm/apollodma.h b/arch/m68k/include/asm/apollodma.h deleted file mode 100644 index 954adc851ad..00000000000 --- a/arch/m68k/include/asm/apollodma.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - * linux/include/asm/dma.h: Defines for using and allocating dma channels. - * Written by Hennus Bergman, 1992. - * High DMA channel support & info by Hannu Savolainen - * and John Boyd, Nov. 1992. - */ - -#ifndef _ASM_APOLLO_DMA_H -#define _ASM_APOLLO_DMA_H - -#include <asm/apollohw.h>		/* need byte IO */ -#include <linux/spinlock.h>		/* And spinlocks */ -#include <linux/delay.h> - - -#define dma_outb(val,addr) (*((volatile unsigned char *)(addr+IO_BASE)) = (val)) -#define dma_inb(addr)	   (*((volatile unsigned char *)(addr+IO_BASE))) - -/* - * NOTES about DMA transfers: - * - *  controller 1: channels 0-3, byte operations, ports 00-1F - *  controller 2: channels 4-7, word operations, ports C0-DF - * - *  - ALL registers are 8 bits only, regardless of transfer size - *  - channel 4 is not used - cascades 1 into 2. - *  - channels 0-3 are byte - addresses/counts are for physical bytes - *  - channels 5-7 are word - addresses/counts are for physical words - *  - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries - *  - transfer count loaded to registers is 1 less than actual count - *  - controller 2 offsets are all even (2x offsets for controller 1) - *  - page registers for 5-7 don't use data bit 0, represent 128K pages - *  - page registers for 0-3 use bit 0, represent 64K pages - * - * DMA transfers are limited to the lower 16MB of _physical_ memory. - * Note that addresses loaded into registers must be _physical_ addresses, - * not logical addresses (which may differ if paging is active). - * - *  Address mapping for channels 0-3: - * - *   A23 ... A16 A15 ... A8  A7 ... A0    (Physical addresses) - *    |  ...  |   |  ... |   |  ... | - *    |  ...  |   |  ... |   |  ... | - *    |  ...  |   |  ... |   |  ... | - *   P7  ...  P0  A7 ... A0  A7 ... A0 - * |    Page    | Addr MSB | Addr LSB |   (DMA registers) - * - *  Address mapping for channels 5-7: - * - *   A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0    (Physical addresses) - *    |  ...  |   \   \   ... \  \  \  ... \  \ - *    |  ...  |    \   \   ... \  \  \  ... \  (not used) - *    |  ...  |     \   \   ... \  \  \  ... \ - *   P7  ...  P1 (0) A7 A6  ... A0 A7 A6 ... A0 - * |      Page      |  Addr MSB   |  Addr LSB  |   (DMA registers) - * - * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses - * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at - * the hardware level, so odd-byte transfers aren't possible). - * - * Transfer count (_not # bytes_) is limited to 64K, represented as actual - * count - 1 : 64K => 0xFFFF, 1 => 0x0000.  Thus, count is always 1 or more, - * and up to 128K bytes may be transferred on channels 5-7 in one operation. - * - */ - -#define MAX_DMA_CHANNELS	8 - -/* The maximum address that we can perform a DMA transfer to on this platform */#define MAX_DMA_ADDRESS      (PAGE_OFFSET+0x1000000) - -/* 8237 DMA controllers */ -#define IO_DMA1_BASE	0x10C00	/* 8 bit slave DMA, channels 0..3 */ -#define IO_DMA2_BASE	0x10D00	/* 16 bit master DMA, ch 4(=slave input)..7 */ - -/* DMA controller registers */ -#define DMA1_CMD_REG		(IO_DMA1_BASE+0x08) /* command register (w) */ -#define DMA1_STAT_REG		(IO_DMA1_BASE+0x08) /* status register (r) */ -#define DMA1_REQ_REG            (IO_DMA1_BASE+0x09) /* request register (w) */ -#define DMA1_MASK_REG		(IO_DMA1_BASE+0x0A) /* single-channel mask (w) */ -#define DMA1_MODE_REG		(IO_DMA1_BASE+0x0B) /* mode register (w) */ -#define DMA1_CLEAR_FF_REG	(IO_DMA1_BASE+0x0C) /* clear pointer flip-flop (w) */ -#define DMA1_TEMP_REG           (IO_DMA1_BASE+0x0D) /* Temporary Register (r) */ -#define DMA1_RESET_REG		(IO_DMA1_BASE+0x0D) /* Master Clear (w) */ -#define DMA1_CLR_MASK_REG       (IO_DMA1_BASE+0x0E) /* Clear Mask */ -#define DMA1_MASK_ALL_REG       (IO_DMA1_BASE+0x0F) /* all-channels mask (w) */ - -#define DMA2_CMD_REG		(IO_DMA2_BASE+0x10) /* command register (w) */ -#define DMA2_STAT_REG		(IO_DMA2_BASE+0x10) /* status register (r) */ -#define DMA2_REQ_REG            (IO_DMA2_BASE+0x12) /* request register (w) */ -#define DMA2_MASK_REG		(IO_DMA2_BASE+0x14) /* single-channel mask (w) */ -#define DMA2_MODE_REG		(IO_DMA2_BASE+0x16) /* mode register (w) */ -#define DMA2_CLEAR_FF_REG	(IO_DMA2_BASE+0x18) /* clear pointer flip-flop (w) */ -#define DMA2_TEMP_REG           (IO_DMA2_BASE+0x1A) /* Temporary Register (r) */ -#define DMA2_RESET_REG		(IO_DMA2_BASE+0x1A) /* Master Clear (w) */ -#define DMA2_CLR_MASK_REG       (IO_DMA2_BASE+0x1C) /* Clear Mask */ -#define DMA2_MASK_ALL_REG       (IO_DMA2_BASE+0x1E) /* all-channels mask (w) */ - -#define DMA_ADDR_0              (IO_DMA1_BASE+0x00) /* DMA address registers */ -#define DMA_ADDR_1              (IO_DMA1_BASE+0x02) -#define DMA_ADDR_2              (IO_DMA1_BASE+0x04) -#define DMA_ADDR_3              (IO_DMA1_BASE+0x06) -#define DMA_ADDR_4              (IO_DMA2_BASE+0x00) -#define DMA_ADDR_5              (IO_DMA2_BASE+0x04) -#define DMA_ADDR_6              (IO_DMA2_BASE+0x08) -#define DMA_ADDR_7              (IO_DMA2_BASE+0x0C) - -#define DMA_CNT_0               (IO_DMA1_BASE+0x01)   /* DMA count registers */ -#define DMA_CNT_1               (IO_DMA1_BASE+0x03) -#define DMA_CNT_2               (IO_DMA1_BASE+0x05) -#define DMA_CNT_3               (IO_DMA1_BASE+0x07) -#define DMA_CNT_4               (IO_DMA2_BASE+0x02) -#define DMA_CNT_5               (IO_DMA2_BASE+0x06) -#define DMA_CNT_6               (IO_DMA2_BASE+0x0A) -#define DMA_CNT_7               (IO_DMA2_BASE+0x0E) - -#define DMA_MODE_READ	0x44	/* I/O to memory, no autoinit, increment, single mode */ -#define DMA_MODE_WRITE	0x48	/* memory to I/O, no autoinit, increment, single mode */ -#define DMA_MODE_CASCADE 0xC0   /* pass thru DREQ->HRQ, DACK<-HLDA only */ - -#define DMA_AUTOINIT	0x10 - -#define DMA_8BIT 0 -#define DMA_16BIT 1 -#define DMA_BUSMASTER 2 - -extern spinlock_t  dma_spin_lock; - -static __inline__ unsigned long claim_dma_lock(void) -{ -	unsigned long flags; -	spin_lock_irqsave(&dma_spin_lock, flags); -	return flags; -} - -static __inline__ void release_dma_lock(unsigned long flags) -{ -	spin_unlock_irqrestore(&dma_spin_lock, flags); -} - -/* enable/disable a specific DMA channel */ -static __inline__ void enable_dma(unsigned int dmanr) -{ -	if (dmanr<=3) -		dma_outb(dmanr,  DMA1_MASK_REG); -	else -		dma_outb(dmanr & 3,  DMA2_MASK_REG); -} - -static __inline__ void disable_dma(unsigned int dmanr) -{ -	if (dmanr<=3) -		dma_outb(dmanr | 4,  DMA1_MASK_REG); -	else -		dma_outb((dmanr & 3) | 4,  DMA2_MASK_REG); -} - -/* Clear the 'DMA Pointer Flip Flop'. - * Write 0 for LSB/MSB, 1 for MSB/LSB access. - * Use this once to initialize the FF to a known state. - * After that, keep track of it. :-) - * --- In order to do that, the DMA routines below should --- - * --- only be used while holding the DMA lock ! --- - */ -static __inline__ void clear_dma_ff(unsigned int dmanr) -{ -	if (dmanr<=3) -		dma_outb(0,  DMA1_CLEAR_FF_REG); -	else -		dma_outb(0,  DMA2_CLEAR_FF_REG); -} - -/* set mode (above) for a specific DMA channel */ -static __inline__ void set_dma_mode(unsigned int dmanr, char mode) -{ -	if (dmanr<=3) -		dma_outb(mode | dmanr,  DMA1_MODE_REG); -	else -		dma_outb(mode | (dmanr&3),  DMA2_MODE_REG); -} - -/* Set transfer address & page bits for specific DMA channel. - * Assumes dma flipflop is clear. - */ -static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a) -{ -	if (dmanr <= 3)  { -	    dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); -            dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); -	}  else  { -	    dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); -	    dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); -	} -} - - -/* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for - * a specific DMA channel. - * You must ensure the parameters are valid. - * NOTE: from a manual: "the number of transfers is one more - * than the initial word count"! This is taken into account. - * Assumes dma flip-flop is clear. - * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7. - */ -static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) -{ -        count--; -	if (dmanr <= 3)  { -	    dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); -	    dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); -        } else { -	    dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); -	    dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); -        } -} - - -/* Get DMA residue count. After a DMA transfer, this - * should return zero. Reading this while a DMA transfer is - * still in progress will return unpredictable results. - * If called before the channel has been used, it may return 1. - * Otherwise, it returns the number of _bytes_ left to transfer. - * - * Assumes DMA flip-flop is clear. - */ -static __inline__ int get_dma_residue(unsigned int dmanr) -{ -	unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE -					 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE; - -	/* using short to get 16-bit wrap around */ -	unsigned short count; - -	count = 1 + dma_inb(io_port); -	count += dma_inb(io_port) << 8; - -	return (dmanr<=3)? count : (count<<1); -} - - -/* These are in kernel/dma.c: */ -extern int request_dma(unsigned int dmanr, const char * device_id);	/* reserve a DMA channel */ -extern void free_dma(unsigned int dmanr);	/* release it again */ - -/* These are in arch/m68k/apollo/dma.c: */ -extern unsigned short dma_map_page(unsigned long phys_addr,int count,int type); -extern void dma_unmap_page(unsigned short dma_addr); - -#endif /* _ASM_APOLLO_DMA_H */ diff --git a/arch/m68k/include/asm/apollohw.h b/arch/m68k/include/asm/apollohw.h index a1373b9aa28..87fc899d32e 100644 --- a/arch/m68k/include/asm/apollohw.h +++ b/arch/m68k/include/asm/apollohw.h @@ -5,18 +5,11 @@  #include <linux/types.h> -/* -   apollo models -*/ +#include <asm/bootinfo-apollo.h> +  extern u_long apollo_model; -#define APOLLO_UNKNOWN (0) -#define APOLLO_DN3000 (1) -#define APOLLO_DN3010 (2) -#define APOLLO_DN3500 (3) -#define APOLLO_DN4000 (4) -#define APOLLO_DN4500 (5)  /*     see scn2681 data sheet for more info. @@ -46,18 +39,6 @@ struct SCN2681 {  }; -#if 0 -struct mc146818 { - -	unsigned int second1:4, second2:4, alarm_second1:4, alarm_second2:4, -		     minute1:4, minute2:4, alarm_minute1:4, alarm_minute2:4; -	unsigned int hours1:4, hours2:4, alarm_hours1:4, alarm_hours2:4, -		     day_of_week1:4, day_of_week2:4, day_of_month1:4, day_of_month2:4; -	unsigned int month1:4, month2:4, year1:4, year2:4, :16; - -}; -#endif -  struct mc146818 {          unsigned char second, alarm_second;          unsigned char minute, alarm_minute; @@ -98,7 +79,7 @@ extern u_long timer_physaddr;  #define cpuctrl (*(volatile unsigned int *)(IO_BASE + cpuctrl_physaddr))  #define pica (IO_BASE + pica_physaddr)  #define picb (IO_BASE + picb_physaddr) -#define timer (IO_BASE + timer_physaddr) +#define apollo_timer (IO_BASE + timer_physaddr)  #define addr_xlat_map ((unsigned short *)(IO_BASE + 0x17000))  #define isaIO2mem(x) (((((x) & 0x3f8)  << 7) | (((x) & 0xfc00) >> 6) | ((x) & 0x7)) + 0x40000 + IO_BASE) diff --git a/arch/m68k/include/asm/atari_stram.h b/arch/m68k/include/asm/atari_stram.h index 7546d13963b..4e771c22d6a 100644 --- a/arch/m68k/include/asm/atari_stram.h +++ b/arch/m68k/include/asm/atari_stram.h @@ -6,12 +6,13 @@   */  /* public interface */ -void *atari_stram_alloc(long size, const char *owner); +void *atari_stram_alloc(unsigned long size, const char *owner);  void atari_stram_free(void *); +void *atari_stram_to_virt(unsigned long phys); +unsigned long atari_stram_to_phys(void *);  /* functions called internally by other parts of the kernel */  void atari_stram_init(void);  void atari_stram_reserve_pages(void *start_mem); -void atari_stram_mem_init_hook (void);  #endif /*_M68K_ATARI_STRAM_H */ diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h index a714e1aa072..972c8f33f05 100644 --- a/arch/m68k/include/asm/atarihw.h +++ b/arch/m68k/include/asm/atarihw.h @@ -21,7 +21,7 @@  #define _LINUX_ATARIHW_H_  #include <linux/types.h> -#include <asm/bootinfo.h> +#include <asm/bootinfo-atari.h>  #include <asm/raw_io.h>  extern u_long atari_mch_cookie; @@ -30,6 +30,8 @@ extern u_long atari_switches;  extern int atari_rtc_year_offset;  extern int atari_dont_touch_floppy_select; +extern int atari_SCC_reset_done; +  /* convenience macros for testing machine type */  #define MACH_IS_ST	((atari_mch_cookie >> 16) == ATARI_MCH_ST)  #define MACH_IS_STE	((atari_mch_cookie >> 16) == ATARI_MCH_STE && \ @@ -399,8 +401,8 @@ struct CODEC  #define CODEC_OVERFLOW_LEFT     2    u_char unused2, unused3, unused4, unused5;    u_char gpio_directions; -#define GPIO_IN                 0 -#define GPIO_OUT                1 +#define CODEC_GPIO_IN           0 +#define CODEC_GPIO_OUT          1    u_char unused6;    u_char gpio_data;  }; @@ -449,7 +451,7 @@ struct SCC    u_char char_dummy3;    u_char cha_b_data;   }; -# define scc ((*(volatile struct SCC*)SCC_BAS)) +# define atari_scc ((*(volatile struct SCC*)SCC_BAS))  /* The ESCC (Z85230) in an Atari ST. The channels are reversed! */  # define st_escc ((*(volatile struct SCC*)0xfffffa31)) @@ -803,5 +805,11 @@ struct MSTE_RTC {  #define mste_rtc ((*(volatile struct MSTE_RTC *)MSTE_RTC_BAS)) +/* +** EtherNAT add-on card for Falcon - combined ethernet and USB adapter +*/ + +#define ATARI_ETHERNAT_PHYS_ADDR	0x80000000 +  #endif /* linux/atarihw.h */ diff --git a/arch/m68k/include/asm/atariints.h b/arch/m68k/include/asm/atariints.h index f597892e43a..953e0ac6855 100644 --- a/arch/m68k/include/asm/atariints.h +++ b/arch/m68k/include/asm/atariints.h @@ -32,7 +32,7 @@  #define VME_SOURCE_BASE    56  #define VME_MAX_SOURCES    16 -#define NUM_ATARI_SOURCES   (VME_SOURCE_BASE+VME_MAX_SOURCES-STMFP_SOURCE_BASE) +#define NUM_ATARI_SOURCES  141  /* convert vector number to int source number */  #define IRQ_VECTOR_TO_SOURCE(v)	((v) - ((v) < 0x20 ? 0x18 : (0x40-8))) @@ -94,6 +94,15 @@  #define IRQ_SCCA_RX	     (52)  #define IRQ_SCCA_SPCOND	     (54) +/* shared MFP timer D interrupts - hires timer for EtherNEC et al. */ +#define IRQ_MFP_TIMER1       (64) +#define IRQ_MFP_TIMER2       (65) +#define IRQ_MFP_TIMER3       (66) +#define IRQ_MFP_TIMER4       (67) +#define IRQ_MFP_TIMER5       (68) +#define IRQ_MFP_TIMER6       (69) +#define IRQ_MFP_TIMER7       (70) +#define IRQ_MFP_TIMER8       (71)  #define INT_CLK   24576	    /* CLK while int_clk =2.456MHz and divide = 100 */  #define INT_TICKS 246	    /* to make sched_time = 99.902... HZ */ @@ -146,7 +155,7 @@ static inline void clear_mfp_bit( unsigned irq, int type )  /*   * {en,dis}able_irq have the usual semantics of temporary blocking the - * interrupt, but not loosing requests that happen between disabling and + * interrupt, but not losing requests that happen between disabling and   * enabling. This is done with the MFP mask registers.   */ @@ -198,7 +207,7 @@ static inline int atari_irq_pending( unsigned irq )  	return( get_mfp_bit( irq, MFP_PENDING ) );  } -unsigned long atari_register_vme_int( void ); -void atari_unregister_vme_int( unsigned long ); +unsigned int atari_register_vme_int(void); +void atari_unregister_vme_int(unsigned int);  #endif /* linux/atariints.h */ diff --git a/arch/m68k/include/asm/atarikb.h b/arch/m68k/include/asm/atarikb.h index 546e7da5804..68f3622bf59 100644 --- a/arch/m68k/include/asm/atarikb.h +++ b/arch/m68k/include/asm/atarikb.h @@ -34,8 +34,6 @@ void ikbd_joystick_disable(void);  /* Hook for MIDI serial driver */  extern void (*atari_MIDI_interrupt_hook) (void); -/* Hook for mouse driver */ -extern void (*atari_mouse_interrupt_hook) (char *);  /* Hook for keyboard inputdev  driver */  extern void (*atari_input_keyboard_interrupt_hook) (unsigned char, char);  /* Hook for mouse inputdev  driver */ diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h index 03ae3d14cd4..55695212a2a 100644 --- a/arch/m68k/include/asm/atomic.h +++ b/arch/m68k/include/asm/atomic.h @@ -2,7 +2,9 @@  #define __ARCH_M68K_ATOMIC__  #include <linux/types.h> -#include <asm/system.h> +#include <linux/irqflags.h> +#include <asm/cmpxchg.h> +#include <asm/barrier.h>  /*   * Atomic operations that C can't guarantee us.  Useful for @@ -55,6 +57,16 @@ static inline int atomic_dec_and_test(atomic_t *v)  	return c != 0;  } +static inline int atomic_dec_and_test_lt(atomic_t *v) +{ +	char c; +	__asm__ __volatile__( +		"subql #1,%1; slt %0" +		: "=d" (c), "=m" (*v) +		: "m" (*v)); +	return c != 0; +} +  static inline int atomic_inc_and_test(atomic_t *v)  {  	char c; @@ -169,21 +181,21 @@ static inline int atomic_add_negative(int i, atomic_t *v)  	char c;  	__asm__ __volatile__("addl %2,%1; smi %0"  			     : "=d" (c), "+m" (*v) -			     : "id" (i)); +			     : ASM_DI (i));  	return c != 0;  }  static inline void atomic_clear_mask(unsigned long mask, unsigned long *v)  { -	__asm__ __volatile__("andl %1,%0" : "+m" (*v) : "id" (~(mask))); +	__asm__ __volatile__("andl %1,%0" : "+m" (*v) : ASM_DI (~(mask)));  }  static inline void atomic_set_mask(unsigned long mask, unsigned long *v)  { -	__asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask)); +	__asm__ __volatile__("orl %1,%0" : "+m" (*v) : ASM_DI (mask));  } -static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) +static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)  {  	int c, old;  	c = atomic_read(v); @@ -195,17 +207,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)  			break;  		c = old;  	} -	return c != (u); +	return c;  } -#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) - -/* Atomic operations are already serializing */ -#define smp_mb__before_atomic_dec()	barrier() -#define smp_mb__after_atomic_dec()	barrier() -#define smp_mb__before_atomic_inc()	barrier() -#define smp_mb__after_atomic_inc()	barrier() - -#include <asm-generic/atomic-long.h> -#include <asm-generic/atomic64.h>  #endif /* __ARCH_M68K_ATOMIC __ */ diff --git a/arch/m68k/include/asm/auxvec.h b/arch/m68k/include/asm/auxvec.h deleted file mode 100644 index 844d6d52204..00000000000 --- a/arch/m68k/include/asm/auxvec.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef __ASMm68k_AUXVEC_H -#define __ASMm68k_AUXVEC_H - -#endif diff --git a/arch/m68k/include/asm/bitops.h b/arch/m68k/include/asm/bitops.h index ce163abddab..b4a9b0d5928 100644 --- a/arch/m68k/include/asm/bitops.h +++ b/arch/m68k/include/asm/bitops.h @@ -1,5 +1,525 @@ -#ifdef __uClinux__ -#include "bitops_no.h" +#ifndef _M68K_BITOPS_H +#define _M68K_BITOPS_H +/* + * Copyright 1992, Linus Torvalds. + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file COPYING in the main directory of this archive + * for more details. + */ + +#ifndef _LINUX_BITOPS_H +#error only <linux/bitops.h> can be included directly +#endif + +#include <linux/compiler.h> +#include <asm/barrier.h> + +/* + *	Bit access functions vary across the ColdFire and 68k families. + *	So we will break them out here, and then macro in the ones we want. + * + *	ColdFire - supports standard bset/bclr/bchg with register operand only + *	68000    - supports standard bset/bclr/bchg with memory operand + *	>= 68020 - also supports the bfset/bfclr/bfchg instructions + * + *	Although it is possible to use only the bset/bclr/bchg with register + *	operands on all platforms you end up with larger generated code. + *	So we use the best form possible on a given platform. + */ + +static inline void bset_reg_set_bit(int nr, volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; + +	__asm__ __volatile__ ("bset %1,(%0)" +		: +		: "a" (p), "di" (nr & 7) +		: "memory"); +} + +static inline void bset_mem_set_bit(int nr, volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; + +	__asm__ __volatile__ ("bset %1,%0" +		: "+m" (*p) +		: "di" (nr & 7)); +} + +static inline void bfset_mem_set_bit(int nr, volatile unsigned long *vaddr) +{ +	__asm__ __volatile__ ("bfset %1{%0:#1}" +		: +		: "d" (nr ^ 31), "o" (*vaddr) +		: "memory"); +} + +#if defined(CONFIG_COLDFIRE) +#define	set_bit(nr, vaddr)	bset_reg_set_bit(nr, vaddr) +#elif defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#define	set_bit(nr, vaddr)	bset_mem_set_bit(nr, vaddr) +#else +#define set_bit(nr, vaddr)	(__builtin_constant_p(nr) ? \ +				bset_mem_set_bit(nr, vaddr) : \ +				bfset_mem_set_bit(nr, vaddr)) +#endif + +#define __set_bit(nr, vaddr)	set_bit(nr, vaddr) + + +static inline void bclr_reg_clear_bit(int nr, volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; + +	__asm__ __volatile__ ("bclr %1,(%0)" +		: +		: "a" (p), "di" (nr & 7) +		: "memory"); +} + +static inline void bclr_mem_clear_bit(int nr, volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; + +	__asm__ __volatile__ ("bclr %1,%0" +		: "+m" (*p) +		: "di" (nr & 7)); +} + +static inline void bfclr_mem_clear_bit(int nr, volatile unsigned long *vaddr) +{ +	__asm__ __volatile__ ("bfclr %1{%0:#1}" +		: +		: "d" (nr ^ 31), "o" (*vaddr) +		: "memory"); +} + +#if defined(CONFIG_COLDFIRE) +#define	clear_bit(nr, vaddr)	bclr_reg_clear_bit(nr, vaddr) +#elif defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#define	clear_bit(nr, vaddr)	bclr_mem_clear_bit(nr, vaddr) +#else +#define clear_bit(nr, vaddr)	(__builtin_constant_p(nr) ? \ +				bclr_mem_clear_bit(nr, vaddr) : \ +				bfclr_mem_clear_bit(nr, vaddr)) +#endif + +#define __clear_bit(nr, vaddr)	clear_bit(nr, vaddr) + + +static inline void bchg_reg_change_bit(int nr, volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; + +	__asm__ __volatile__ ("bchg %1,(%0)" +		: +		: "a" (p), "di" (nr & 7) +		: "memory"); +} + +static inline void bchg_mem_change_bit(int nr, volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; + +	__asm__ __volatile__ ("bchg %1,%0" +		: "+m" (*p) +		: "di" (nr & 7)); +} + +static inline void bfchg_mem_change_bit(int nr, volatile unsigned long *vaddr) +{ +	__asm__ __volatile__ ("bfchg %1{%0:#1}" +		: +		: "d" (nr ^ 31), "o" (*vaddr) +		: "memory"); +} + +#if defined(CONFIG_COLDFIRE) +#define	change_bit(nr, vaddr)	bchg_reg_change_bit(nr, vaddr) +#elif defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#define	change_bit(nr, vaddr)	bchg_mem_change_bit(nr, vaddr) +#else +#define change_bit(nr, vaddr)	(__builtin_constant_p(nr) ? \ +				bchg_mem_change_bit(nr, vaddr) : \ +				bfchg_mem_change_bit(nr, vaddr)) +#endif + +#define __change_bit(nr, vaddr)	change_bit(nr, vaddr) + + +static inline int test_bit(int nr, const unsigned long *vaddr) +{ +	return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0; +} + + +static inline int bset_reg_test_and_set_bit(int nr, +					    volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; +	char retval; + +	__asm__ __volatile__ ("bset %2,(%1); sne %0" +		: "=d" (retval) +		: "a" (p), "di" (nr & 7) +		: "memory"); +	return retval; +} + +static inline int bset_mem_test_and_set_bit(int nr, +					    volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; +	char retval; + +	__asm__ __volatile__ ("bset %2,%1; sne %0" +		: "=d" (retval), "+m" (*p) +		: "di" (nr & 7)); +	return retval; +} + +static inline int bfset_mem_test_and_set_bit(int nr, +					     volatile unsigned long *vaddr) +{ +	char retval; + +	__asm__ __volatile__ ("bfset %2{%1:#1}; sne %0" +		: "=d" (retval) +		: "d" (nr ^ 31), "o" (*vaddr) +		: "memory"); +	return retval; +} + +#if defined(CONFIG_COLDFIRE) +#define	test_and_set_bit(nr, vaddr)	bset_reg_test_and_set_bit(nr, vaddr) +#elif defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#define	test_and_set_bit(nr, vaddr)	bset_mem_test_and_set_bit(nr, vaddr) +#else +#define test_and_set_bit(nr, vaddr)	(__builtin_constant_p(nr) ? \ +					bset_mem_test_and_set_bit(nr, vaddr) : \ +					bfset_mem_test_and_set_bit(nr, vaddr)) +#endif + +#define __test_and_set_bit(nr, vaddr)	test_and_set_bit(nr, vaddr) + + +static inline int bclr_reg_test_and_clear_bit(int nr, +					      volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; +	char retval; + +	__asm__ __volatile__ ("bclr %2,(%1); sne %0" +		: "=d" (retval) +		: "a" (p), "di" (nr & 7) +		: "memory"); +	return retval; +} + +static inline int bclr_mem_test_and_clear_bit(int nr, +					      volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; +	char retval; + +	__asm__ __volatile__ ("bclr %2,%1; sne %0" +		: "=d" (retval), "+m" (*p) +		: "di" (nr & 7)); +	return retval; +} + +static inline int bfclr_mem_test_and_clear_bit(int nr, +					       volatile unsigned long *vaddr) +{ +	char retval; + +	__asm__ __volatile__ ("bfclr %2{%1:#1}; sne %0" +		: "=d" (retval) +		: "d" (nr ^ 31), "o" (*vaddr) +		: "memory"); +	return retval; +} + +#if defined(CONFIG_COLDFIRE) +#define	test_and_clear_bit(nr, vaddr)	bclr_reg_test_and_clear_bit(nr, vaddr) +#elif defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#define	test_and_clear_bit(nr, vaddr)	bclr_mem_test_and_clear_bit(nr, vaddr) +#else +#define test_and_clear_bit(nr, vaddr)	(__builtin_constant_p(nr) ? \ +					bclr_mem_test_and_clear_bit(nr, vaddr) : \ +					bfclr_mem_test_and_clear_bit(nr, vaddr)) +#endif + +#define __test_and_clear_bit(nr, vaddr)	test_and_clear_bit(nr, vaddr) + + +static inline int bchg_reg_test_and_change_bit(int nr, +					       volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; +	char retval; + +	__asm__ __volatile__ ("bchg %2,(%1); sne %0" +		: "=d" (retval) +		: "a" (p), "di" (nr & 7) +		: "memory"); +	return retval; +} + +static inline int bchg_mem_test_and_change_bit(int nr, +					       volatile unsigned long *vaddr) +{ +	char *p = (char *)vaddr + (nr ^ 31) / 8; +	char retval; + +	__asm__ __volatile__ ("bchg %2,%1; sne %0" +		: "=d" (retval), "+m" (*p) +		: "di" (nr & 7)); +	return retval; +} + +static inline int bfchg_mem_test_and_change_bit(int nr, +						volatile unsigned long *vaddr) +{ +	char retval; + +	__asm__ __volatile__ ("bfchg %2{%1:#1}; sne %0" +		: "=d" (retval) +		: "d" (nr ^ 31), "o" (*vaddr) +		: "memory"); +	return retval; +} + +#if defined(CONFIG_COLDFIRE) +#define	test_and_change_bit(nr, vaddr)	bchg_reg_test_and_change_bit(nr, vaddr) +#elif defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#define	test_and_change_bit(nr, vaddr)	bchg_mem_test_and_change_bit(nr, vaddr) +#else +#define test_and_change_bit(nr, vaddr)	(__builtin_constant_p(nr) ? \ +					bchg_mem_test_and_change_bit(nr, vaddr) : \ +					bfchg_mem_test_and_change_bit(nr, vaddr)) +#endif + +#define __test_and_change_bit(nr, vaddr) test_and_change_bit(nr, vaddr) + + +/* + *	The true 68020 and more advanced processors support the "bfffo" + *	instruction for finding bits. ColdFire and simple 68000 parts + *	(including CPU32) do not support this. They simply use the generic + *	functions. + */ +#if defined(CONFIG_CPU_HAS_NO_BITFIELDS) +#include <asm-generic/bitops/find.h> +#include <asm-generic/bitops/ffz.h> +#else + +static inline int find_first_zero_bit(const unsigned long *vaddr, +				      unsigned size) +{ +	const unsigned long *p = vaddr; +	int res = 32; +	unsigned int words; +	unsigned long num; + +	if (!size) +		return 0; + +	words = (size + 31) >> 5; +	while (!(num = ~*p++)) { +		if (!--words) +			goto out; +	} + +	__asm__ __volatile__ ("bfffo %1{#0,#0},%0" +			      : "=d" (res) : "d" (num & -num)); +	res ^= 31; +out: +	res += ((long)p - (long)vaddr - 4) * 8; +	return res < size ? res : size; +} +#define find_first_zero_bit find_first_zero_bit + +static inline int find_next_zero_bit(const unsigned long *vaddr, int size, +				     int offset) +{ +	const unsigned long *p = vaddr + (offset >> 5); +	int bit = offset & 31UL, res; + +	if (offset >= size) +		return size; + +	if (bit) { +		unsigned long num = ~*p++ & (~0UL << bit); +		offset -= bit; + +		/* Look for zero in first longword */ +		__asm__ __volatile__ ("bfffo %1{#0,#0},%0" +				      : "=d" (res) : "d" (num & -num)); +		if (res < 32) { +			offset += res ^ 31; +			return offset < size ? offset : size; +		} +		offset += 32; + +		if (offset >= size) +			return size; +	} +	/* No zero yet, search remaining full bytes for a zero */ +	return offset + find_first_zero_bit(p, size - offset); +} +#define find_next_zero_bit find_next_zero_bit + +static inline int find_first_bit(const unsigned long *vaddr, unsigned size) +{ +	const unsigned long *p = vaddr; +	int res = 32; +	unsigned int words; +	unsigned long num; + +	if (!size) +		return 0; + +	words = (size + 31) >> 5; +	while (!(num = *p++)) { +		if (!--words) +			goto out; +	} + +	__asm__ __volatile__ ("bfffo %1{#0,#0},%0" +			      : "=d" (res) : "d" (num & -num)); +	res ^= 31; +out: +	res += ((long)p - (long)vaddr - 4) * 8; +	return res < size ? res : size; +} +#define find_first_bit find_first_bit + +static inline int find_next_bit(const unsigned long *vaddr, int size, +				int offset) +{ +	const unsigned long *p = vaddr + (offset >> 5); +	int bit = offset & 31UL, res; + +	if (offset >= size) +		return size; + +	if (bit) { +		unsigned long num = *p++ & (~0UL << bit); +		offset -= bit; + +		/* Look for one in first longword */ +		__asm__ __volatile__ ("bfffo %1{#0,#0},%0" +				      : "=d" (res) : "d" (num & -num)); +		if (res < 32) { +			offset += res ^ 31; +			return offset < size ? offset : size; +		} +		offset += 32; + +		if (offset >= size) +			return size; +	} +	/* No one yet, search remaining full bytes for a one */ +	return offset + find_first_bit(p, size - offset); +} +#define find_next_bit find_next_bit + +/* + * ffz = Find First Zero in word. Undefined if no zero exists, + * so code should check against ~0UL first.. + */ +static inline unsigned long ffz(unsigned long word) +{ +	int res; + +	__asm__ __volatile__ ("bfffo %1{#0,#0},%0" +			      : "=d" (res) : "d" (~word & -~word)); +	return res ^ 31; +} + +#endif + +#ifdef __KERNEL__ + +#if defined(CONFIG_CPU_HAS_NO_BITFIELDS) + +/* + *	The newer ColdFire family members support a "bitrev" instruction + *	and we can use that to implement a fast ffs. Older Coldfire parts, + *	and normal 68000 parts don't have anything special, so we use the + *	generic functions for those. + */ +#if (defined(__mcfisaaplus__) || defined(__mcfisac__)) && \ +	!defined(CONFIG_M68000) && !defined(CONFIG_MCPU32) +static inline int __ffs(int x) +{ +	__asm__ __volatile__ ("bitrev %0; ff1 %0" +		: "=d" (x) +		: "0" (x)); +	return x; +} + +static inline int ffs(int x) +{ +	if (!x) +		return 0; +	return __ffs(x) + 1; +} + +#else +#include <asm-generic/bitops/ffs.h> +#include <asm-generic/bitops/__ffs.h> +#endif + +#include <asm-generic/bitops/fls.h> +#include <asm-generic/bitops/__fls.h> +  #else -#include "bitops_mm.h" + +/* + *	ffs: find first bit set. This is defined the same way as + *	the libc and compiler builtin ffs routines, therefore + *	differs in spirit from the above ffz (man ffs). + */ +static inline int ffs(int x) +{ +	int cnt; + +	__asm__ ("bfffo %1{#0:#0},%0" +		: "=d" (cnt) +		: "dm" (x & -x)); +	return 32 - cnt; +} +#define __ffs(x) (ffs(x) - 1) + +/* + *	fls: find last bit set. + */ +static inline int fls(int x) +{ +	int cnt; + +	__asm__ ("bfffo %1{#0,#0},%0" +		: "=d" (cnt) +		: "dm" (x)); +	return 32 - cnt; +} + +static inline int __fls(int x) +{ +	return fls(x) - 1; +} +  #endif + +#include <asm-generic/bitops/ext2-atomic.h> +#include <asm-generic/bitops/le.h> +#include <asm-generic/bitops/fls64.h> +#include <asm-generic/bitops/sched.h> +#include <asm-generic/bitops/hweight.h> +#include <asm-generic/bitops/lock.h> +#endif /* __KERNEL__ */ + +#endif /* _M68K_BITOPS_H */ diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h deleted file mode 100644 index b4ecdaada52..00000000000 --- a/arch/m68k/include/asm/bitops_mm.h +++ /dev/null @@ -1,466 +0,0 @@ -#ifndef _M68K_BITOPS_H -#define _M68K_BITOPS_H -/* - * Copyright 1992, Linus Torvalds. - * - * This file is subject to the terms and conditions of the GNU General Public - * License.  See the file COPYING in the main directory of this archive - * for more details. - */ - -#ifndef _LINUX_BITOPS_H -#error only <linux/bitops.h> can be included directly -#endif - -#include <linux/compiler.h> - -/* - * Require 68020 or better. - * - * They use the standard big-endian m680x0 bit ordering. - */ - -#define test_and_set_bit(nr,vaddr) \ -  (__builtin_constant_p(nr) ? \ -   __constant_test_and_set_bit(nr, vaddr) : \ -   __generic_test_and_set_bit(nr, vaddr)) - -#define __test_and_set_bit(nr,vaddr) test_and_set_bit(nr,vaddr) - -static inline int __constant_test_and_set_bit(int nr, unsigned long *vaddr) -{ -	char *p = (char *)vaddr + (nr ^ 31) / 8; -	char retval; - -	__asm__ __volatile__ ("bset %2,%1; sne %0" -			: "=d" (retval), "+m" (*p) -			: "di" (nr & 7)); - -	return retval; -} - -static inline int __generic_test_and_set_bit(int nr, unsigned long *vaddr) -{ -	char retval; - -	__asm__ __volatile__ ("bfset %2{%1:#1}; sne %0" -			: "=d" (retval) : "d" (nr^31), "o" (*vaddr) : "memory"); - -	return retval; -} - -#define set_bit(nr,vaddr) \ -  (__builtin_constant_p(nr) ? \ -   __constant_set_bit(nr, vaddr) : \ -   __generic_set_bit(nr, vaddr)) - -#define __set_bit(nr,vaddr) set_bit(nr,vaddr) - -static inline void __constant_set_bit(int nr, volatile unsigned long *vaddr) -{ -	char *p = (char *)vaddr + (nr ^ 31) / 8; -	__asm__ __volatile__ ("bset %1,%0" -			: "+m" (*p) : "di" (nr & 7)); -} - -static inline void __generic_set_bit(int nr, volatile unsigned long *vaddr) -{ -	__asm__ __volatile__ ("bfset %1{%0:#1}" -			: : "d" (nr^31), "o" (*vaddr) : "memory"); -} - -#define test_and_clear_bit(nr,vaddr) \ -  (__builtin_constant_p(nr) ? \ -   __constant_test_and_clear_bit(nr, vaddr) : \ -   __generic_test_and_clear_bit(nr, vaddr)) - -#define __test_and_clear_bit(nr,vaddr) test_and_clear_bit(nr,vaddr) - -static inline int __constant_test_and_clear_bit(int nr, unsigned long *vaddr) -{ -	char *p = (char *)vaddr + (nr ^ 31) / 8; -	char retval; - -	__asm__ __volatile__ ("bclr %2,%1; sne %0" -			: "=d" (retval), "+m" (*p) -			: "di" (nr & 7)); - -	return retval; -} - -static inline int __generic_test_and_clear_bit(int nr, unsigned long *vaddr) -{ -	char retval; - -	__asm__ __volatile__ ("bfclr %2{%1:#1}; sne %0" -			: "=d" (retval) : "d" (nr^31), "o" (*vaddr) : "memory"); - -	return retval; -} - -/* - * clear_bit() doesn't provide any barrier for the compiler. - */ -#define smp_mb__before_clear_bit()	barrier() -#define smp_mb__after_clear_bit()	barrier() - -#define clear_bit(nr,vaddr) \ -  (__builtin_constant_p(nr) ? \ -   __constant_clear_bit(nr, vaddr) : \ -   __generic_clear_bit(nr, vaddr)) -#define __clear_bit(nr,vaddr) clear_bit(nr,vaddr) - -static inline void __constant_clear_bit(int nr, volatile unsigned long *vaddr) -{ -	char *p = (char *)vaddr + (nr ^ 31) / 8; -	__asm__ __volatile__ ("bclr %1,%0" -			: "+m" (*p) : "di" (nr & 7)); -} - -static inline void __generic_clear_bit(int nr, volatile unsigned long *vaddr) -{ -	__asm__ __volatile__ ("bfclr %1{%0:#1}" -			: : "d" (nr^31), "o" (*vaddr) : "memory"); -} - -#define test_and_change_bit(nr,vaddr) \ -  (__builtin_constant_p(nr) ? \ -   __constant_test_and_change_bit(nr, vaddr) : \ -   __generic_test_and_change_bit(nr, vaddr)) - -#define __test_and_change_bit(nr,vaddr) test_and_change_bit(nr,vaddr) -#define __change_bit(nr,vaddr) change_bit(nr,vaddr) - -static inline int __constant_test_and_change_bit(int nr, unsigned long *vaddr) -{ -	char *p = (char *)vaddr + (nr ^ 31) / 8; -	char retval; - -	__asm__ __volatile__ ("bchg %2,%1; sne %0" -			: "=d" (retval), "+m" (*p) -			: "di" (nr & 7)); - -	return retval; -} - -static inline int __generic_test_and_change_bit(int nr, unsigned long *vaddr) -{ -	char retval; - -	__asm__ __volatile__ ("bfchg %2{%1:#1}; sne %0" -			: "=d" (retval) : "d" (nr^31), "o" (*vaddr) : "memory"); - -	return retval; -} - -#define change_bit(nr,vaddr) \ -  (__builtin_constant_p(nr) ? \ -   __constant_change_bit(nr, vaddr) : \ -   __generic_change_bit(nr, vaddr)) - -static inline void __constant_change_bit(int nr, unsigned long *vaddr) -{ -	char *p = (char *)vaddr + (nr ^ 31) / 8; -	__asm__ __volatile__ ("bchg %1,%0" -			: "+m" (*p) : "di" (nr & 7)); -} - -static inline void __generic_change_bit(int nr, unsigned long *vaddr) -{ -	__asm__ __volatile__ ("bfchg %1{%0:#1}" -			: : "d" (nr^31), "o" (*vaddr) : "memory"); -} - -static inline int test_bit(int nr, const unsigned long *vaddr) -{ -	return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0; -} - -static inline int find_first_zero_bit(const unsigned long *vaddr, -				      unsigned size) -{ -	const unsigned long *p = vaddr; -	int res = 32; -	unsigned long num; - -	if (!size) -		return 0; - -	size = (size + 31) >> 5; -	while (!(num = ~*p++)) { -		if (!--size) -			goto out; -	} - -	__asm__ __volatile__ ("bfffo %1{#0,#0},%0" -			      : "=d" (res) : "d" (num & -num)); -	res ^= 31; -out: -	return ((long)p - (long)vaddr - 4) * 8 + res; -} - -static inline int find_next_zero_bit(const unsigned long *vaddr, int size, -				     int offset) -{ -	const unsigned long *p = vaddr + (offset >> 5); -	int bit = offset & 31UL, res; - -	if (offset >= size) -		return size; - -	if (bit) { -		unsigned long num = ~*p++ & (~0UL << bit); -		offset -= bit; - -		/* Look for zero in first longword */ -		__asm__ __volatile__ ("bfffo %1{#0,#0},%0" -				      : "=d" (res) : "d" (num & -num)); -		if (res < 32) -			return offset + (res ^ 31); -		offset += 32; -	} -	/* No zero yet, search remaining full bytes for a zero */ -	res = find_first_zero_bit(p, size - ((long)p - (long)vaddr) * 8); -	return offset + res; -} - -static inline int find_first_bit(const unsigned long *vaddr, unsigned size) -{ -	const unsigned long *p = vaddr; -	int res = 32; -	unsigned long num; - -	if (!size) -		return 0; - -	size = (size + 31) >> 5; -	while (!(num = *p++)) { -		if (!--size) -			goto out; -	} - -	__asm__ __volatile__ ("bfffo %1{#0,#0},%0" -			      : "=d" (res) : "d" (num & -num)); -	res ^= 31; -out: -	return ((long)p - (long)vaddr - 4) * 8 + res; -} - -static inline int find_next_bit(const unsigned long *vaddr, int size, -				int offset) -{ -	const unsigned long *p = vaddr + (offset >> 5); -	int bit = offset & 31UL, res; - -	if (offset >= size) -		return size; - -	if (bit) { -		unsigned long num = *p++ & (~0UL << bit); -		offset -= bit; - -		/* Look for one in first longword */ -		__asm__ __volatile__ ("bfffo %1{#0,#0},%0" -				      : "=d" (res) : "d" (num & -num)); -		if (res < 32) -			return offset + (res ^ 31); -		offset += 32; -	} -	/* No one yet, search remaining full bytes for a one */ -	res = find_first_bit(p, size - ((long)p - (long)vaddr) * 8); -	return offset + res; -} - -/* - * ffz = Find First Zero in word. Undefined if no zero exists, - * so code should check against ~0UL first.. - */ -static inline unsigned long ffz(unsigned long word) -{ -	int res; - -	__asm__ __volatile__ ("bfffo %1{#0,#0},%0" -			      : "=d" (res) : "d" (~word & -~word)); -	return res ^ 31; -} - -#ifdef __KERNEL__ - -/* - * ffs: find first bit set. This is defined the same way as - * the libc and compiler builtin ffs routines, therefore - * differs in spirit from the above ffz (man ffs). - */ - -static inline int ffs(int x) -{ -	int cnt; - -	asm ("bfffo %1{#0:#0},%0" : "=d" (cnt) : "dm" (x & -x)); - -	return 32 - cnt; -} -#define __ffs(x) (ffs(x) - 1) - -/* - * fls: find last bit set. - */ - -static inline int fls(int x) -{ -	int cnt; - -	asm ("bfffo %1{#0,#0},%0" : "=d" (cnt) : "dm" (x)); - -	return 32 - cnt; -} - -static inline int __fls(int x) -{ -	return fls(x) - 1; -} - -#include <asm-generic/bitops/fls64.h> -#include <asm-generic/bitops/sched.h> -#include <asm-generic/bitops/hweight.h> -#include <asm-generic/bitops/lock.h> - -/* Bitmap functions for the minix filesystem */ - -static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size) -{ -	const unsigned short *p = vaddr, *addr = vaddr; -	int res; -	unsigned short num; - -	if (!size) -		return 0; - -	size = (size >> 4) + ((size & 15) > 0); -	while (*p++ == 0xffff) -	{ -		if (--size == 0) -			return (p - addr) << 4; -	} - -	num = ~*--p; -	__asm__ __volatile__ ("bfffo %1{#16,#16},%0" -			      : "=d" (res) : "d" (num & -num)); -	return ((p - addr) << 4) + (res ^ 31); -} - -#define minix_test_and_set_bit(nr, addr)	__test_and_set_bit((nr) ^ 16, (unsigned long *)(addr)) -#define minix_set_bit(nr,addr)			__set_bit((nr) ^ 16, (unsigned long *)(addr)) -#define minix_test_and_clear_bit(nr, addr)	__test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr)) - -static inline int minix_test_bit(int nr, const void *vaddr) -{ -	const unsigned short *p = vaddr; -	return (p[nr >> 4] & (1U << (nr & 15))) != 0; -} - -/* Bitmap functions for the ext2 filesystem. */ - -#define ext2_set_bit(nr, addr)			__test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) -#define ext2_set_bit_atomic(lock, nr, addr)	test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) -#define ext2_clear_bit(nr, addr)		__test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) -#define ext2_clear_bit_atomic(lock, nr, addr)	test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) -#define ext2_find_next_zero_bit(addr, size, offset) \ -	generic_find_next_zero_le_bit((unsigned long *)addr, size, offset) -#define ext2_find_next_bit(addr, size, offset) \ -	generic_find_next_le_bit((unsigned long *)addr, size, offset) - -static inline int ext2_test_bit(int nr, const void *vaddr) -{ -	const unsigned char *p = vaddr; -	return (p[nr >> 3] & (1U << (nr & 7))) != 0; -} - -static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size) -{ -	const unsigned long *p = vaddr, *addr = vaddr; -	int res; - -	if (!size) -		return 0; - -	size = (size >> 5) + ((size & 31) > 0); -	while (*p++ == ~0UL) -	{ -		if (--size == 0) -			return (p - addr) << 5; -	} - -	--p; -	for (res = 0; res < 32; res++) -		if (!ext2_test_bit (res, p)) -			break; -	return (p - addr) * 32 + res; -} - -static inline unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, -		unsigned long size, unsigned long offset) -{ -	const unsigned long *p = addr + (offset >> 5); -	int bit = offset & 31UL, res; - -	if (offset >= size) -		return size; - -	if (bit) { -		/* Look for zero in first longword */ -		for (res = bit; res < 32; res++) -			if (!ext2_test_bit (res, p)) -				return (p - addr) * 32 + res; -		p++; -	} -	/* No zero yet, search remaining full bytes for a zero */ -	res = ext2_find_first_zero_bit (p, size - 32 * (p - addr)); -	return (p - addr) * 32 + res; -} - -static inline int ext2_find_first_bit(const void *vaddr, unsigned size) -{ -	const unsigned long *p = vaddr, *addr = vaddr; -	int res; - -	if (!size) -		return 0; - -	size = (size >> 5) + ((size & 31) > 0); -	while (*p++ == 0UL) { -		if (--size == 0) -			return (p - addr) << 5; -	} - -	--p; -	for (res = 0; res < 32; res++) -		if (ext2_test_bit(res, p)) -			break; -	return (p - addr) * 32 + res; -} - -static inline unsigned long generic_find_next_le_bit(const unsigned long *addr, -		unsigned long size, unsigned long offset) -{ -	const unsigned long *p = addr + (offset >> 5); -	int bit = offset & 31UL, res; - -	if (offset >= size) -		return size; - -	if (bit) { -		/* Look for one in first longword */ -		for (res = bit; res < 32; res++) -			if (ext2_test_bit(res, p)) -				return (p - addr) * 32 + res; -		p++; -	} -	/* No set bit yet, search remaining full bytes for a set bit */ -	res = ext2_find_first_bit(p, size - 32 * (p - addr)); -	return (p - addr) * 32 + res; -} - -#endif /* __KERNEL__ */ - -#endif /* _M68K_BITOPS_H */ diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h deleted file mode 100644 index 9d3cbe5fad1..00000000000 --- a/arch/m68k/include/asm/bitops_no.h +++ /dev/null @@ -1,337 +0,0 @@ -#ifndef _M68KNOMMU_BITOPS_H -#define _M68KNOMMU_BITOPS_H - -/* - * Copyright 1992, Linus Torvalds. - */ - -#include <linux/compiler.h> -#include <asm/byteorder.h>	/* swab32 */ - -#ifdef __KERNEL__ - -#ifndef _LINUX_BITOPS_H -#error only <linux/bitops.h> can be included directly -#endif - -#if defined (__mcfisaaplus__) || defined (__mcfisac__) -static inline int ffs(unsigned int val) -{ -        if (!val) -                return 0; - -        asm volatile( -                        "bitrev %0\n\t" -                        "ff1 %0\n\t" -                        : "=d" (val) -                        : "0" (val) -		    ); -        val++; -        return val; -} - -static inline int __ffs(unsigned int val) -{ -        asm volatile( -                        "bitrev %0\n\t" -                        "ff1 %0\n\t" -                        : "=d" (val) -                        : "0" (val) -		    ); -        return val; -} - -#else -#include <asm-generic/bitops/ffs.h> -#include <asm-generic/bitops/__ffs.h> -#endif - -#include <asm-generic/bitops/sched.h> -#include <asm-generic/bitops/ffz.h> - -static __inline__ void set_bit(int nr, volatile unsigned long * addr) -{ -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %0,%%a0; bset %1,(%%a0)" -	     : "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "d" (nr) -	     : "%a0", "cc"); -#else -	__asm__ __volatile__ ("bset %1,%0" -	     : "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "di" (nr) -	     : "cc"); -#endif -} - -#define __set_bit(nr, addr) set_bit(nr, addr) - -/* - * clear_bit() doesn't provide any barrier for the compiler. - */ -#define smp_mb__before_clear_bit()	barrier() -#define smp_mb__after_clear_bit()	barrier() - -static __inline__ void clear_bit(int nr, volatile unsigned long * addr) -{ -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %0,%%a0; bclr %1,(%%a0)" -	     : "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "d" (nr) -	     : "%a0", "cc"); -#else -	__asm__ __volatile__ ("bclr %1,%0" -	     : "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "di" (nr) -	     : "cc"); -#endif -} - -#define __clear_bit(nr, addr) clear_bit(nr, addr) - -static __inline__ void change_bit(int nr, volatile unsigned long * addr) -{ -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %0,%%a0; bchg %1,(%%a0)" -	     : "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "d" (nr) -	     : "%a0", "cc"); -#else -	__asm__ __volatile__ ("bchg %1,%0" -	     : "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "di" (nr) -	     : "cc"); -#endif -} - -#define __change_bit(nr, addr) change_bit(nr, addr) - -static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) -{ -	char retval; - -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %1,%%a0; bset %2,(%%a0); sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "d" (nr) -	     : "%a0"); -#else -	__asm__ __volatile__ ("bset %2,%1; sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "di" (nr) -	     /* No clobber */); -#endif - -	return retval; -} - -#define __test_and_set_bit(nr, addr) test_and_set_bit(nr, addr) - -static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) -{ -	char retval; - -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %1,%%a0; bclr %2,(%%a0); sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "d" (nr) -	     : "%a0"); -#else -	__asm__ __volatile__ ("bclr %2,%1; sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "di" (nr) -	     /* No clobber */); -#endif - -	return retval; -} - -#define __test_and_clear_bit(nr, addr) test_and_clear_bit(nr, addr) - -static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) -{ -	char retval; - -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %1,%%a0\n\tbchg %2,(%%a0)\n\tsne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "d" (nr) -	     : "%a0"); -#else -	__asm__ __volatile__ ("bchg %2,%1; sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[(nr^31) >> 3]) -	     : "di" (nr) -	     /* No clobber */); -#endif - -	return retval; -} - -#define __test_and_change_bit(nr, addr) test_and_change_bit(nr, addr) - -/* - * This routine doesn't need to be atomic. - */ -static __inline__ int __constant_test_bit(int nr, const volatile unsigned long * addr) -{ -	return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0; -} - -static __inline__ int __test_bit(int nr, const volatile unsigned long * addr) -{ -	int 	* a = (int *) addr; -	int	mask; - -	a += nr >> 5; -	mask = 1 << (nr & 0x1f); -	return ((mask & *a) != 0); -} - -#define test_bit(nr,addr) \ -(__builtin_constant_p(nr) ? \ - __constant_test_bit((nr),(addr)) : \ - __test_bit((nr),(addr))) - -#include <asm-generic/bitops/find.h> -#include <asm-generic/bitops/hweight.h> -#include <asm-generic/bitops/lock.h> - -static __inline__ int ext2_set_bit(int nr, volatile void * addr) -{ -	char retval; - -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %1,%%a0; bset %2,(%%a0); sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3]) -	     : "d" (nr) -	     : "%a0"); -#else -	__asm__ __volatile__ ("bset %2,%1; sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3]) -	     : "di" (nr) -	     /* No clobber */); -#endif - -	return retval; -} - -static __inline__ int ext2_clear_bit(int nr, volatile void * addr) -{ -	char retval; - -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %1,%%a0; bclr %2,(%%a0); sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3]) -	     : "d" (nr) -	     : "%a0"); -#else -	__asm__ __volatile__ ("bclr %2,%1; sne %0" -	     : "=d" (retval), "+m" (((volatile char *)addr)[nr >> 3]) -	     : "di" (nr) -	     /* No clobber */); -#endif - -	return retval; -} - -#define ext2_set_bit_atomic(lock, nr, addr)		\ -	({						\ -		int ret;				\ -		spin_lock(lock);			\ -		ret = ext2_set_bit((nr), (addr));	\ -		spin_unlock(lock);			\ -		ret;					\ -	}) - -#define ext2_clear_bit_atomic(lock, nr, addr)		\ -	({						\ -		int ret;				\ -		spin_lock(lock);			\ -		ret = ext2_clear_bit((nr), (addr));	\ -		spin_unlock(lock);			\ -		ret;					\ -	}) - -static __inline__ int ext2_test_bit(int nr, const volatile void * addr) -{ -	char retval; - -#ifdef CONFIG_COLDFIRE -	__asm__ __volatile__ ("lea %1,%%a0; btst %2,(%%a0); sne %0" -	     : "=d" (retval) -	     : "m" (((const volatile char *)addr)[nr >> 3]), "d" (nr) -	     : "%a0"); -#else -	__asm__ __volatile__ ("btst %2,%1; sne %0" -	     : "=d" (retval) -	     : "m" (((const volatile char *)addr)[nr >> 3]), "di" (nr) -	     /* No clobber */); -#endif - -	return retval; -} - -#define ext2_find_first_zero_bit(addr, size) \ -        ext2_find_next_zero_bit((addr), (size), 0) - -static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) -{ -	unsigned long *p = ((unsigned long *) addr) + (offset >> 5); -	unsigned long result = offset & ~31UL; -	unsigned long tmp; - -	if (offset >= size) -		return size; -	size -= result; -	offset &= 31UL; -	if(offset) { -		/* We hold the little endian value in tmp, but then the -		 * shift is illegal. So we could keep a big endian value -		 * in tmp, like this: -		 * -		 * tmp = __swab32(*(p++)); -		 * tmp |= ~0UL >> (32-offset); -		 * -		 * but this would decrease performance, so we change the -		 * shift: -		 */ -		tmp = *(p++); -		tmp |= __swab32(~0UL >> (32-offset)); -		if(size < 32) -			goto found_first; -		if(~tmp) -			goto found_middle; -		size -= 32; -		result += 32; -	} -	while(size & ~31UL) { -		if(~(tmp = *(p++))) -			goto found_middle; -		result += 32; -		size -= 32; -	} -	if(!size) -		return result; -	tmp = *p; - -found_first: -	/* tmp is little endian, so we would have to swab the shift, -	 * see above. But then we have to swab tmp below for ffz, so -	 * we might as well do this here. -	 */ -	return result + ffz(__swab32(tmp) | (~0UL << size)); -found_middle: -	return result + ffz(__swab32(tmp)); -} - -#define ext2_find_next_bit(addr, size, off) \ -	generic_find_next_le_bit((unsigned long *)(addr), (size), (off)) -#include <asm-generic/bitops/minix.h> - -#endif /* __KERNEL__ */ - -#include <asm-generic/bitops/fls.h> -#include <asm-generic/bitops/__fls.h> -#include <asm-generic/bitops/fls64.h> - -#endif /* _M68KNOMMU_BITOPS_H */ diff --git a/arch/m68k/include/asm/bitsperlong.h b/arch/m68k/include/asm/bitsperlong.h deleted file mode 100644 index 6dc0bb0c13b..00000000000 --- a/arch/m68k/include/asm/bitsperlong.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/bitsperlong.h> diff --git a/arch/m68k/include/asm/blinken.h b/arch/m68k/include/asm/blinken.h index 1a749cf7b06..0626582a7db 100644 --- a/arch/m68k/include/asm/blinken.h +++ b/arch/m68k/include/asm/blinken.h @@ -17,15 +17,15 @@  #define HP300_LEDS		0xf001ffff -extern unsigned char ledstate; +extern unsigned char hp300_ledstate;  static __inline__ void blinken_leds(int on, int off)  {  	if (MACH_IS_HP300)  	{ -		ledstate |= on; -		ledstate &= ~off; -		out_8(HP300_LEDS, ~ledstate); +		hp300_ledstate |= on; +		hp300_ledstate &= ~off; +		out_8(HP300_LEDS, ~hp300_ledstate);  	}  } diff --git a/arch/m68k/include/asm/bootinfo.h b/arch/m68k/include/asm/bootinfo.h index 67e7a78ad96..8e213267f8e 100644 --- a/arch/m68k/include/asm/bootinfo.h +++ b/arch/m68k/include/asm/bootinfo.h @@ -6,373 +6,23 @@  ** This file is subject to the terms and conditions of the GNU General Public  ** License.  See the file COPYING in the main directory of this archive  ** for more details. -** -** Created 09/29/92 by Greg Harp -** -** 5/2/94 Roman Hodek: -**   Added bi_atari part of the machine dependent union bi_un; for now it -**   contains just a model field to distinguish between TT and Falcon. -** 26/7/96 Roman Zippel: -**   Renamed to setup.h; added some useful macros to allow gcc some -**   optimizations if possible. -** 5/10/96 Geert Uytterhoeven: -**   Redesign of the boot information structure; renamed to bootinfo.h again -** 27/11/96 Geert Uytterhoeven: -**   Backwards compatibility with bootinfo interface version 1.0  */  #ifndef _M68K_BOOTINFO_H  #define _M68K_BOOTINFO_H +#include <uapi/asm/bootinfo.h> -    /* -     *  Bootinfo definitions -     * -     *  This is an easily parsable and extendable structure containing all -     *  information to be passed from the bootstrap to the kernel. -     * -     *  This way I hope to keep all future changes back/forewards compatible. -     *  Thus, keep your fingers crossed... -     * -     *  This structure is copied right after the kernel bss by the bootstrap -     *  routine. -     */  #ifndef __ASSEMBLY__ -struct bi_record { -    unsigned short tag;			/* tag ID */ -    unsigned short size;		/* size of record (in bytes) */ -    unsigned long data[0];		/* data */ -}; - -#endif /* __ASSEMBLY__ */ - - -    /* -     *  Tag Definitions -     * -     *  Machine independent tags start counting from 0x0000 -     *  Machine dependent tags start counting from 0x8000 -     */ - -#define BI_LAST			0x0000	/* last record (sentinel) */ -#define BI_MACHTYPE		0x0001	/* machine type (u_long) */ -#define BI_CPUTYPE		0x0002	/* cpu type (u_long) */ -#define BI_FPUTYPE		0x0003	/* fpu type (u_long) */ -#define BI_MMUTYPE		0x0004	/* mmu type (u_long) */ -#define BI_MEMCHUNK		0x0005	/* memory chunk address and size */ -					/* (struct mem_info) */ -#define BI_RAMDISK		0x0006	/* ramdisk address and size */ -					/* (struct mem_info) */ -#define BI_COMMAND_LINE		0x0007	/* kernel command line parameters */ -					/* (string) */ - -    /* -     *  Amiga-specific tags -     */ - -#define BI_AMIGA_MODEL		0x8000	/* model (u_long) */ -#define BI_AMIGA_AUTOCON	0x8001	/* AutoConfig device */ -					/* (struct ConfigDev) */ -#define BI_AMIGA_CHIP_SIZE	0x8002	/* size of Chip RAM (u_long) */ -#define BI_AMIGA_VBLANK		0x8003	/* VBLANK frequency (u_char) */ -#define BI_AMIGA_PSFREQ		0x8004	/* power supply frequency (u_char) */ -#define BI_AMIGA_ECLOCK		0x8005	/* EClock frequency (u_long) */ -#define BI_AMIGA_CHIPSET	0x8006	/* native chipset present (u_long) */ -#define BI_AMIGA_SERPER		0x8007	/* serial port period (u_short) */ - -    /* -     *  Atari-specific tags -     */ - -#define BI_ATARI_MCH_COOKIE	0x8000	/* _MCH cookie from TOS (u_long) */ -#define BI_ATARI_MCH_TYPE	0x8001	/* special machine type (u_long) */ -					/* (values are ATARI_MACH_* defines */ - -/* mch_cookie values (upper word) */ -#define ATARI_MCH_ST		0 -#define ATARI_MCH_STE		1 -#define ATARI_MCH_TT		2 -#define ATARI_MCH_FALCON	3 - -/* mch_type values */ -#define ATARI_MACH_NORMAL	0	/* no special machine type */ -#define ATARI_MACH_MEDUSA	1	/* Medusa 040 */ -#define ATARI_MACH_HADES	2	/* Hades 040 or 060 */ -#define ATARI_MACH_AB40		3	/* Afterburner040 on Falcon */ - -    /* -     *  VME-specific tags -     */ - -#define BI_VME_TYPE		0x8000	/* VME sub-architecture (u_long) */ -#define BI_VME_BRDINFO		0x8001	/* VME board information (struct) */ - -/* BI_VME_TYPE codes */ -#define	VME_TYPE_TP34V		0x0034	/* Tadpole TP34V */ -#define VME_TYPE_MVME147	0x0147	/* Motorola MVME147 */ -#define VME_TYPE_MVME162	0x0162	/* Motorola MVME162 */ -#define VME_TYPE_MVME166	0x0166	/* Motorola MVME166 */ -#define VME_TYPE_MVME167	0x0167	/* Motorola MVME167 */ -#define VME_TYPE_MVME172	0x0172	/* Motorola MVME172 */ -#define VME_TYPE_MVME177	0x0177	/* Motorola MVME177 */ -#define VME_TYPE_BVME4000	0x4000	/* BVM Ltd. BVME4000 */ -#define VME_TYPE_BVME6000	0x6000	/* BVM Ltd. BVME6000 */ - -/* BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on - * Motorola VME boards.  Contains board number, Bug version, board - * configuration options, etc.  See include/asm/mvme16xhw.h for details. - */ - - -    /* -     *  Macintosh-specific tags (all u_long) -     */ - -#define BI_MAC_MODEL		0x8000	/* Mac Gestalt ID (model type) */ -#define BI_MAC_VADDR		0x8001	/* Mac video base address */ -#define BI_MAC_VDEPTH		0x8002	/* Mac video depth */ -#define BI_MAC_VROW		0x8003	/* Mac video rowbytes */ -#define BI_MAC_VDIM		0x8004	/* Mac video dimensions */ -#define BI_MAC_VLOGICAL		0x8005	/* Mac video logical base */ -#define BI_MAC_SCCBASE		0x8006	/* Mac SCC base address */ -#define BI_MAC_BTIME		0x8007	/* Mac boot time */ -#define BI_MAC_GMTBIAS		0x8008	/* Mac GMT timezone offset */ -#define BI_MAC_MEMSIZE		0x8009	/* Mac RAM size (sanity check) */ -#define BI_MAC_CPUID		0x800a	/* Mac CPU type (sanity check) */ -#define BI_MAC_ROMBASE		0x800b	/* Mac system ROM base address */ - -    /* -     *  Macintosh hardware profile data - unused, see macintosh.h for -     *  reasonable type values -     */ - -#define BI_MAC_VIA1BASE		0x8010	/* Mac VIA1 base address (always present) */ -#define BI_MAC_VIA2BASE		0x8011	/* Mac VIA2 base address (type varies) */ -#define BI_MAC_VIA2TYPE		0x8012	/* Mac VIA2 type (VIA, RBV, OSS) */ -#define BI_MAC_ADBTYPE		0x8013	/* Mac ADB interface type */ -#define BI_MAC_ASCBASE		0x8014	/* Mac Apple Sound Chip base address */ -#define BI_MAC_SCSI5380		0x8015	/* Mac NCR 5380 SCSI (base address, multi) */ -#define BI_MAC_SCSIDMA		0x8016	/* Mac SCSI DMA (base address) */ -#define BI_MAC_SCSI5396		0x8017	/* Mac NCR 53C96 SCSI (base address, multi) */ -#define BI_MAC_IDETYPE		0x8018	/* Mac IDE interface type */ -#define BI_MAC_IDEBASE		0x8019	/* Mac IDE interface base address */ -#define BI_MAC_NUBUS		0x801a	/* Mac Nubus type (none, regular, pseudo) */ -#define BI_MAC_SLOTMASK		0x801b	/* Mac Nubus slots present */ -#define BI_MAC_SCCTYPE		0x801c	/* Mac SCC serial type (normal, IOP) */ -#define BI_MAC_ETHTYPE		0x801d	/* Mac builtin ethernet type (Sonic, MACE */ -#define BI_MAC_ETHBASE		0x801e	/* Mac builtin ethernet base address */ -#define BI_MAC_PMU		0x801f	/* Mac power management / poweroff hardware */ -#define BI_MAC_IOP_SWIM		0x8020	/* Mac SWIM floppy IOP */ -#define BI_MAC_IOP_ADB		0x8021	/* Mac ADB IOP */ - -    /* -     * Mac: compatibility with old booter data format (temporarily) -     * Fields unused with the new bootinfo can be deleted now; instead of -     * adding new fields the struct might be splitted into a hardware address -     * part and a hardware type part -     */ - -#ifndef __ASSEMBLY__ - -struct mac_booter_data -{ -	unsigned long videoaddr; -	unsigned long videorow; -	unsigned long videodepth; -	unsigned long dimensions; -	unsigned long args; -	unsigned long boottime; -	unsigned long gmtbias; -	unsigned long bootver; -	unsigned long videological; -	unsigned long sccbase; -	unsigned long id; -	unsigned long memsize; -	unsigned long serialmf; -	unsigned long serialhsk; -	unsigned long serialgpi; -	unsigned long printmf; -	unsigned long printhsk; -	unsigned long printgpi; -	unsigned long cpuid; -	unsigned long rombase; -	unsigned long adbdelay; -	unsigned long timedbra; -}; - -extern struct mac_booter_data -	mac_bi_data; - +#ifdef CONFIG_BOOTINFO_PROC +extern void save_bootinfo(const struct bi_record *bi); +#else +static inline void save_bootinfo(const struct bi_record *bi) {}  #endif -    /* -     *  Apollo-specific tags -     */ - -#define BI_APOLLO_MODEL         0x8000  /* model (u_long) */ - -    /* -     *  HP300-specific tags -     */ - -#define BI_HP300_MODEL		0x8000	/* model (u_long) */ -#define BI_HP300_UART_SCODE	0x8001	/* UART select code (u_long) */ -#define BI_HP300_UART_ADDR	0x8002	/* phys. addr of UART (u_long) */ - -    /* -     * Stuff for bootinfo interface versioning -     * -     * At the start of kernel code, a 'struct bootversion' is located. -     * bootstrap checks for a matching version of the interface before booting -     * a kernel, to avoid user confusion if kernel and bootstrap don't work -     * together :-) -     * -     * If incompatible changes are made to the bootinfo interface, the major -     * number below should be stepped (and the minor reset to 0) for the -     * appropriate machine. If a change is backward-compatible, the minor -     * should be stepped. "Backwards-compatible" means that booting will work, -     * but certain features may not. -     */ - -#define BOOTINFOV_MAGIC			0x4249561A	/* 'BIV^Z' */ -#define MK_BI_VERSION(major,minor)	(((major)<<16)+(minor)) -#define BI_VERSION_MAJOR(v)		(((v) >> 16) & 0xffff) -#define BI_VERSION_MINOR(v)		((v) & 0xffff) - -#ifndef __ASSEMBLY__ - -struct bootversion { -    unsigned short branch; -    unsigned long magic; -    struct { -	unsigned long machtype; -	unsigned long version; -    } machversions[0]; -}; -  #endif /* __ASSEMBLY__ */ -#define AMIGA_BOOTI_VERSION    MK_BI_VERSION( 2, 0 ) -#define ATARI_BOOTI_VERSION    MK_BI_VERSION( 2, 1 ) -#define MAC_BOOTI_VERSION      MK_BI_VERSION( 2, 0 ) -#define MVME147_BOOTI_VERSION  MK_BI_VERSION( 2, 0 ) -#define MVME16x_BOOTI_VERSION  MK_BI_VERSION( 2, 0 ) -#define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) -#define Q40_BOOTI_VERSION      MK_BI_VERSION( 2, 0 ) -#define HP300_BOOTI_VERSION    MK_BI_VERSION( 2, 0 ) - -#ifdef BOOTINFO_COMPAT_1_0 - -    /* -     *  Backwards compatibility with bootinfo interface version 1.0 -     */ - -#define COMPAT_AMIGA_BOOTI_VERSION    MK_BI_VERSION( 1, 0 ) -#define COMPAT_ATARI_BOOTI_VERSION    MK_BI_VERSION( 1, 0 ) -#define COMPAT_MAC_BOOTI_VERSION      MK_BI_VERSION( 1, 0 ) - -#include <linux/zorro.h> - -#define COMPAT_NUM_AUTO    16 - -struct compat_bi_Amiga { -    int model; -    int num_autocon; -    struct ConfigDev autocon[COMPAT_NUM_AUTO]; -    unsigned long chip_size; -    unsigned char vblank; -    unsigned char psfreq; -    unsigned long eclock; -    unsigned long chipset; -    unsigned long hw_present; -}; - -struct compat_bi_Atari { -    unsigned long hw_present; -    unsigned long mch_cookie; -}; - -#ifndef __ASSEMBLY__ - -struct compat_bi_Macintosh -{ -	unsigned long videoaddr; -	unsigned long videorow; -	unsigned long videodepth; -	unsigned long dimensions; -	unsigned long args; -	unsigned long boottime; -	unsigned long gmtbias; -	unsigned long bootver; -	unsigned long videological; -	unsigned long sccbase; -	unsigned long id; -	unsigned long memsize; -	unsigned long serialmf; -	unsigned long serialhsk; -	unsigned long serialgpi; -	unsigned long printmf; -	unsigned long printhsk; -	unsigned long printgpi; -	unsigned long cpuid; -	unsigned long rombase; -	unsigned long adbdelay; -	unsigned long timedbra; -}; - -#endif - -struct compat_mem_info { -    unsigned long addr; -    unsigned long size; -}; - -#define COMPAT_NUM_MEMINFO  4 - -#define COMPAT_CPUB_68020 0 -#define COMPAT_CPUB_68030 1 -#define COMPAT_CPUB_68040 2 -#define COMPAT_CPUB_68060 3 -#define COMPAT_FPUB_68881 5 -#define COMPAT_FPUB_68882 6 -#define COMPAT_FPUB_68040 7 -#define COMPAT_FPUB_68060 8 - -#define COMPAT_CPU_68020    (1<<COMPAT_CPUB_68020) -#define COMPAT_CPU_68030    (1<<COMPAT_CPUB_68030) -#define COMPAT_CPU_68040    (1<<COMPAT_CPUB_68040) -#define COMPAT_CPU_68060    (1<<COMPAT_CPUB_68060) -#define COMPAT_CPU_MASK     (31) -#define COMPAT_FPU_68881    (1<<COMPAT_FPUB_68881) -#define COMPAT_FPU_68882    (1<<COMPAT_FPUB_68882) -#define COMPAT_FPU_68040    (1<<COMPAT_FPUB_68040) -#define COMPAT_FPU_68060    (1<<COMPAT_FPUB_68060) -#define COMPAT_FPU_MASK     (0xfe0) - -#define COMPAT_CL_SIZE      (256) - -struct compat_bootinfo { -    unsigned long machtype; -    unsigned long cputype; -    struct compat_mem_info memory[COMPAT_NUM_MEMINFO]; -    int num_memory; -    unsigned long ramdisk_size; -    unsigned long ramdisk_addr; -    char command_line[COMPAT_CL_SIZE]; -    union { -	struct compat_bi_Amiga     bi_ami; -	struct compat_bi_Atari     bi_ata; -	struct compat_bi_Macintosh bi_mac; -    } bi_un; -}; - -#define bi_amiga	bi_un.bi_ami -#define bi_atari	bi_un.bi_ata -#define bi_mac		bi_un.bi_mac - -#endif /* BOOTINFO_COMPAT_1_0 */ -  #endif /* _M68K_BOOTINFO_H */ diff --git a/arch/m68k/include/asm/bootstd.h b/arch/m68k/include/asm/bootstd.h index bdc1a4ac4fe..e518f5a575b 100644 --- a/arch/m68k/include/asm/bootstd.h +++ b/arch/m68k/include/asm/bootstd.h @@ -31,7 +31,7 @@  #define __BN_flash_write_range		20  /* Calling conventions compatible to (uC)linux/68k - * We use simmilar macros to call into the bootloader as for uClinux + * We use similar macros to call into the bootloader as for uClinux   */  #define __bsc_return(type, res) \ diff --git a/arch/m68k/include/asm/byteorder.h b/arch/m68k/include/asm/byteorder.h deleted file mode 100644 index 31b260a8880..00000000000 --- a/arch/m68k/include/asm/byteorder.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_BYTEORDER_H -#define _M68K_BYTEORDER_H - -#include <linux/byteorder/big_endian.h> - -#endif /* _M68K_BYTEORDER_H */ diff --git a/arch/m68k/include/asm/cachectl.h b/arch/m68k/include/asm/cachectl.h deleted file mode 100644 index 525978e959e..00000000000 --- a/arch/m68k/include/asm/cachectl.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _M68K_CACHECTL_H -#define _M68K_CACHECTL_H - -/* Definitions for the cacheflush system call.  */ - -#define FLUSH_SCOPE_LINE    1	/* Flush a cache line */ -#define FLUSH_SCOPE_PAGE    2	/* Flush a page */ -#define FLUSH_SCOPE_ALL     3	/* Flush the whole cache -- superuser only */ - -#define FLUSH_CACHE_DATA    1	/* Writeback and flush data cache */ -#define FLUSH_CACHE_INSN    2	/* Flush instruction cache */ -#define FLUSH_CACHE_BOTH    3	/* Flush both caches */ - -#endif /* _M68K_CACHECTL_H */ diff --git a/arch/m68k/include/asm/cacheflush.h b/arch/m68k/include/asm/cacheflush.h index a70d7319630..4fc738209bd 100644 --- a/arch/m68k/include/asm/cacheflush.h +++ b/arch/m68k/include/asm/cacheflush.h @@ -1,5 +1,5 @@  #ifdef __uClinux__ -#include "cacheflush_no.h" +#include <asm/cacheflush_no.h>  #else -#include "cacheflush_mm.h" +#include <asm/cacheflush_mm.h>  #endif diff --git a/arch/m68k/include/asm/cacheflush_mm.h b/arch/m68k/include/asm/cacheflush_mm.h index 73de7c89d8e..fa2c3d681d8 100644 --- a/arch/m68k/include/asm/cacheflush_mm.h +++ b/arch/m68k/include/asm/cacheflush_mm.h @@ -2,23 +2,130 @@  #define _M68K_CACHEFLUSH_H  #include <linux/mm.h> +#ifdef CONFIG_COLDFIRE +#include <asm/mcfsim.h> +#endif  /* cache code */  #define FLUSH_I_AND_D	(0x00000808)  #define FLUSH_I		(0x00000008) +#ifndef ICACHE_MAX_ADDR +#define ICACHE_MAX_ADDR	0 +#define ICACHE_SET_MASK	0 +#define DCACHE_MAX_ADDR	0 +#define DCACHE_SETMASK	0 +#endif +#ifndef CACHE_MODE +#define	CACHE_MODE	0 +#define	CACR_ICINVA	0 +#define	CACR_DCINVA	0 +#define	CACR_BCINVA	0 +#endif + +/* + * ColdFire architecture has no way to clear individual cache lines, so we + * are stuck invalidating all the cache entries when we want a clear operation. + */ +static inline void clear_cf_icache(unsigned long start, unsigned long end) +{ +	__asm__ __volatile__ ( +		"movec	%0,%%cacr\n\t" +		"nop" +		: +		: "r" (CACHE_MODE | CACR_ICINVA | CACR_BCINVA)); +} + +static inline void clear_cf_dcache(unsigned long start, unsigned long end) +{ +	__asm__ __volatile__ ( +		"movec	%0,%%cacr\n\t" +		"nop" +		: +		: "r" (CACHE_MODE | CACR_DCINVA)); +} + +static inline void clear_cf_bcache(unsigned long start, unsigned long end) +{ +	__asm__ __volatile__ ( +		"movec	%0,%%cacr\n\t" +		"nop" +		: +		: "r" (CACHE_MODE | CACR_ICINVA | CACR_BCINVA | CACR_DCINVA)); +} + +/* + * Use the ColdFire cpushl instruction to push (and invalidate) cache lines. + * The start and end addresses are cache line numbers not memory addresses. + */ +static inline void flush_cf_icache(unsigned long start, unsigned long end) +{ +	unsigned long set; + +	for (set = start; set <= end; set += (0x10 - 3)) { +		__asm__ __volatile__ ( +			"cpushl %%ic,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%ic,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%ic,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%ic,(%0)" +			: "=a" (set) +			: "a" (set)); +	} +} + +static inline void flush_cf_dcache(unsigned long start, unsigned long end) +{ +	unsigned long set; + +	for (set = start; set <= end; set += (0x10 - 3)) { +		__asm__ __volatile__ ( +			"cpushl %%dc,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%dc,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%dc,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%dc,(%0)" +			: "=a" (set) +			: "a" (set)); +	} +} + +static inline void flush_cf_bcache(unsigned long start, unsigned long end) +{ +	unsigned long set; + +	for (set = start; set <= end; set += (0x10 - 3)) { +		__asm__ __volatile__ ( +			"cpushl %%bc,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%bc,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%bc,(%0)\n\t" +			"addq%.l #1,%0\n\t" +			"cpushl %%bc,(%0)" +			: "=a" (set) +			: "a" (set)); +	} +} +  /*   * Cache handling functions   */  static inline void flush_icache(void)  { -	if (CPU_IS_040_OR_060) +	if (CPU_IS_COLDFIRE) { +		flush_cf_icache(0, ICACHE_MAX_ADDR); +	} else if (CPU_IS_040_OR_060) {  		asm volatile (	"nop\n"  			"	.chip	68040\n"  			"	cpusha	%bc\n"  			"	.chip	68k"); -	else { +	} else {  		unsigned long tmp;  		asm volatile (	"movec	%%cacr,%0\n"  			"	or.w	%1,%0\n" @@ -51,12 +158,14 @@ extern void cache_push_v(unsigned long vaddr, int len);     process changes.  */  #define __flush_cache_all()					\  ({								\ -	if (CPU_IS_040_OR_060)					\ +	if (CPU_IS_COLDFIRE) {					\ +		flush_cf_dcache(0, DCACHE_MAX_ADDR);		\ +	} else if (CPU_IS_040_OR_060) {				\  		__asm__ __volatile__("nop\n\t"			\  				     ".chip 68040\n\t"		\  				     "cpusha %dc\n\t"		\  				     ".chip 68k");		\ -	else {							\ +	} else {						\  		unsigned long _tmp;				\  		__asm__ __volatile__("movec %%cacr,%0\n\t"	\  				     "orw %1,%0\n\t"		\ @@ -112,7 +221,17 @@ static inline void flush_cache_page(struct vm_area_struct *vma, unsigned long vm  /* RZ: use cpush %bc instead of cpush %dc, cinv %ic */  static inline void __flush_page_to_ram(void *vaddr)  { -	if (CPU_IS_040_OR_060) { +	if (CPU_IS_COLDFIRE) { +		unsigned long addr, start, end; +		addr = ((unsigned long) vaddr) & ~(PAGE_SIZE - 1); +		start = addr & ICACHE_SET_MASK; +		end = (addr + PAGE_SIZE - 1) & ICACHE_SET_MASK; +		if (start > end) { +			flush_cf_bcache(0, end); +			end = ICACHE_MAX_ADDR; +		} +		flush_cf_bcache(start, end); +	} else if (CPU_IS_040_OR_060) {  		__asm__ __volatile__("nop\n\t"  				     ".chip 68040\n\t"  				     "cpushp %%bc,(%0)\n\t" diff --git a/arch/m68k/include/asm/cacheflush_no.h b/arch/m68k/include/asm/cacheflush_no.h index 7085bd51668..d2b3935ae14 100644 --- a/arch/m68k/include/asm/cacheflush_no.h +++ b/arch/m68k/include/asm/cacheflush_no.h @@ -2,21 +2,22 @@  #define _M68KNOMMU_CACHEFLUSH_H  /* - * (C) Copyright 2000-2004, Greg Ungerer <gerg@snapgear.com> + * (C) Copyright 2000-2010, Greg Ungerer <gerg@snapgear.com>   */  #include <linux/mm.h> +#include <asm/mcfsim.h>  #define flush_cache_all()			__flush_cache_all()  #define flush_cache_mm(mm)			do { } while (0)  #define flush_cache_dup_mm(mm)			do { } while (0) -#define flush_cache_range(vma, start, end)	__flush_cache_all() +#define flush_cache_range(vma, start, end)	do { } while (0)  #define flush_cache_page(vma, vmaddr)		do { } while (0) -#define flush_dcache_range(start,len)		__flush_cache_all() +#define flush_dcache_range(start, len)		__flush_dcache_all()  #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0  #define flush_dcache_page(page)			do { } while (0)  #define flush_dcache_mmap_lock(mapping)		do { } while (0)  #define flush_dcache_mmap_unlock(mapping)	do { } while (0) -#define flush_icache_range(start,len)		__flush_cache_all() +#define flush_icache_range(start, len)		__flush_icache_all()  #define flush_icache_page(vma,pg)		do { } while (0)  #define flush_icache_user_range(vma,pg,adr,len)	do { } while (0)  #define flush_cache_vmap(start, end)		do { } while (0) @@ -27,66 +28,73 @@  #define copy_from_user_page(vma, page, vaddr, dst, src, len) \  	memcpy(dst, src, len) -static inline void __flush_cache_all(void) +void mcf_cache_push(void); + +static inline void __clear_cache_all(void)  { -#if defined(CONFIG_M5407) || defined(CONFIG_M548x) -	/* -	 *	Use cpushl to push and invalidate all cache lines. -	 *	Gas doesn't seem to know how to generate the ColdFire -	 *	cpushl instruction... Oh well, bit stuff it for now. -	 */ -	__asm__ __volatile__ ( -		"nop\n\t" -		"clrl	%%d0\n\t" -		"1:\n\t" -		"movel	%%d0,%%a0\n\t" -		"2:\n\t" -		".word	0xf468\n\t" -		"addl	#0x10,%%a0\n\t" -		"cmpl	#0x00000800,%%a0\n\t" -		"blt	2b\n\t" -		"addql	#1,%%d0\n\t" -		"cmpil	#4,%%d0\n\t" -		"bne	1b\n\t" -		"movel	#0xb6088500,%%d0\n\t" -		"movec	%%d0,%%CACR\n\t" -		: : : "d0", "a0" ); -#endif /* CONFIG_M5407 */ -#if defined(CONFIG_M523x) || defined(CONFIG_M527x) -	__asm__ __volatile__ ( -		"movel	#0x81400100, %%d0\n\t" -		"movec	%%d0, %%CACR\n\t" -		"nop\n\t" -		: : : "d0" ); -#endif /* CONFIG_M523x || CONFIG_M527x */ -#if defined(CONFIG_M528x) -	__asm__ __volatile__ ( -		"movel	#0x81000200, %%d0\n\t" -		"movec	%%d0, %%CACR\n\t" -		"nop\n\t" -		: : : "d0" ); -#endif /* CONFIG_M528x */ -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272) +#ifdef CACHE_INVALIDATE  	__asm__ __volatile__ ( -		"movel	#0x81000100, %%d0\n\t" -		"movec	%%d0, %%CACR\n\t" +		"movec	%0, %%CACR\n\t"  		"nop\n\t" -		: : : "d0" ); -#endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */ -#ifdef CONFIG_M5249 +		: : "r" (CACHE_INVALIDATE) ); +#endif +} + +static inline void __flush_cache_all(void) +{ +#ifdef CACHE_PUSH +	mcf_cache_push(); +#endif +	__clear_cache_all(); +} + +/* + * Some ColdFire parts implement separate instruction and data caches, + * on those we should just flush the appropriate cache. If we don't need + * to do any specific flushing then this will be optimized away. + */ +static inline void __flush_icache_all(void) +{ +#ifdef CACHE_INVALIDATEI  	__asm__ __volatile__ ( -		"movel	#0xa1000200, %%d0\n\t" -		"movec	%%d0, %%CACR\n\t" +		"movec	%0, %%CACR\n\t"  		"nop\n\t" -		: : : "d0" ); -#endif /* CONFIG_M5249 */ -#ifdef CONFIG_M532x +		: : "r" (CACHE_INVALIDATEI) ); +#endif +} + +static inline void __flush_dcache_all(void) +{ +#ifdef CACHE_PUSH +	mcf_cache_push(); +#endif +#ifdef CACHE_INVALIDATED  	__asm__ __volatile__ ( -		"movel	#0x81000200, %%d0\n\t" -		"movec	%%d0, %%CACR\n\t" +		"movec	%0, %%CACR\n\t"  		"nop\n\t" -		: : : "d0" ); -#endif /* CONFIG_M532x */ +		: : "r" (CACHE_INVALIDATED) ); +#else +	/* Flush the write buffer */ +	__asm__ __volatile__ ( "nop" ); +#endif +} + +/* + * Push cache entries at supplied address. We want to write back any dirty + * data and then invalidate the cache lines associated with this address. + */ +static inline void cache_push(unsigned long paddr, int len) +{ +	__flush_cache_all(); +} + +/* + * Clear cache entries at supplied address (that is don't write back any + * dirty data). + */ +static inline void cache_clear(unsigned long paddr, int len) +{ +	__clear_cache_all();  }  #endif /* _M68KNOMMU_CACHEFLUSH_H */ diff --git a/arch/m68k/include/asm/checksum.h b/arch/m68k/include/asm/checksum.h index ec514485c8b..2f88d867c71 100644 --- a/arch/m68k/include/asm/checksum.h +++ b/arch/m68k/include/asm/checksum.h @@ -3,6 +3,10 @@  #include <linux/in6.h> +#ifdef CONFIG_GENERIC_CSUM +#include <asm-generic/checksum.h> +#else +  /*   * computes the checksum of a memory block at buff, length len,   * and adds in "sum" (32-bit) @@ -34,30 +38,6 @@ extern __wsum csum_partial_copy_nocheck(const void *src,  					      void *dst, int len,  					      __wsum sum); - -#ifdef CONFIG_COLDFIRE - -/* - *	The ColdFire cores don't support all the 68k instructions used - *	in the optimized checksum code below. So it reverts back to using - *	more standard C coded checksums. The fast checksum code is - *	significantly larger than the optimized version, so it is not - *	inlined here. - */ -__sum16 ip_fast_csum(const void *iph, unsigned int ihl); - -static inline __sum16 csum_fold(__wsum sum) -{ -	unsigned int tmp = (__force u32)sum; - -	tmp = (tmp & 0xffff) + (tmp >> 16); -	tmp = (tmp & 0xffff) + (tmp >> 16); - -	return (__force __sum16)~tmp; -} - -#else -  /*   *	This is a version of ip_fast_csum() optimized for IP headers,   *	which always checksum on 4 octet boundaries. @@ -97,8 +77,6 @@ static inline __sum16 csum_fold(__wsum sum)  	return (__force __sum16)~sum;  } -#endif /* CONFIG_COLDFIRE */ -  static inline __wsum  csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,  		  unsigned short proto, __wsum sum) @@ -167,4 +145,5 @@ csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,  	return csum_fold(sum);  } +#endif /* CONFIG_GENERIC_CSUM */  #endif /* _M68K_CHECKSUM_H */ diff --git a/arch/m68k/include/asm/system_mm.h b/arch/m68k/include/asm/cmpxchg.h index 47b01f4726b..bc755bc620a 100644 --- a/arch/m68k/include/asm/system_mm.h +++ b/arch/m68k/include/asm/cmpxchg.h @@ -1,73 +1,13 @@ -#ifndef _M68K_SYSTEM_H -#define _M68K_SYSTEM_H +#ifndef __ARCH_M68K_CMPXCHG__ +#define __ARCH_M68K_CMPXCHG__ -#include <linux/linkage.h> -#include <linux/kernel.h>  #include <linux/irqflags.h> -#include <asm/segment.h> -#include <asm/entry.h> - -#ifdef __KERNEL__ - -/* - * switch_to(n) should switch tasks to task ptr, first checking that - * ptr isn't the current task, in which case it does nothing.  This - * also clears the TS-flag if the task we switched to has used the - * math co-processor latest. - */ -/* - * switch_to() saves the extra registers, that are not saved - * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and - * a0-a1. Some of these are used by schedule() and its predecessors - * and so we might get see unexpected behaviors when a task returns - * with unexpected register values. - * - * syscall stores these registers itself and none of them are used - * by syscall after the function in the syscall has been called. - * - * Beware that resume now expects *next to be in d1 and the offset of - * tss to be in a1. This saves a few instructions as we no longer have - * to push them onto the stack and read them back right after. - * - * 02/17/96 - Jes Sorensen (jds@kom.auc.dk) - * - * Changed 96/09/19 by Andreas Schwab - * pass prev in a0, next in a1 - */ -asmlinkage void resume(void); -#define switch_to(prev,next,last) do { \ -  register void *_prev __asm__ ("a0") = (prev); \ -  register void *_next __asm__ ("a1") = (next); \ -  register void *_last __asm__ ("d1"); \ -  __asm__ __volatile__("jbsr resume" \ -		       : "=a" (_prev), "=a" (_next), "=d" (_last) \ -		       : "0" (_prev), "1" (_next) \ -		       : "d0", "d2", "d3", "d4", "d5"); \ -  (last) = _last; \ -} while (0) - - -/* - * Force strict CPU ordering. - * Not really required on m68k... - */ -#define nop()		do { asm volatile ("nop"); barrier(); } while (0) -#define mb()		barrier() -#define rmb()		barrier() -#define wmb()		barrier() -#define read_barrier_depends()	((void)0) -#define set_mb(var, value)	({ (var) = (value); wmb(); }) - -#define smp_mb()	barrier() -#define smp_rmb()	barrier() -#define smp_wmb()	barrier() -#define smp_read_barrier_depends()	((void)0) - -#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))  struct __xchg_dummy { unsigned long a[100]; };  #define __xg(x) ((volatile struct __xchg_dummy *)(x)) +extern unsigned long __invalid_xchg_size(unsigned long, volatile void *, int); +  #ifndef CONFIG_RMW_INSNS  static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)  { @@ -92,7 +32,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz  		x = tmp;  		break;  	default: -		BUG(); +		tmp = __invalid_xchg_size(x, ptr, size); +		break;  	}  	local_irq_restore(flags); @@ -102,7 +43,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz  static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)  {  	switch (size) { -	    case 1: +	case 1:  		__asm__ __volatile__  			("moveb %2,%0\n\t"  			 "1:\n\t" @@ -110,7 +51,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz  			 "jne 1b"  			 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");  		break; -	    case 2: +	case 2:  		__asm__ __volatile__  			("movew %2,%0\n\t"  			 "1:\n\t" @@ -118,7 +59,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz  			 "jne 1b"  			 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");  		break; -	    case 4: +	case 4:  		__asm__ __volatile__  			("movel %2,%0\n\t"  			 "1:\n\t" @@ -126,15 +67,23 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz  			 "jne 1b"  			 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory");  		break; +	default: +		x = __invalid_xchg_size(x, ptr, size); +		break;  	}  	return x;  }  #endif +#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) +  #include <asm-generic/cmpxchg-local.h>  #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) +extern unsigned long __invalid_cmpxchg_size(volatile void *, +					    unsigned long, unsigned long, int); +  /*   * Atomic compare and exchange.  Compare OLD with MEM, if identical,   * store NEW in MEM.  Return the initial value in MEM.  Success is @@ -162,6 +111,9 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,  				      : "=d" (old), "=m" (*(int *)p)  				      : "d" (new), "0" (old), "m" (*(int *)p));  		break; +	default: +		old = __invalid_cmpxchg_size(p, old, new, size); +		break;  	}  	return old;  } @@ -172,6 +124,9 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,  #define cmpxchg_local(ptr, o, n)					    \  	((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o),	    \  			(unsigned long)(n), sizeof(*(ptr)))) + +#define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n)) +  #else  /* @@ -186,8 +141,4 @@ static inline unsigned long __cmpxchg(volatile void *p, unsigned long old,  #endif -#define arch_align_stack(x) (x) - -#endif /* __KERNEL__ */ - -#endif /* _M68K_SYSTEM_H */ +#endif /* __ARCH_M68K_CMPXCHG__ */ diff --git a/arch/m68k/include/asm/coldfire.h b/arch/m68k/include/asm/coldfire.h index 3b0a34d0fe3..c94557b9144 100644 --- a/arch/m68k/include/asm/coldfire.h +++ b/arch/m68k/include/asm/coldfire.h @@ -14,39 +14,35 @@  /* - *	Define master clock frequency. This is essentially done at config - *	time now. No point enumerating dozens of possible clock options - *	here. Also the peripheral clock (bus clock) divide ratio is set - *	at config time too. + *	Define master clock frequency. This is done at config time now. + *	No point enumerating dozens of possible clock options here. And + *	in any case new boards come along from time to time that have yet + *	another different clocking frequency.   */  #ifdef CONFIG_CLOCK_SET  #define	MCF_CLK		CONFIG_CLOCK_FREQ -#define	MCF_BUSCLK	(CONFIG_CLOCK_FREQ / CONFIG_CLOCK_DIV)  #else  #error "Don't know what your ColdFire CPU clock frequency is??"  #endif  /* - *	Define the processor support peripherals base address. - *	This is generally setup by the boards start up code. + *	Define the processor internal peripherals base address. + * + *	The majority of ColdFire parts use an MBAR register to set + *	the base address. Some have an IPSBAR register instead, and it + *	has slightly different rules on its size and alignment. Some + *	parts have fixed addresses and the internal peripherals cannot + *	be relocated in the CPU address space. + * + *	The value of MBAR or IPSBAR is config time selectable, we no + *	longer hard define it here. No MBAR or IPSBAR will be defined if + *	this part has a fixed peripheral address map.   */ -#define	MCF_MBAR	0x10000000 -#define	MCF_MBAR2	0x80000000 -#if defined(CONFIG_M548x) -#define	MCF_IPSBAR	MCF_MBAR -#elif defined(CONFIG_M520x) -#define	MCF_IPSBAR	0xFC000000 -#else -#define	MCF_IPSBAR	0x40000000 +#ifdef CONFIG_MBAR +#define	MCF_MBAR	CONFIG_MBAR  #endif - -#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ -    defined(CONFIG_M520x) -#undef MCF_MBAR -#define	MCF_MBAR	MCF_IPSBAR -#elif defined(CONFIG_M532x) -#undef MCF_MBAR -#define MCF_MBAR	0x00000000 +#ifdef CONFIG_IPSBAR +#define	MCF_IPSBAR	CONFIG_IPSBAR  #endif  /****************************************************************************/ diff --git a/arch/m68k/include/asm/commproc.h b/arch/m68k/include/asm/commproc.h index edf5eb6c08d..66a36bd51aa 100644 --- a/arch/m68k/include/asm/commproc.h +++ b/arch/m68k/include/asm/commproc.h @@ -88,7 +88,7 @@ typedef struct cpm_buf_desc {  /* rx bd status/control bits */ -#define BD_SC_EMPTY	((ushort)0x8000)	/* Recieve is empty */ +#define BD_SC_EMPTY	((ushort)0x8000)	/* Receive is empty */  #define BD_SC_WRAP	((ushort)0x2000)	/* Last buffer descriptor in table */  #define BD_SC_INTRPT	((ushort)0x1000)	/* Interrupt on change */  #define BD_SC_LAST	((ushort)0x0800)	/* Last buffer in frame OR control char */ @@ -96,7 +96,7 @@ typedef struct cpm_buf_desc {  #define BD_SC_FIRST	((ushort)0x0400)	/* 1st buffer in an HDLC frame */  #define BD_SC_ADDR	((ushort)0x0400)	/* 1st byte is a multidrop address */ -#define BD_SC_CM	((ushort)0x0200)	/* Continous mode */ +#define BD_SC_CM	((ushort)0x0200)	/* Continuous mode */  #define BD_SC_ID	((ushort)0x0100)	/* Received too many idles */  #define BD_SC_AM	((ushort)0x0080)	/* Multidrop address match */ @@ -480,23 +480,6 @@ typedef struct scc_enet {  #define SICR_ENET_CLKRT	((uint)0x0000003d)  #endif -#ifdef CONFIG_RPXLITE -/* This ENET stuff is for the MPC850 with ethernet on SCC2.  Some of - * this may be unique to the RPX-Lite configuration. - * Note TENA is on Port B. - */ -#define PA_ENET_RXD	((ushort)0x0004) -#define PA_ENET_TXD	((ushort)0x0008) -#define PA_ENET_TCLK	((ushort)0x0200) -#define PA_ENET_RCLK	((ushort)0x0800) -#define PB_ENET_TENA	((uint)0x00002000) -#define PC_ENET_CLSN	((ushort)0x0040) -#define PC_ENET_RENA	((ushort)0x0080) - -#define SICR_ENET_MASK	((uint)0x0000ff00) -#define SICR_ENET_CLKRT	((uint)0x00003d00) -#endif -  #ifdef CONFIG_BSEIP  /* This ENET stuff is for the MPC823 with ethernet on SCC2.   * This is unique to the BSE ip-Engine board. diff --git a/arch/m68k/include/asm/cputime.h b/arch/m68k/include/asm/cputime.h deleted file mode 100644 index c79c5e89230..00000000000 --- a/arch/m68k/include/asm/cputime.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __M68K_CPUTIME_H -#define __M68K_CPUTIME_H - -#include <asm-generic/cputime.h> - -#endif /* __M68K_CPUTIME_H */ diff --git a/arch/m68k/include/asm/dbg.h b/arch/m68k/include/asm/dbg.h deleted file mode 100644 index 27af3270f67..00000000000 --- a/arch/m68k/include/asm/dbg.h +++ /dev/null @@ -1,6 +0,0 @@ -#define DEBUG 1 -#ifdef CONFIG_COLDFIRE -#define	BREAK asm volatile ("halt") -#else -#define BREAK *(volatile unsigned char *)0xdeadbee0 = 0 -#endif diff --git a/arch/m68k/include/asm/delay.h b/arch/m68k/include/asm/delay.h index d2598e3dd7b..d28fa8fe26f 100644 --- a/arch/m68k/include/asm/delay.h +++ b/arch/m68k/include/asm/delay.h @@ -1,5 +1,119 @@ -#ifdef __uClinux__ -#include "delay_no.h" +#ifndef _M68K_DELAY_H +#define _M68K_DELAY_H + +#include <asm/param.h> + +/* + * Copyright (C) 1994 Hamish Macdonald + * Copyright (C) 2004 Greg Ungerer <gerg@uclinux.com> + * + * Delay routines, using a pre-computed "loops_per_jiffy" value. + */ + +#if defined(CONFIG_COLDFIRE) +/* + * The ColdFire runs the delay loop at significantly different speeds + * depending upon long word alignment or not.  We'll pad it to + * long word alignment which is the faster version. + * The 0x4a8e is of course a 'tstl %fp' instruction.  This is better + * than using a NOP (0x4e71) instruction because it executes in one + * cycle not three and doesn't allow for an arbitrary delay waiting + * for bus cycles to finish.  Also fp/a6 isn't likely to cause a + * stall waiting for the register to become valid if such is added + * to the coldfire at some stage. + */ +#define	DELAY_ALIGN	".balignw 4, 0x4a8e\n\t"  #else -#include "delay_mm.h" +/* + * No instruction alignment required for other m68k types. + */ +#define	DELAY_ALIGN  #endif + +static inline void __delay(unsigned long loops) +{ +	__asm__ __volatile__ ( +		DELAY_ALIGN +		"1: subql #1,%0\n\t" +		"jcc 1b" +		: "=d" (loops) +		: "0" (loops)); +} + +extern void __bad_udelay(void); + + +#ifdef CONFIG_CPU_HAS_NO_MULDIV64 +/* + * The simpler m68k and ColdFire processors do not have a 32*32->64 + * multiply instruction. So we need to handle them a little differently. + * We use a bit of shifting and a single 32*32->32 multiply to get close. + * This is a macro so that the const version can factor out the first + * multiply and shift. + */ +#define	HZSCALE		(268435456 / (1000000 / HZ)) + +#define	__const_udelay(u) \ +	__delay(((((u) * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) + +#else + +static inline void __xdelay(unsigned long xloops) +{ +	unsigned long tmp; + +	__asm__ ("mulul %2,%0:%1" +		: "=d" (xloops), "=d" (tmp) +		: "d" (xloops), "1" (loops_per_jiffy)); +	__delay(xloops * HZ); +} + +/* + * The definition of __const_udelay is specifically made a macro so that + * the const factor (4295 = 2**32 / 1000000) can be optimized out when + * the delay is a const. + */ +#define	__const_udelay(n)	(__xdelay((n) * 4295)) + +#endif + +static inline void __udelay(unsigned long usecs) +{ +	__const_udelay(usecs); +} + +/* + * Use only for very small delays ( < 1 msec).  Should probably use a + * lookup table, really, as the multiplications take much too long with + * short delays.  This is a "reasonable" implementation, though (and the + * first constant multiplications gets optimized away if the delay is + * a constant) + */ +#define udelay(n) (__builtin_constant_p(n) ? \ +	((n) > 20000 ? __bad_udelay() : __const_udelay(n)) : __udelay(n)) + +/* + * nanosecond delay: + * + * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) is the number of loops + * per microsecond + * + * 1000 / ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) is the number of + * nanoseconds per loop + * + * So n / ( 1000 / ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) ) would + * be the number of loops for n nanoseconds + */ + +/* + * The simpler m68k and ColdFire processors do not have a 32*32->64 + * multiply instruction. So we need to handle them a little differently. + * We use a bit of shifting and a single 32*32->32 multiply to get close. + * This is a macro so that the const version can factor out the first + * multiply and shift. + */ +#define	HZSCALE		(268435456 / (1000000 / HZ)) + +#define ndelay(n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000)); + +#endif /* defined(_M68K_DELAY_H) */ diff --git a/arch/m68k/include/asm/delay_mm.h b/arch/m68k/include/asm/delay_mm.h deleted file mode 100644 index 5ed92851bc6..00000000000 --- a/arch/m68k/include/asm/delay_mm.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _M68K_DELAY_H -#define _M68K_DELAY_H - -#include <asm/param.h> - -/* - * Copyright (C) 1994 Hamish Macdonald - * - * Delay routines, using a pre-computed "loops_per_jiffy" value. - */ - -static inline void __delay(unsigned long loops) -{ -	__asm__ __volatile__ ("1: subql #1,%0; jcc 1b" -		: "=d" (loops) : "0" (loops)); -} - -extern void __bad_udelay(void); - -/* - * Use only for very small delays ( < 1 msec).  Should probably use a - * lookup table, really, as the multiplications take much too long with - * short delays.  This is a "reasonable" implementation, though (and the - * first constant multiplications gets optimized away if the delay is - * a constant) - */ -static inline void __const_udelay(unsigned long xloops) -{ -	unsigned long tmp; - -	__asm__ ("mulul %2,%0:%1" -		: "=d" (xloops), "=d" (tmp) -		: "d" (xloops), "1" (loops_per_jiffy)); -	__delay(xloops * HZ); -} - -static inline void __udelay(unsigned long usecs) -{ -	__const_udelay(usecs * 4295);	/* 2**32 / 1000000 */ -} - -#define udelay(n) (__builtin_constant_p(n) ? \ -	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 4295)) : \ -	__udelay(n)) - -static inline unsigned long muldiv(unsigned long a, unsigned long b, -				   unsigned long c) -{ -	unsigned long tmp; - -	__asm__ ("mulul %2,%0:%1; divul %3,%0:%1" -		: "=d" (tmp), "=d" (a) -		: "d" (b), "d" (c), "1" (a)); -	return a; -} - -#endif /* defined(_M68K_DELAY_H) */ diff --git a/arch/m68k/include/asm/delay_no.h b/arch/m68k/include/asm/delay_no.h deleted file mode 100644 index 55cbd6294ab..00000000000 --- a/arch/m68k/include/asm/delay_no.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef _M68KNOMMU_DELAY_H -#define _M68KNOMMU_DELAY_H - -/* - * Copyright (C) 1994 Hamish Macdonald - * Copyright (C) 2004 Greg Ungerer <gerg@snapgear.com> - */ - -#include <asm/param.h> - -static inline void __delay(unsigned long loops) -{ -#if defined(CONFIG_COLDFIRE) -	/* The coldfire runs this loop at significantly different speeds -	 * depending upon long word alignment or not.  We'll pad it to -	 * long word alignment which is the faster version. -	 * The 0x4a8e is of course a 'tstl %fp' instruction.  This is better -	 * than using a NOP (0x4e71) instruction because it executes in one -	 * cycle not three and doesn't allow for an arbitary delay waiting -	 * for bus cycles to finish.  Also fp/a6 isn't likely to cause a -	 * stall waiting for the register to become valid if such is added -	 * to the coldfire at some stage. -	 */ -	__asm__ __volatile__ (	".balignw 4, 0x4a8e\n\t" -				"1: subql #1, %0\n\t" -				"jcc 1b" -		: "=d" (loops) : "0" (loops)); -#else -	__asm__ __volatile__ (	"1: subql #1, %0\n\t" -				"jcc 1b" -		: "=d" (loops) : "0" (loops)); -#endif -} - -/* - *	Ideally we use a 32*32->64 multiply to calculate the number of - *	loop iterations, but the older standard 68k and ColdFire do not - *	have this instruction. So for them we have a clsoe approximation - *	loop using 32*32->32 multiplies only. This calculation based on - *	the ARM version of delay. - * - *	We want to implement: - * - *	loops = (usecs * 0x10c6 * HZ * loops_per_jiffy) / 2^32 - */ - -#define	HZSCALE		(268435456 / (1000000/HZ)) - -extern unsigned long loops_per_jiffy; - -static inline void _udelay(unsigned long usecs) -{ -#if defined(CONFIG_M68328) || defined(CONFIG_M68EZ328) || \ -    defined(CONFIG_M68VZ328) || defined(CONFIG_M68360) || \ -    defined(CONFIG_COLDFIRE) -	__delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6); -#else -	unsigned long tmp; - -	usecs *= 4295;		/* 2**32 / 1000000 */ -	__asm__ ("mulul %2,%0:%1" -		: "=d" (usecs), "=d" (tmp) -		: "d" (usecs), "1" (loops_per_jiffy*HZ)); -	__delay(usecs); -#endif -} - -/* - *	Moved the udelay() function into library code, no longer inlined. - *	I had to change the algorithm because we are overflowing now on - *	the faster ColdFire parts. The code is a little bigger, so it makes - *	sense to library it. - */ -extern void udelay(unsigned long usecs); - -#endif /* defined(_M68KNOMMU_DELAY_H) */ diff --git a/arch/m68k/include/asm/device.h b/arch/m68k/include/asm/device.h deleted file mode 100644 index d8f9872b0e2..00000000000 --- a/arch/m68k/include/asm/device.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Arch specific extensions to struct device - * - * This file is released under the GPLv2 - */ -#include <asm-generic/device.h> - diff --git a/arch/m68k/include/asm/div64.h b/arch/m68k/include/asm/div64.h index edb66148a71..ef881cfbbca 100644 --- a/arch/m68k/include/asm/div64.h +++ b/arch/m68k/include/asm/div64.h @@ -1,7 +1,9 @@  #ifndef _M68K_DIV64_H  #define _M68K_DIV64_H -#ifdef CONFIG_MMU +#ifdef CONFIG_CPU_HAS_NO_MULDIV64 +#include <asm-generic/div64.h> +#else  #include <linux/types.h> @@ -13,22 +15,21 @@  		unsigned long long n64;				\  	} __n;							\  	unsigned long __rem, __upper;				\ +	unsigned long __base = (base);				\  								\  	__n.n64 = (n);						\  	if ((__upper = __n.n32[0])) {				\  		asm ("divul.l %2,%1:%0"				\ -			: "=d" (__n.n32[0]), "=d" (__upper)	\ -			: "d" (base), "0" (__n.n32[0]));	\ +		     : "=d" (__n.n32[0]), "=d" (__upper)	\ +		     : "d" (__base), "0" (__n.n32[0]));		\  	}							\  	asm ("divu.l %2,%1:%0"					\ -		: "=d" (__n.n32[1]), "=d" (__rem)		\ -		: "d" (base), "1" (__upper), "0" (__n.n32[1]));	\ +	     : "=d" (__n.n32[1]), "=d" (__rem)			\ +	     : "d" (__base), "1" (__upper), "0" (__n.n32[1]));	\  	(n) = __n.n64;						\  	__rem;							\  }) -#else -#include <asm-generic/div64.h> -#endif /* CONFIG_MMU */ +#endif /* CONFIG_CPU_HAS_NO_MULDIV64 */  #endif /* _M68K_DIV64_H */ diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h index 17f7a45948e..05aa53594d4 100644 --- a/arch/m68k/include/asm/dma-mapping.h +++ b/arch/m68k/include/asm/dma-mapping.h @@ -5,7 +5,6 @@  struct scatterlist; -#ifndef CONFIG_MMU_SUN3  static inline int dma_supported(struct device *dev, u64 mask)  {  	return 1; @@ -21,6 +20,22 @@ extern void *dma_alloc_coherent(struct device *, size_t,  extern void dma_free_coherent(struct device *, size_t,  			      void *, dma_addr_t); +static inline void *dma_alloc_attrs(struct device *dev, size_t size, +				    dma_addr_t *dma_handle, gfp_t flag, +				    struct dma_attrs *attrs) +{ +	/* attrs is not supported and ignored */ +	return dma_alloc_coherent(dev, size, dma_handle, flag); +} + +static inline void dma_free_attrs(struct device *dev, size_t size, +				  void *cpu_addr, dma_addr_t dma_handle, +				  struct dma_attrs *attrs) +{ +	/* attrs is not supported and ignored */ +	dma_free_coherent(dev, size, cpu_addr, dma_handle); +} +  static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,  					  dma_addr_t *handle, gfp_t flag)  { @@ -95,8 +110,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)  	return 0;  } -#else -#include <asm-generic/dma-mapping-broken.h> -#endif +/* drivers/base/dma-mapping.c */ +extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, +			   void *cpu_addr, dma_addr_t dma_addr, size_t size); +extern int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, +				  void *cpu_addr, dma_addr_t dma_addr, +				  size_t size); + +#define dma_mmap_coherent(d, v, c, h, s) dma_common_mmap(d, v, c, h, s) +#define dma_get_sgtable(d, t, v, h, s) dma_common_get_sgtable(d, t, v, h, s)  #endif  /* _M68K_DMA_MAPPING_H */ diff --git a/arch/m68k/include/asm/dma.h b/arch/m68k/include/asm/dma.h index 6fbdfe89510..429fe26e320 100644 --- a/arch/m68k/include/asm/dma.h +++ b/arch/m68k/include/asm/dma.h @@ -33,11 +33,13 @@   * Set number of channels of DMA on ColdFire for different implementations.   */  #if defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) || \ -	defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) +	defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ +	defined(CONFIG_M528x) || defined(CONFIG_M525x) +  #define MAX_M68K_DMA_CHANNELS 4  #elif defined(CONFIG_M5272)  #define MAX_M68K_DMA_CHANNELS 1 -#elif defined(CONFIG_M532x) +#elif defined(CONFIG_M53xx)  #define MAX_M68K_DMA_CHANNELS 0  #else  #define MAX_M68K_DMA_CHANNELS 2 @@ -486,6 +488,10 @@ static __inline__ int get_dma_residue(unsigned int dmanr)  extern int request_dma(unsigned int dmanr, const char * device_id);	/* reserve a DMA channel */  extern void free_dma(unsigned int dmanr);	/* release it again */ +#ifdef CONFIG_PCI +extern int isa_dma_bridge_buggy; +#else  #define isa_dma_bridge_buggy    (0) +#endif  #endif /* _M68K_DMA_H */ diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h index 01c193d9141..b1c26de438b 100644 --- a/arch/m68k/include/asm/elf.h +++ b/arch/m68k/include/asm/elf.h @@ -59,10 +59,10 @@ typedef struct user_m68kfp_struct elf_fpregset_t;     is actually used on ASV.  */  #define ELF_PLAT_INIT(_r, load_addr)	_r->a1 = 0 -#ifndef CONFIG_SUN3 -#define ELF_EXEC_PAGESIZE	4096 -#else +#if defined(CONFIG_SUN3) || defined(CONFIG_COLDFIRE)  #define ELF_EXEC_PAGESIZE	8192 +#else +#define ELF_EXEC_PAGESIZE	4096  #endif  /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical @@ -113,6 +113,4 @@ typedef struct user_m68kfp_struct elf_fpregset_t;  #define ELF_PLATFORM  (NULL) -#define SET_PERSONALITY(ex) set_personality(PER_LINUX) -  #endif diff --git a/arch/m68k/include/asm/emergency-restart.h b/arch/m68k/include/asm/emergency-restart.h deleted file mode 100644 index 108d8c48e42..00000000000 --- a/arch/m68k/include/asm/emergency-restart.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H - -#include <asm-generic/emergency-restart.h> - -#endif /* _ASM_EMERGENCY_RESTART_H */ diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h index 876eec6f2b5..d7de0f1a895 100644 --- a/arch/m68k/include/asm/entry.h +++ b/arch/m68k/include/asm/entry.h @@ -1,5 +1,260 @@ -#ifdef __uClinux__ -#include "entry_no.h" +#ifndef __M68K_ENTRY_H +#define __M68K_ENTRY_H + +#include <asm/setup.h> +#include <asm/page.h> +#ifdef __ASSEMBLY__ +#include <asm/thread_info.h> +#endif + +/* + * Stack layout in 'ret_from_exception': + * + *	This allows access to the syscall arguments in registers d1-d5 + * + *	 0(sp) - d1 + *	 4(sp) - d2 + *	 8(sp) - d3 + *	 C(sp) - d4 + *	10(sp) - d5 + *	14(sp) - a0 + *	18(sp) - a1 + *	1C(sp) - a2 + *	20(sp) - d0 + *	24(sp) - orig_d0 + *	28(sp) - stack adjustment + *	2C(sp) - [ sr              ] [ format & vector ] + *	2E(sp) - [ pc-hiword       ] [ sr              ] + *	30(sp) - [ pc-loword       ] [ pc-hiword       ] + *	32(sp) - [ format & vector ] [ pc-loword       ] + *		  ^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^ + *			M68K		  COLDFIRE + */ + +/* the following macro is used when enabling interrupts */ +#if defined(MACH_ATARI_ONLY) +	/* block out HSYNC = ipl 2 on the atari */ +#define ALLOWINT	(~0x500) +#else +	/* portable version */ +#define ALLOWINT	(~0x700) +#endif /* machine compilation types */ + +#ifdef __ASSEMBLY__ +/* + * This defines the normal kernel pt-regs layout. + * + * regs a3-a6 and d6-d7 are preserved by C code + * the kernel doesn't mess with usp unless it needs to + */ +#define SWITCH_STACK_SIZE	(6*4+4)	/* includes return address */ + +#ifdef CONFIG_COLDFIRE +#ifdef CONFIG_COLDFIRE_SW_A7 +/* + * This is made a little more tricky on older ColdFires. There is no + * separate supervisor and user stack pointers. Need to artificially + * construct a usp in software... When doing this we need to disable + * interrupts, otherwise bad things will happen. + */ +.globl sw_usp +.globl sw_ksp + +.macro SAVE_ALL_SYS +	move	#0x2700,%sr		/* disable intrs */ +	btst	#5,%sp@(2)		/* from user? */ +	bnes	6f			/* no, skip */ +	movel	%sp,sw_usp		/* save user sp */ +	addql	#8,sw_usp		/* remove exception */ +	movel	sw_ksp,%sp		/* kernel sp */ +	subql	#8,%sp			/* room for exception */ +	clrl	%sp@-			/* stkadj */ +	movel	%d0,%sp@-		/* orig d0 */ +	movel	%d0,%sp@-		/* d0 */ +	lea	%sp@(-32),%sp		/* space for 8 regs */ +	moveml	%d1-%d5/%a0-%a2,%sp@ +	movel	sw_usp,%a0		/* get usp */ +	movel	%a0@-,%sp@(PT_OFF_PC)	/* copy exception program counter */ +	movel	%a0@-,%sp@(PT_OFF_FORMATVEC)/*copy exception format/vector/sr */ +	bra	7f +	6: +	clrl	%sp@-			/* stkadj */ +	movel	%d0,%sp@-		/* orig d0 */ +	movel	%d0,%sp@-		/* d0 */ +	lea	%sp@(-32),%sp		/* space for 8 regs */ +	moveml	%d1-%d5/%a0-%a2,%sp@ +	7: +.endm + +.macro SAVE_ALL_INT +	SAVE_ALL_SYS +	moveq	#-1,%d0			/* not system call entry */ +	movel	%d0,%sp@(PT_OFF_ORIG_D0) +.endm + +.macro RESTORE_USER +	move	#0x2700,%sr		/* disable intrs */ +	movel	sw_usp,%a0		/* get usp */ +	movel	%sp@(PT_OFF_PC),%a0@-	/* copy exception program counter */ +	movel	%sp@(PT_OFF_FORMATVEC),%a0@-/*copy exception format/vector/sr */ +	moveml	%sp@,%d1-%d5/%a0-%a2 +	lea	%sp@(32),%sp		/* space for 8 regs */ +	movel	%sp@+,%d0 +	addql	#4,%sp			/* orig d0 */ +	addl	%sp@+,%sp		/* stkadj */ +	addql	#8,%sp			/* remove exception */ +	movel	%sp,sw_ksp		/* save ksp */ +	subql	#8,sw_usp		/* set exception */ +	movel	sw_usp,%sp		/* restore usp */ +	rte +.endm + +.macro RDUSP +	movel	sw_usp,%a3 +.endm + +.macro WRUSP +	movel	%a3,sw_usp +.endm + +#else /* !CONFIG_COLDFIRE_SW_A7 */ +/* + * Modern ColdFire parts have separate supervisor and user stack + * pointers. Simple load and restore macros for this case. + */ +.macro SAVE_ALL_SYS +	move	#0x2700,%sr		/* disable intrs */ +	clrl	%sp@-			/* stkadj */ +	movel	%d0,%sp@-		/* orig d0 */ +	movel	%d0,%sp@-		/* d0 */ +	lea	%sp@(-32),%sp		/* space for 8 regs */ +	moveml	%d1-%d5/%a0-%a2,%sp@ +.endm + +.macro SAVE_ALL_INT +	move	#0x2700,%sr		/* disable intrs */ +	clrl	%sp@-			/* stkadj */ +	pea	-1:w			/* orig d0 */ +	movel	%d0,%sp@-		/* d0 */ +	lea	%sp@(-32),%sp		/* space for 8 regs */ +	moveml	%d1-%d5/%a0-%a2,%sp@ +.endm + +.macro RESTORE_USER +	moveml	%sp@,%d1-%d5/%a0-%a2 +	lea	%sp@(32),%sp		/* space for 8 regs */ +	movel	%sp@+,%d0 +	addql	#4,%sp			/* orig d0 */ +	addl	%sp@+,%sp		/* stkadj */ +	rte +.endm + +.macro RDUSP +	/*move	%usp,%a3*/ +	.word	0x4e6b +.endm + +.macro WRUSP +	/*move	%a3,%usp*/ +	.word	0x4e63 +.endm + +#endif /* !CONFIG_COLDFIRE_SW_A7 */ + +.macro SAVE_SWITCH_STACK +	lea	%sp@(-24),%sp		/* 6 regs */ +	moveml	%a3-%a6/%d6-%d7,%sp@ +.endm + +.macro RESTORE_SWITCH_STACK +	moveml	%sp@,%a3-%a6/%d6-%d7 +	lea	%sp@(24),%sp		/* 6 regs */ +.endm + +#else /* !CONFIG_COLDFIRE */ + +/* + * All other types of m68k parts (68000, 680x0, CPU32) have the same + * entry and exit code. + */ + +/* + * a -1 in the orig_d0 field signifies + * that the stack frame is NOT for syscall + */ +.macro SAVE_ALL_INT +	clrl	%sp@-			/* stk_adj */ +	pea	-1:w			/* orig d0 */ +	movel	%d0,%sp@-		/* d0 */ +	moveml	%d1-%d5/%a0-%a2,%sp@- +.endm + +.macro SAVE_ALL_SYS +	clrl	%sp@-			/* stk_adj */ +	movel	%d0,%sp@-		/* orig d0 */ +	movel	%d0,%sp@-		/* d0 */ +	moveml	%d1-%d5/%a0-%a2,%sp@- +.endm + +.macro RESTORE_ALL +	moveml	%sp@+,%a0-%a2/%d1-%d5 +	movel	%sp@+,%d0 +	addql	#4,%sp			/* orig d0 */ +	addl	%sp@+,%sp		/* stk adj */ +	rte +.endm + + +.macro SAVE_SWITCH_STACK +	moveml	%a3-%a6/%d6-%d7,%sp@- +.endm + +.macro RESTORE_SWITCH_STACK +	moveml	%sp@+,%a3-%a6/%d6-%d7 +.endm + +#endif /* !CONFIG_COLDFIRE */ + +/* + * Register %a2 is reserved and set to current task on MMU enabled systems. + * Non-MMU systems do not reserve %a2 in this way, and this definition is + * not used for them. + */ +#ifdef CONFIG_MMU + +#define curptr a2 + +#define GET_CURRENT(tmp) get_current tmp +.macro get_current reg=%d0 +	movel	%sp,\reg +	andl	#-THREAD_SIZE,\reg +	movel	\reg,%curptr +	movel	%curptr@,%curptr +.endm +  #else -#include "entry_mm.h" + +#define GET_CURRENT(tmp) + +#endif /* CONFIG_MMU */ + +#else /* C source */ + +#define STR(X) STR1(X) +#define STR1(X) #X + +#define SAVE_ALL_INT				\ +	"clrl	%%sp@-;"    /* stk_adj */	\ +	"pea	-1:w;"	    /* orig d0 = -1 */	\ +	"movel	%%d0,%%sp@-;" /* d0 */		\ +	"moveml	%%d1-%%d5/%%a0-%%a2,%%sp@-" + +#define GET_CURRENT(tmp) \ +	"movel	%%sp,"#tmp"\n\t" \ +	"andw	#-"STR(THREAD_SIZE)","#tmp"\n\t" \ +	"movel	"#tmp",%%a2\n\t" \ +	"movel	%%a2@,%%a2" +  #endif + +#endif /* __M68K_ENTRY_H */ diff --git a/arch/m68k/include/asm/entry_mm.h b/arch/m68k/include/asm/entry_mm.h deleted file mode 100644 index 73b8c8fbed9..00000000000 --- a/arch/m68k/include/asm/entry_mm.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef __M68K_ENTRY_H -#define __M68K_ENTRY_H - -#include <asm/setup.h> -#include <asm/page.h> -#ifdef __ASSEMBLY__ -#include <asm/thread_info.h> -#endif - -/* - * Stack layout in 'ret_from_exception': - * - *	This allows access to the syscall arguments in registers d1-d5 - * - *	 0(sp) - d1 - *	 4(sp) - d2 - *	 8(sp) - d3 - *	 C(sp) - d4 - *	10(sp) - d5 - *	14(sp) - a0 - *	18(sp) - a1 - *	1C(sp) - a2 - *	20(sp) - d0 - *	24(sp) - orig_d0 - *	28(sp) - stack adjustment - *	2C(sp) - sr - *	2E(sp) - pc - *	32(sp) - format & vector - */ - -/* - * 97/05/14 Andreas: Register %a2 is now set to the current task throughout - *		     the whole kernel. - */ - -/* the following macro is used when enabling interrupts */ -#if defined(MACH_ATARI_ONLY) -	/* block out HSYNC on the atari */ -#define ALLOWINT	(~0x400) -#define	MAX_NOINT_IPL	3 -#else -	/* portable version */ -#define ALLOWINT	(~0x700) -#define	MAX_NOINT_IPL	0 -#endif /* machine compilation types */ - -#ifdef __ASSEMBLY__ - -#define curptr a2 - -LFLUSH_I_AND_D = 0x00000808 - -#define SAVE_ALL_INT save_all_int -#define SAVE_ALL_SYS save_all_sys -#define RESTORE_ALL restore_all -/* - * This defines the normal kernel pt-regs layout. - * - * regs a3-a6 and d6-d7 are preserved by C code - * the kernel doesn't mess with usp unless it needs to - */ - -/* - * a -1 in the orig_d0 field signifies - * that the stack frame is NOT for syscall - */ -.macro	save_all_int -	clrl	%sp@-		| stk_adj -	pea	-1:w		| orig d0 -	movel	%d0,%sp@-	| d0 -	moveml	%d1-%d5/%a0-%a1/%curptr,%sp@- -.endm - -.macro	save_all_sys -	clrl	%sp@-		| stk_adj -	movel	%d0,%sp@-	| orig d0 -	movel	%d0,%sp@-	| d0 -	moveml	%d1-%d5/%a0-%a1/%curptr,%sp@- -.endm - -.macro	restore_all -	moveml	%sp@+,%a0-%a1/%curptr/%d1-%d5 -	movel	%sp@+,%d0 -	addql	#4,%sp		| orig d0 -	addl	%sp@+,%sp	| stk adj -	rte -.endm - -#define SWITCH_STACK_SIZE (6*4+4)	/* includes return address */ - -#define SAVE_SWITCH_STACK save_switch_stack -#define RESTORE_SWITCH_STACK restore_switch_stack -#define GET_CURRENT(tmp) get_current tmp - -.macro	save_switch_stack -	moveml	%a3-%a6/%d6-%d7,%sp@- -.endm - -.macro	restore_switch_stack -	moveml	%sp@+,%a3-%a6/%d6-%d7 -.endm - -.macro	get_current reg=%d0 -	movel	%sp,\reg -	andw	#-THREAD_SIZE,\reg -	movel	\reg,%curptr -	movel	%curptr@,%curptr -.endm - -#else /* C source */ - -#define STR(X) STR1(X) -#define STR1(X) #X - -#define SAVE_ALL_INT				\ -	"clrl	%%sp@-;"    /* stk_adj */	\ -	"pea	-1:w;"	    /* orig d0 = -1 */	\ -	"movel	%%d0,%%sp@-;" /* d0 */		\ -	"moveml	%%d1-%%d5/%%a0-%%a2,%%sp@-" -#define GET_CURRENT(tmp) \ -	"movel	%%sp,"#tmp"\n\t" \ -	"andw	#-"STR(THREAD_SIZE)","#tmp"\n\t" \ -	"movel	"#tmp",%%a2\n\t" \ -	"movel	%%a2@,%%a2" - -#endif - -#endif /* __M68K_ENTRY_H */ diff --git a/arch/m68k/include/asm/entry_no.h b/arch/m68k/include/asm/entry_no.h deleted file mode 100644 index 26be277394f..00000000000 --- a/arch/m68k/include/asm/entry_no.h +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef __M68KNOMMU_ENTRY_H -#define __M68KNOMMU_ENTRY_H - -#include <asm/setup.h> -#include <asm/page.h> - -/* - * Stack layout in 'ret_from_exception': - * - * This allows access to the syscall arguments in registers d1-d5 - * - *	 0(sp) - d1 - *	 4(sp) - d2 - *	 8(sp) - d3 - *	 C(sp) - d4 - *	10(sp) - d5 - *	14(sp) - a0 - *	18(sp) - a1 - *	1C(sp) - a2 - *	20(sp) - d0 - *	24(sp) - orig_d0 - *	28(sp) - stack adjustment - *	2C(sp) - [ sr              ] [ format & vector ] - *	2E(sp) - [ pc-hiword       ] [ sr              ] - *	30(sp) - [ pc-loword       ] [ pc-hiword       ] - *	32(sp) - [ format & vector ] [ pc-loword       ] - *		  ^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^ - *			M68K		  COLDFIRE - */ - -#define ALLOWINT (~0x700) - -#ifdef __ASSEMBLY__ - -#define SWITCH_STACK_SIZE (6*4+4)	/* Includes return address */ - -/* - * This defines the normal kernel pt-regs layout. - * - * regs are a2-a6 and d6-d7 preserved by C code - * the kernel doesn't mess with usp unless it needs to - */ - -#ifdef CONFIG_COLDFIRE -/* - * This is made a little more tricky on the ColdFire. There is no - * separate kernel and user stack pointers. Need to artificially - * construct a usp in software... When doing this we need to disable - * interrupts, otherwise bad things could happen. - */ -.macro SAVE_ALL -	move	#0x2700,%sr		/* disable intrs */ -	btst	#5,%sp@(2)		/* from user? */ -	bnes	6f			/* no, skip */ -	movel	%sp,sw_usp		/* save user sp */ -	addql	#8,sw_usp		/* remove exception */ -	movel	sw_ksp,%sp		/* kernel sp */ -	subql	#8,%sp			/* room for exception */ -	clrl	%sp@-			/* stkadj */ -	movel	%d0,%sp@-		/* orig d0 */ -	movel	%d0,%sp@-		/* d0 */ -	lea	%sp@(-32),%sp		/* space for 8 regs */ -	moveml	%d1-%d5/%a0-%a2,%sp@ -	movel	sw_usp,%a0		/* get usp */ -	movel	%a0@-,%sp@(PT_OFF_PC)	/* copy exception program counter */ -	movel	%a0@-,%sp@(PT_OFF_FORMATVEC)/*copy exception format/vector/sr */ -	bra	7f -	6: -	clrl	%sp@-			/* stkadj */ -	movel	%d0,%sp@-		/* orig d0 */ -	movel	%d0,%sp@-		/* d0 */ -	lea	%sp@(-32),%sp		/* space for 8 regs */ -	moveml	%d1-%d5/%a0-%a2,%sp@ -	7: -.endm - -.macro RESTORE_ALL -	btst	#5,%sp@(PT_SR)		/* going user? */ -	bnes	8f			/* no, skip */ -	move	#0x2700,%sr		/* disable intrs */ -	movel	sw_usp,%a0		/* get usp */ -	movel	%sp@(PT_OFF_PC),%a0@-	/* copy exception program counter */ -	movel	%sp@(PT_OFF_FORMATVEC),%a0@-/*copy exception format/vector/sr */ -	moveml	%sp@,%d1-%d5/%a0-%a2 -	lea	%sp@(32),%sp		/* space for 8 regs */ -	movel	%sp@+,%d0 -	addql	#4,%sp			/* orig d0 */ -	addl	%sp@+,%sp		/* stkadj */ -	addql	#8,%sp			/* remove exception */ -	movel	%sp,sw_ksp		/* save ksp */ -	subql	#8,sw_usp		/* set exception */ -	movel	sw_usp,%sp		/* restore usp */ -	rte -	8: -	moveml	%sp@,%d1-%d5/%a0-%a2 -	lea	%sp@(32),%sp		/* space for 8 regs */ -	movel	%sp@+,%d0 -	addql	#4,%sp			/* orig d0 */ -	addl	%sp@+,%sp		/* stkadj */ -	rte -.endm - -/* - * Quick exception save, use current stack only. - */ -.macro SAVE_LOCAL -	move	#0x2700,%sr		/* disable intrs */ -	clrl	%sp@-			/* stkadj */ -	movel	%d0,%sp@-		/* orig d0 */ -	movel	%d0,%sp@-		/* d0 */ -	lea	%sp@(-32),%sp		/* space for 8 regs */ -	moveml	%d1-%d5/%a0-%a2,%sp@ -.endm - -.macro RESTORE_LOCAL -	moveml	%sp@,%d1-%d5/%a0-%a2 -	lea	%sp@(32),%sp		/* space for 8 regs */ -	movel	%sp@+,%d0 -	addql	#4,%sp			/* orig d0 */ -	addl	%sp@+,%sp		/* stkadj */ -	rte -.endm - -.macro SAVE_SWITCH_STACK -	lea	%sp@(-24),%sp		/* 6 regs */ -	moveml	%a3-%a6/%d6-%d7,%sp@ -.endm - -.macro RESTORE_SWITCH_STACK -	moveml	%sp@,%a3-%a6/%d6-%d7 -	lea	%sp@(24),%sp		/* 6 regs */ -.endm - -/* - * Software copy of the user and kernel stack pointers... Ugh... - * Need these to get around ColdFire not having separate kernel - * and user stack pointers. - */ -.globl sw_usp -.globl sw_ksp - -#else /* !CONFIG_COLDFIRE */ - -/* - * Standard 68k interrupt entry and exit macros. - */ -.macro SAVE_ALL -	clrl	%sp@-			/* stkadj */ -	movel	%d0,%sp@-		/* orig d0 */ -	movel	%d0,%sp@-		/* d0 */ -	moveml	%d1-%d5/%a0-%a2,%sp@- -.endm - -.macro RESTORE_ALL -	moveml	%sp@+,%a0-%a2/%d1-%d5 -	movel	%sp@+,%d0 -	addql	#4,%sp			/* orig d0 */ -	addl	%sp@+,%sp		/* stkadj */ -	rte -.endm - -.macro SAVE_SWITCH_STACK -	moveml	%a3-%a6/%d6-%d7,%sp@- -.endm - -.macro RESTORE_SWITCH_STACK -	moveml	%sp@+,%a3-%a6/%d6-%d7 -.endm - -#endif /* !CONFIG_COLDFIRE */ -#endif /* __ASSEMBLY__ */ -#endif /* __M68KNOMMU_ENTRY_H */ diff --git a/arch/m68k/include/asm/errno.h b/arch/m68k/include/asm/errno.h deleted file mode 100644 index 0d4e188d6ef..00000000000 --- a/arch/m68k/include/asm/errno.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_ERRNO_H -#define _M68K_ERRNO_H - -#include <asm-generic/errno.h> - -#endif /* _M68K_ERRNO_H */ diff --git a/arch/m68k/include/asm/fcntl.h b/arch/m68k/include/asm/fcntl.h deleted file mode 100644 index 1c369b20dc4..00000000000 --- a/arch/m68k/include/asm/fcntl.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _M68K_FCNTL_H -#define _M68K_FCNTL_H - -#define O_DIRECTORY	040000	/* must be a directory */ -#define O_NOFOLLOW	0100000	/* don't follow links */ -#define O_DIRECT	0200000	/* direct disk access hint - currently ignored */ -#define O_LARGEFILE	0400000 - -#include <asm-generic/fcntl.h> - -#endif /* _M68K_FCNTL_H */ diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h index a0e29079397..f9454b89a51 100644 --- a/arch/m68k/include/asm/flat.h +++ b/arch/m68k/include/asm/flat.h @@ -11,6 +11,11 @@  #define	flat_get_addr_from_rp(rp, relval, flags, p)	get_unaligned(rp)  #define	flat_put_addr_at_rp(rp, val, relval)	put_unaligned(val,rp)  #define	flat_get_relocate_addr(rel)		(rel) -#define	flat_set_persistent(relval, p)		0 + +static inline int flat_set_persistent(unsigned long relval, +				      unsigned long *persistent) +{ +	return 0; +}  #endif /* __M68KNOMMU_FLAT_H__ */ diff --git a/arch/m68k/include/asm/floppy.h b/arch/m68k/include/asm/floppy.h index 697d50393dd..47365b1ccbe 100644 --- a/arch/m68k/include/asm/floppy.h +++ b/arch/m68k/include/asm/floppy.h @@ -85,7 +85,7 @@ static int fd_request_irq(void)  {  	if(MACH_IS_Q40)  		return request_irq(FLOPPY_IRQ, floppy_hardint, -				   IRQF_DISABLED, "floppy", floppy_hardint); +				   0, "floppy", floppy_hardint);  	else if(MACH_IS_SUN3X)  		return sun3xflop_request_irq();  	return -ENXIO; diff --git a/arch/m68k/include/asm/fpu.h b/arch/m68k/include/asm/fpu.h index ffb6b8cfc6d..526db9da9e4 100644 --- a/arch/m68k/include/asm/fpu.h +++ b/arch/m68k/include/asm/fpu.h @@ -12,6 +12,8 @@  #define FPSTATESIZE (96)  #elif defined(CONFIG_M68KFPU_EMU)  #define FPSTATESIZE (28) +#elif defined(CONFIG_COLDFIRE) && defined(CONFIG_MMU) +#define FPSTATESIZE (16)  #elif defined(CONFIG_M68060)  #define FPSTATESIZE (12)  #else diff --git a/arch/m68k/include/asm/futex.h b/arch/m68k/include/asm/futex.h index 6a332a9f099..bc868af10c9 100644 --- a/arch/m68k/include/asm/futex.h +++ b/arch/m68k/include/asm/futex.h @@ -1,6 +1,94 @@ -#ifndef _ASM_FUTEX_H -#define _ASM_FUTEX_H +#ifndef _ASM_M68K_FUTEX_H +#define _ASM_M68K_FUTEX_H +#ifdef __KERNEL__ +#if !defined(CONFIG_MMU)  #include <asm-generic/futex.h> +#else	/* CONFIG_MMU */ -#endif +#include <linux/futex.h> +#include <linux/uaccess.h> +#include <asm/errno.h> + +static inline int +futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, +			      u32 oldval, u32 newval) +{ +	u32 val; + +	if (unlikely(get_user(val, uaddr) != 0)) +		return -EFAULT; + +	if (val == oldval && unlikely(put_user(newval, uaddr) != 0)) +		return -EFAULT; + +	*uval = val; + +	return 0; +} + +static inline int +futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) +{ +	int op = (encoded_op >> 28) & 7; +	int cmp = (encoded_op >> 24) & 15; +	int oparg = (encoded_op << 8) >> 20; +	int cmparg = (encoded_op << 20) >> 20; +	int oldval, ret; +	u32 tmp; + +	if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) +		oparg = 1 << oparg; + +	pagefault_disable();	/* implies preempt_disable() */ + +	ret = -EFAULT; +	if (unlikely(get_user(oldval, uaddr) != 0)) +		goto out_pagefault_enable; + +	ret = 0; +	tmp = oldval; + +	switch (op) { +	case FUTEX_OP_SET: +		tmp = oparg; +		break; +	case FUTEX_OP_ADD: +		tmp += oparg; +		break; +	case FUTEX_OP_OR: +		tmp |= oparg; +		break; +	case FUTEX_OP_ANDN: +		tmp &= ~oparg; +		break; +	case FUTEX_OP_XOR: +		tmp ^= oparg; +		break; +	default: +		ret = -ENOSYS; +	} + +	if (ret == 0 && unlikely(put_user(tmp, uaddr) != 0)) +		ret = -EFAULT; + +out_pagefault_enable: +	pagefault_enable();	/* subsumes preempt_enable() */ + +	if (ret == 0) { +		switch (cmp) { +		case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; +		case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; +		case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; +		case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; +		case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; +		case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; +		default: ret = -ENOSYS; +		} +	} +	return ret; +} + +#endif /* CONFIG_MMU */ +#endif /* __KERNEL__ */ +#endif /* _ASM_M68K_FUTEX_H */ diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h index 1b57adbafad..2f6eec1e34b 100644 --- a/arch/m68k/include/asm/gpio.h +++ b/arch/m68k/include/asm/gpio.h @@ -17,170 +17,9 @@  #define coldfire_gpio_h  #include <linux/io.h> -#include <asm-generic/gpio.h>  #include <asm/coldfire.h>  #include <asm/mcfsim.h> - -/* - * The Freescale Coldfire family is quite varied in how they implement GPIO. - * Some parts have 8 bit ports, some have 16bit and some have 32bit; some have - * only one port, others have multiple ports; some have a single data latch - * for both input and output, others have a separate pin data register to read - * input; some require a read-modify-write access to change an output, others - * have set and clear registers for some of the outputs; Some have all the - * GPIOs in a single control area, others have some GPIOs implemented in - * different modules. - * - * This implementation attempts accomodate the differences while presenting - * a generic interface that will optimize to as few instructions as possible. - */ -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ -    defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ -    defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ -    defined(CONFIG_M532x) || defined(CONFIG_M548x) - -/* These parts have GPIO organized by 8 bit ports */ - -#define MCFGPIO_PORTTYPE		u8 -#define MCFGPIO_PORTSIZE		8 -#define mcfgpio_read(port)		__raw_readb(port) -#define mcfgpio_write(data, port)	__raw_writeb(data, port) - -#elif defined(CONFIG_M5307) || defined(CONFIG_M5407) || defined(CONFIG_M5272) - -/* These parts have GPIO organized by 16 bit ports */ - -#define MCFGPIO_PORTTYPE		u16 -#define MCFGPIO_PORTSIZE		16 -#define mcfgpio_read(port)		__raw_readw(port) -#define mcfgpio_write(data, port)	__raw_writew(data, port) - -#elif defined(CONFIG_M5249) - -/* These parts have GPIO organized by 32 bit ports */ - -#define MCFGPIO_PORTTYPE		u32 -#define MCFGPIO_PORTSIZE		32 -#define mcfgpio_read(port)		__raw_readl(port) -#define mcfgpio_write(data, port)	__raw_writel(data, port) - -#endif - -#define mcfgpio_bit(gpio)		(1 << ((gpio) %  MCFGPIO_PORTSIZE)) -#define mcfgpio_port(gpio)		((gpio) / MCFGPIO_PORTSIZE) - -#if defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ -    defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x) -/* - * These parts have an 'Edge' Port module (external interrupt/GPIO) which uses - * read-modify-write to change an output and a GPIO module which has separate - * set/clr registers to directly change outputs with a single write access. - */ -#if defined(CONFIG_M528x) -/* - * The 528x also has GPIOs in other modules (GPT, QADC) which use - * read-modify-write as well as those controlled by the EPORT and GPIO modules. - */ -#define MCFGPIO_SCR_START		40 -#else -#define MCFGPIO_SCR_START		8 -#endif - -#define MCFGPIO_SETR_PORT(gpio)		(MCFGPIO_SETR + \ -					mcfgpio_port(gpio - MCFGPIO_SCR_START)) - -#define MCFGPIO_CLRR_PORT(gpio)		(MCFGPIO_CLRR + \ -					mcfgpio_port(gpio - MCFGPIO_SCR_START)) -#else - -#define MCFGPIO_SCR_START		MCFGPIO_PIN_MAX -/* with MCFGPIO_SCR == MCFGPIO_PIN_MAX, these will be optimized away */ -#define MCFGPIO_SETR_PORT(gpio)		0 -#define MCFGPIO_CLRR_PORT(gpio)		0 - -#endif -/* - * Coldfire specific helper functions - */ - -/* return the port pin data register for a gpio */ -static inline u32 __mcf_gpio_ppdr(unsigned gpio) -{ -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ -    defined(CONFIG_M5307) || defined(CONFIG_M5407) -	return MCFSIM_PADAT; -#elif defined(CONFIG_M5272) -	if (gpio < 16) -		return MCFSIM_PADAT; -	else if (gpio < 32) -		return MCFSIM_PBDAT; -	else -		return MCFSIM_PCDAT; -#elif defined(CONFIG_M5249) -	if (gpio < 32) -		return MCFSIM2_GPIOREAD; -	else -		return MCFSIM2_GPIO1READ; -#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ -      defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x) -	if (gpio < 8) -		return MCFEPORT_EPPDR; -#if defined(CONFIG_M528x) -	else if (gpio < 16) -		return MCFGPTA_GPTPORT; -	else if (gpio < 24) -		return MCFGPTB_GPTPORT; -	else if (gpio < 32) -		return MCFQADC_PORTQA; -	else if (gpio < 40) -		return MCFQADC_PORTQB; -#endif -	else -		return MCFGPIO_PPDR + mcfgpio_port(gpio - MCFGPIO_SCR_START); -#else -	return 0; -#endif -} - -/* return the port output data register for a gpio */ -static inline u32 __mcf_gpio_podr(unsigned gpio) -{ -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ -    defined(CONFIG_M5307) || defined(CONFIG_M5407) -	return MCFSIM_PADAT; -#elif defined(CONFIG_M5272) -	if (gpio < 16) -		return MCFSIM_PADAT; -	else if (gpio < 32) -		return MCFSIM_PBDAT; -	else -		return MCFSIM_PCDAT; -#elif defined(CONFIG_M5249) -	if (gpio < 32) -		return MCFSIM2_GPIOWRITE; -	else -		return MCFSIM2_GPIO1WRITE; -#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ -      defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x) -	if (gpio < 8) -		return MCFEPORT_EPDR; -#if defined(CONFIG_M528x) -	else if (gpio < 16) -		return MCFGPTA_GPTPORT; -	else if (gpio < 24) -		return MCFGPTB_GPTPORT; -	else if (gpio < 32) -		return MCFQADC_PORTQA; -	else if (gpio < 40) -		return MCFQADC_PORTQB; -#endif -	else -		return MCFGPIO_PODR + mcfgpio_port(gpio - MCFGPIO_SCR_START); -#else -	return 0; -#endif -} - +#include <asm/mcfgpio.h>  /*   * The Generic GPIO functions   * @@ -191,7 +30,7 @@ static inline u32 __mcf_gpio_podr(unsigned gpio)  static inline int gpio_get_value(unsigned gpio)  {  	if (__builtin_constant_p(gpio) && gpio < MCFGPIO_PIN_MAX) -		return mcfgpio_read(__mcf_gpio_ppdr(gpio)) & mcfgpio_bit(gpio); +		return mcfgpio_read(__mcfgpio_ppdr(gpio)) & mcfgpio_bit(gpio);  	else  		return __gpio_get_value(gpio);  } @@ -204,12 +43,12 @@ static inline void gpio_set_value(unsigned gpio, int value)  			MCFGPIO_PORTTYPE data;  			local_irq_save(flags); -			data = mcfgpio_read(__mcf_gpio_podr(gpio)); +			data = mcfgpio_read(__mcfgpio_podr(gpio));  			if (value)  				data |= mcfgpio_bit(gpio);  			else  				data &= ~mcfgpio_bit(gpio); -			mcfgpio_write(data, __mcf_gpio_podr(gpio)); +			mcfgpio_write(data, __mcfgpio_podr(gpio));  			local_irq_restore(flags);  		} else {  			if (value) @@ -225,7 +64,14 @@ static inline void gpio_set_value(unsigned gpio, int value)  static inline int gpio_to_irq(unsigned gpio)  { -	return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE : -EINVAL; +#if defined(MCFGPIO_IRQ_MIN) +	if ((gpio >= MCFGPIO_IRQ_MIN) && (gpio < MCFGPIO_IRQ_MAX)) +#else +	if (gpio < MCFGPIO_IRQ_MAX) +#endif +		return gpio + MCFGPIO_IRQ_VECBASE; +	else +		return __gpio_to_irq(gpio);  }  static inline int irq_to_gpio(unsigned irq) @@ -240,4 +86,25 @@ static inline int gpio_cansleep(unsigned gpio)  	return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio);  } +#ifndef CONFIG_GPIOLIB +static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) +{ +	int err; + +	err = gpio_request(gpio, label); +	if (err) +		return err; + +	if (flags & GPIOF_DIR_IN) +		err = gpio_direction_input(gpio); +	else +		err = gpio_direction_output(gpio, +			(flags & GPIOF_INIT_HIGH) ? 1 : 0); + +	if (err) +		gpio_free(gpio); + +	return err; +} +#endif /* !CONFIG_GPIOLIB */  #endif diff --git a/arch/m68k/include/asm/hardirq.h b/arch/m68k/include/asm/hardirq.h index 56d0d5db231..6c618529d9b 100644 --- a/arch/m68k/include/asm/hardirq.h +++ b/arch/m68k/include/asm/hardirq.h @@ -1,5 +1,28 @@ -#ifdef __uClinux__ -#include "hardirq_no.h" +#ifndef __M68K_HARDIRQ_H +#define __M68K_HARDIRQ_H + +#include <linux/threads.h> +#include <linux/cache.h> +#include <asm/irq.h> + +#ifdef CONFIG_MMU + +static inline void ack_bad_irq(unsigned int irq) +{ +	pr_crit("unexpected IRQ trap at vector %02x\n", irq); +} + +/* entry.S is sensitive to the offsets of these fields */ +typedef struct { +	unsigned int __softirq_pending; +} ____cacheline_aligned irq_cpustat_t; + +#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */ +  #else -#include "hardirq_mm.h" + +#include <asm-generic/hardirq.h> + +#endif /* !CONFIG_MMU */ +  #endif diff --git a/arch/m68k/include/asm/hardirq_mm.h b/arch/m68k/include/asm/hardirq_mm.h deleted file mode 100644 index 394ee946015..00000000000 --- a/arch/m68k/include/asm/hardirq_mm.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef __M68K_HARDIRQ_H -#define __M68K_HARDIRQ_H - -#include <linux/threads.h> -#include <linux/cache.h> - -/* entry.S is sensitive to the offsets of these fields */ -typedef struct { -	unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */ - -#define HARDIRQ_BITS	8 - -#endif diff --git a/arch/m68k/include/asm/hardirq_no.h b/arch/m68k/include/asm/hardirq_no.h deleted file mode 100644 index b44b14be87d..00000000000 --- a/arch/m68k/include/asm/hardirq_no.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __M68K_HARDIRQ_H -#define __M68K_HARDIRQ_H - -#include <asm/irq.h> - -#define HARDIRQ_BITS	8 - -/* - * The hardirq mask has to be large enough to have - * space for potentially all IRQ sources in the system - * nesting on a single CPU: - */ -#if (1 << HARDIRQ_BITS) < NR_IRQS -# error HARDIRQ_BITS is too low! -#endif - -#include <asm-generic/hardirq.h> - -#endif /* __M68K_HARDIRQ_H */ diff --git a/arch/m68k/include/asm/hp300hw.h b/arch/m68k/include/asm/hp300hw.h index d998ea67c19..64f5271dd7b 100644 --- a/arch/m68k/include/asm/hp300hw.h +++ b/arch/m68k/include/asm/hp300hw.h @@ -1,25 +1,9 @@  #ifndef _M68K_HP300HW_H  #define _M68K_HP300HW_H -extern unsigned long hp300_model; +#include <asm/bootinfo-hp300.h> -/* This information was taken from NetBSD */ -#define	HP_320		(0)	/* 16MHz 68020+HP MMU+16K external cache */ -#define	HP_330		(1)	/* 16MHz 68020+68851 MMU */ -#define	HP_340		(2)	/* 16MHz 68030 */ -#define	HP_345		(3)	/* 50MHz 68030+32K external cache */ -#define	HP_350		(4)	/* 25MHz 68020+HP MMU+32K external cache */ -#define	HP_360		(5)	/* 25MHz 68030 */ -#define	HP_370		(6)	/* 33MHz 68030+64K external cache */ -#define	HP_375		(7)	/* 50MHz 68030+32K external cache */ -#define	HP_380		(8)	/* 25MHz 68040 */ -#define	HP_385		(9)	/* 33MHz 68040 */ -#define	HP_400		(10)	/* 50MHz 68030+32K external cache */ -#define	HP_425T		(11)	/* 25MHz 68040 - model 425t */ -#define	HP_425S		(12)	/* 25MHz 68040 - model 425s */ -#define HP_425E		(13)	/* 25MHz 68040 - model 425e */ -#define HP_433T		(14)	/* 33MHz 68040 - model 433t */ -#define HP_433S		(15)	/* 33MHz 68040 - model 433s */ +extern unsigned long hp300_model;  #endif /* _M68K_HP300HW_H */ diff --git a/arch/m68k/include/asm/hw_irq.h b/arch/m68k/include/asm/hw_irq.h deleted file mode 100644 index eacef0951fb..00000000000 --- a/arch/m68k/include/asm/hw_irq.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_M68K_HW_IRQ_H -#define __ASM_M68K_HW_IRQ_H - -/* Dummy include. */ - -#endif diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h index c7210ba184e..c70cc915500 100644 --- a/arch/m68k/include/asm/io.h +++ b/arch/m68k/include/asm/io.h @@ -1,5 +1,5 @@  #ifdef __uClinux__ -#include "io_no.h" +#include <asm/io_no.h>  #else -#include "io_mm.h" +#include <asm/io_mm.h>  #endif diff --git a/arch/m68k/include/asm/io_mm.h b/arch/m68k/include/asm/io_mm.h index 0fb3468000e..ffdf54f44bc 100644 --- a/arch/m68k/include/asm/io_mm.h +++ b/arch/m68k/include/asm/io_mm.h @@ -63,16 +63,80 @@  #endif  #endif /* AMIGA_PCMCIA */ +#ifdef CONFIG_ATARI_ROM_ISA +#define enec_isa_read_base  0xfffa0000 +#define enec_isa_write_base 0xfffb0000 -#ifdef CONFIG_ISA +#define ENEC_ISA_IO_B(ioaddr)	(enec_isa_read_base+((((unsigned long)(ioaddr))&0x7F)<<9)) +#define ENEC_ISA_IO_W(ioaddr)	(enec_isa_read_base+((((unsigned long)(ioaddr))&0x7F)<<9)) +#define ENEC_ISA_MEM_B(madr)	(enec_isa_read_base+((((unsigned long)(madr))&0x7F)<<9)) +#define ENEC_ISA_MEM_W(madr)	(enec_isa_read_base+((((unsigned long)(madr))&0x7F)<<9)) + +#ifndef MULTI_ISA +#define MULTI_ISA 0 +#else +#undef MULTI_ISA +#define MULTI_ISA 1 +#endif +#endif /* ATARI_ROM_ISA */ + + +#if defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE) + +#define HAVE_ARCH_PIO_SIZE +#define PIO_OFFSET	0 +#define PIO_MASK	0xffff +#define PIO_RESERVED	0x10000 + +u8 mcf_pci_inb(u32 addr); +u16 mcf_pci_inw(u32 addr); +u32 mcf_pci_inl(u32 addr); +void mcf_pci_insb(u32 addr, u8 *buf, u32 len); +void mcf_pci_insw(u32 addr, u16 *buf, u32 len); +void mcf_pci_insl(u32 addr, u32 *buf, u32 len); + +void mcf_pci_outb(u8 v, u32 addr); +void mcf_pci_outw(u16 v, u32 addr); +void mcf_pci_outl(u32 v, u32 addr); +void mcf_pci_outsb(u32 addr, const u8 *buf, u32 len); +void mcf_pci_outsw(u32 addr, const u16 *buf, u32 len); +void mcf_pci_outsl(u32 addr, const u32 *buf, u32 len); + +#define	inb	mcf_pci_inb +#define	inb_p	mcf_pci_inb +#define	inw	mcf_pci_inw +#define	inw_p	mcf_pci_inw +#define	inl	mcf_pci_inl +#define	inl_p	mcf_pci_inl +#define	insb	mcf_pci_insb +#define	insw	mcf_pci_insw +#define	insl	mcf_pci_insl + +#define	outb	mcf_pci_outb +#define	outb_p	mcf_pci_outb +#define	outw	mcf_pci_outw +#define	outw_p	mcf_pci_outw +#define	outl	mcf_pci_outl +#define	outl_p	mcf_pci_outl +#define	outsb	mcf_pci_outsb +#define	outsw	mcf_pci_outsw +#define	outsl	mcf_pci_outsl + +#define readb(addr)	in_8(addr) +#define writeb(v, addr)	out_8((addr), (v)) +#define readw(addr)	in_le16(addr) +#define writew(v, addr)	out_le16((addr), (v)) + +#elif defined(CONFIG_ISA) || defined(CONFIG_ATARI_ROM_ISA)  #if MULTI_ISA == 0  #undef MULTI_ISA  #endif -#define ISA_TYPE_Q40 (1) -#define ISA_TYPE_AG  (2) +#define ISA_TYPE_Q40  (1) +#define ISA_TYPE_AG   (2) +#define ISA_TYPE_ENEC (3)  #if defined(CONFIG_Q40) && !defined(MULTI_ISA)  #define ISA_TYPE ISA_TYPE_Q40 @@ -82,6 +146,10 @@  #define ISA_TYPE ISA_TYPE_AG  #define ISA_SEX  1  #endif +#if defined(CONFIG_ATARI_ROM_ISA) && !defined(MULTI_ISA) +#define ISA_TYPE ISA_TYPE_ENEC +#define ISA_SEX  0 +#endif  #ifdef MULTI_ISA  extern int isa_type; @@ -106,6 +174,9 @@ static inline u8 __iomem *isa_itb(unsigned long addr)  #ifdef CONFIG_AMIGA_PCMCIA      case ISA_TYPE_AG: return (u8 __iomem *)AG_ISA_IO_B(addr);  #endif +#ifdef CONFIG_ATARI_ROM_ISA +    case ISA_TYPE_ENEC: return (u8 __iomem *)ENEC_ISA_IO_B(addr); +#endif      default: return NULL; /* avoid warnings, just in case */      }  } @@ -119,6 +190,9 @@ static inline u16 __iomem *isa_itw(unsigned long addr)  #ifdef CONFIG_AMIGA_PCMCIA      case ISA_TYPE_AG: return (u16 __iomem *)AG_ISA_IO_W(addr);  #endif +#ifdef CONFIG_ATARI_ROM_ISA +    case ISA_TYPE_ENEC: return (u16 __iomem *)ENEC_ISA_IO_W(addr); +#endif      default: return NULL; /* avoid warnings, just in case */      }  } @@ -142,6 +216,9 @@ static inline u8 __iomem *isa_mtb(unsigned long addr)  #ifdef CONFIG_AMIGA_PCMCIA      case ISA_TYPE_AG: return (u8 __iomem *)addr;  #endif +#ifdef CONFIG_ATARI_ROM_ISA +    case ISA_TYPE_ENEC: return (u8 __iomem *)ENEC_ISA_MEM_B(addr); +#endif      default: return NULL; /* avoid warnings, just in case */      }  } @@ -155,6 +232,9 @@ static inline u16 __iomem *isa_mtw(unsigned long addr)  #ifdef CONFIG_AMIGA_PCMCIA      case ISA_TYPE_AG: return (u16 __iomem *)addr;  #endif +#ifdef CONFIG_ATARI_ROM_ISA +    case ISA_TYPE_ENEC: return (u16 __iomem *)ENEC_ISA_MEM_W(addr); +#endif      default: return NULL; /* avoid warnings, just in case */      }  } @@ -176,6 +256,36 @@ static inline u16 __iomem *isa_mtw(unsigned long addr)  	(ISA_SEX ? out_be16(isa_mtw((unsigned long)(p)),(val))	\  		 : out_le16(isa_mtw((unsigned long)(p)),(val))) +#ifdef CONFIG_ATARI_ROM_ISA +#define isa_rom_inb(port)      rom_in_8(isa_itb(port)) +#define isa_rom_inw(port)	\ +	(ISA_SEX ? rom_in_be16(isa_itw(port))	\ +		 : rom_in_le16(isa_itw(port))) + +#define isa_rom_outb(val, port) rom_out_8(isa_itb(port), (val)) +#define isa_rom_outw(val, port)	\ +	(ISA_SEX ? rom_out_be16(isa_itw(port), (val))	\ +		 : rom_out_le16(isa_itw(port), (val))) + +#define isa_rom_readb(p)       rom_in_8(isa_mtb((unsigned long)(p))) +#define isa_rom_readw(p)       \ +	(ISA_SEX ? rom_in_be16(isa_mtw((unsigned long)(p)))	\ +		 : rom_in_le16(isa_mtw((unsigned long)(p)))) +#define isa_rom_readw_swap(p)       \ +	(ISA_SEX ? rom_in_le16(isa_mtw((unsigned long)(p)))	\ +		 : rom_in_be16(isa_mtw((unsigned long)(p)))) +#define isa_rom_readw_raw(p)   rom_in_be16(isa_mtw((unsigned long)(p))) + +#define isa_rom_writeb(val, p)  rom_out_8(isa_mtb((unsigned long)(p)), (val)) +#define isa_rom_writew(val, p)  \ +	(ISA_SEX ? rom_out_be16(isa_mtw((unsigned long)(p)), (val))	\ +		 : rom_out_le16(isa_mtw((unsigned long)(p)), (val))) +#define isa_rom_writew_swap(val, p)  \ +	(ISA_SEX ? rom_out_le16(isa_mtw((unsigned long)(p)), (val))	\ +		 : rom_out_be16(isa_mtw((unsigned long)(p)), (val))) +#define isa_rom_writew_raw(val, p)  rom_out_be16(isa_mtw((unsigned long)(p)), (val)) +#endif /* CONFIG_ATARI_ROM_ISA */ +  static inline void isa_delay(void)  {    switch(ISA_TYPE) @@ -186,6 +296,9 @@ static inline void isa_delay(void)  #ifdef CONFIG_AMIGA_PCMCIA      case ISA_TYPE_AG: break;  #endif +#ifdef CONFIG_ATARI_ROM_ISA +    case ISA_TYPE_ENEC: break; +#endif      default: break; /* avoid warnings */      }  } @@ -217,6 +330,29 @@ static inline void isa_delay(void)                    raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)<<1)) +#ifdef CONFIG_ATARI_ROM_ISA +#define isa_rom_inb_p(p)	({ u8 _v = isa_rom_inb(p); isa_delay(); _v; }) +#define isa_rom_inw_p(p)	({ u16 _v = isa_rom_inw(p); isa_delay(); _v; }) +#define isa_rom_outb_p(v, p)	({ isa_rom_outb((v), (p)); isa_delay(); }) +#define isa_rom_outw_p(v, p)	({ isa_rom_outw((v), (p)); isa_delay(); }) + +#define isa_rom_insb(port, buf, nr) raw_rom_insb(isa_itb(port), (u8 *)(buf), (nr)) + +#define isa_rom_insw(port, buf, nr)     \ +       (ISA_SEX ? raw_rom_insw(isa_itw(port), (u16 *)(buf), (nr)) :    \ +		  raw_rom_insw_swapw(isa_itw(port), (u16 *)(buf), (nr))) + +#define isa_rom_outsb(port, buf, nr) raw_rom_outsb(isa_itb(port), (u8 *)(buf), (nr)) + +#define isa_rom_outsw(port, buf, nr)    \ +       (ISA_SEX ? raw_rom_outsw(isa_itw(port), (u16 *)(buf), (nr)) :  \ +		  raw_rom_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr))) +#endif /* CONFIG_ATARI_ROM_ISA */ + +#endif  /* CONFIG_ISA || CONFIG_ATARI_ROM_ISA */ + + +#if defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA)  #define inb     isa_inb  #define inb_p   isa_inb_p  #define outb    isa_outb @@ -239,9 +375,43 @@ static inline void isa_delay(void)  #define readw   isa_readw  #define writeb  isa_writeb  #define writew  isa_writew +#endif  /* CONFIG_ISA && !CONFIG_ATARI_ROM_ISA */ -#else  /* CONFIG_ISA */ - +#ifdef CONFIG_ATARI_ROM_ISA +/* + * kernel with both ROM port ISA and IDE compiled in, those have + * conflicting defs for in/out. Simply consider port < 1024 + * ROM port ISA and everything else regular ISA for IDE. read,write defined + * below. + */ +#define inb(port)	((port) < 1024 ? isa_rom_inb(port) : in_8(port)) +#define inb_p(port)	((port) < 1024 ? isa_rom_inb_p(port) : in_8(port)) +#define inw(port)	((port) < 1024 ? isa_rom_inw(port) : in_le16(port)) +#define inw_p(port)	((port) < 1024 ? isa_rom_inw_p(port) : in_le16(port)) +#define inl		isa_inl +#define inl_p		isa_inl_p + +#define outb(val, port)	((port) < 1024 ? isa_rom_outb((val), (port)) : out_8((port), (val))) +#define outb_p(val, port) ((port) < 1024 ? isa_rom_outb_p((val), (port)) : out_8((port), (val))) +#define outw(val, port)	((port) < 1024 ? isa_rom_outw((val), (port)) : out_le16((port), (val))) +#define outw_p(val, port) ((port) < 1024 ? isa_rom_outw_p((val), (port)) : out_le16((port), (val))) +#define outl		isa_outl +#define outl_p		isa_outl_p + +#define insb(port, buf, nr)	((port) < 1024 ? isa_rom_insb((port), (buf), (nr)) : isa_insb((port), (buf), (nr))) +#define insw(port, buf, nr)	((port) < 1024 ? isa_rom_insw((port), (buf), (nr)) : isa_insw((port), (buf), (nr))) +#define insl			isa_insl +#define outsb(port, buf, nr)	((port) < 1024 ? isa_rom_outsb((port), (buf), (nr)) : isa_outsb((port), (buf), (nr))) +#define outsw(port, buf, nr)	((port) < 1024 ? isa_rom_outsw((port), (buf), (nr)) : isa_outsw((port), (buf), (nr))) +#define outsl			isa_outsl + +#define readb(addr)		in_8(addr) +#define writeb(val, addr)	out_8((addr), (val)) +#define readw(addr)		in_le16(addr) +#define writew(val, addr)	out_le16((addr), (val)) +#endif /* CONFIG_ATARI_ROM_ISA */ + +#if !defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA)  /*   * We need to define dummy functions for GENERIC_IOMAP support.   */ @@ -273,11 +443,18 @@ static inline void isa_delay(void)  #define readw(addr)      in_le16(addr)  #define writew(val,addr) out_le16((addr),(val)) -#endif /* CONFIG_ISA */ +#endif /* !CONFIG_ISA && !CONFIG_ATARI_ROM_ISA */  #define readl(addr)      in_le32(addr)  #define writel(val,addr) out_le32((addr),(val)) +#define readsb(port, buf, nr)     raw_insb((port), (u8 *)(buf), (nr)) +#define readsw(port, buf, nr)     raw_insw((port), (u16 *)(buf), (nr)) +#define readsl(port, buf, nr)     raw_insl((port), (u32 *)(buf), (nr)) +#define writesb(port, buf, nr)    raw_outsb((port), (u8 *)(buf), (nr)) +#define writesw(port, buf, nr)    raw_outsw((port), (u16 *)(buf), (nr)) +#define writesl(port, buf, nr)    raw_outsl((port), (u32 *)(buf), (nr)) +  #define mmiowb()  static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) @@ -333,4 +510,6 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int   */  #define xlate_dev_kmem_ptr(p)	p +#define ioport_map(port, nr)	((void __iomem *)(port)) +  #endif /* _IO_H */ diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h index 6e2413e518c..52f7e849917 100644 --- a/arch/m68k/include/asm/io_no.h +++ b/arch/m68k/include/asm/io_no.h @@ -4,6 +4,7 @@  #ifdef __KERNEL__  #include <asm/virtconvert.h> +#include <asm-generic/iomap.h>  /*   * These are for ISA/PCI shared memory _only_ and should never be used @@ -54,7 +55,7 @@ static inline unsigned int _swapl(volatile unsigned long v)  #define __raw_writew writew  #define __raw_writel writel -static inline void io_outsb(unsigned int addr, void *buf, int len) +static inline void io_outsb(unsigned int addr, const void *buf, int len)  {  	volatile unsigned char *ap = (volatile unsigned char *) addr;  	unsigned char *bp = (unsigned char *) buf; @@ -62,7 +63,7 @@ static inline void io_outsb(unsigned int addr, void *buf, int len)  		*ap = *bp++;  } -static inline void io_outsw(unsigned int addr, void *buf, int len) +static inline void io_outsw(unsigned int addr, const void *buf, int len)  {  	volatile unsigned short *ap = (volatile unsigned short *) addr;  	unsigned short *bp = (unsigned short *) buf; @@ -70,7 +71,7 @@ static inline void io_outsw(unsigned int addr, void *buf, int len)  		*ap = _swapw(*bp++);  } -static inline void io_outsl(unsigned int addr, void *buf, int len) +static inline void io_outsl(unsigned int addr, const void *buf, int len)  {  	volatile unsigned int *ap = (volatile unsigned int *) addr;  	unsigned int *bp = (unsigned int *) buf; @@ -144,9 +145,10 @@ static inline void io_insl(unsigned int addr, void *buf, int len)  #define IOMAP_NOCACHE_NONSER		2  #define IOMAP_WRITETHROUGH		3 -extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); -extern void __iounmap(void *addr, unsigned long size); - +static inline void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) +{ +	return (void *) physaddr; +}  static inline void *ioremap(unsigned long physaddr, unsigned long size)  {  	return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); @@ -164,7 +166,7 @@ static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size  	return __ioremap(physaddr, size, IOMAP_FULL_CACHING);  } -extern void iounmap(void *addr); +#define	iounmap(addr)	do { } while(0)  /*   * Convert a physical pointer to a virtual kernel pointer for /dev/mem diff --git a/arch/m68k/include/asm/ioctl.h b/arch/m68k/include/asm/ioctl.h deleted file mode 100644 index b279fe06dfe..00000000000 --- a/arch/m68k/include/asm/ioctl.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/ioctl.h> diff --git a/arch/m68k/include/asm/ioctls.h b/arch/m68k/include/asm/ioctls.h deleted file mode 100644 index 1332bb4ca5b..00000000000 --- a/arch/m68k/include/asm/ioctls.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __ARCH_M68K_IOCTLS_H__ -#define __ARCH_M68K_IOCTLS_H__ - -#define FIOQSIZE	0x545E - -#include <asm-generic/ioctls.h> - -#endif /* __ARCH_M68K_IOCTLS_H__ */ diff --git a/arch/m68k/include/asm/ipcbuf.h b/arch/m68k/include/asm/ipcbuf.h deleted file mode 100644 index a623ea3f095..00000000000 --- a/arch/m68k/include/asm/ipcbuf.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __m68k_IPCBUF_H__ -#define __m68k_IPCBUF_H__ - -/* - * The user_ipc_perm structure for m68k architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 32-bit mode_t and seq - * - 2 miscellaneous 32-bit values - */ - -struct ipc64_perm -{ -	__kernel_key_t		key; -	__kernel_uid32_t	uid; -	__kernel_gid32_t	gid; -	__kernel_uid32_t	cuid; -	__kernel_gid32_t	cgid; -	__kernel_mode_t		mode; -	unsigned short		__pad1; -	unsigned short		seq; -	unsigned short		__pad2; -	unsigned long		__unused1; -	unsigned long		__unused2; -}; - -#endif /* __m68k_IPCBUF_H__ */ diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h index 907eff1edd2..81ca118d58a 100644 --- a/arch/m68k/include/asm/irq.h +++ b/arch/m68k/include/asm/irq.h @@ -6,12 +6,16 @@   * different m68k hosts compiled into the kernel.   * Currently the Atari has 72 and the Amiga 24, but if both are   * supported in the kernel it is better to make room for 72. + * With EtherNAT add-on card on Atari, the highest interrupt + * number is 140 so NR_IRQS needs to be 141.   */  #if defined(CONFIG_COLDFIRE)  #define NR_IRQS 256  #elif defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)  #define NR_IRQS 200 -#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) +#elif defined(CONFIG_ATARI) +#define NR_IRQS 141 +#elif defined(CONFIG_MAC)  #define NR_IRQS 72  #elif defined(CONFIG_Q40)  #define NR_IRQS	43 @@ -25,21 +29,8 @@  #define NR_IRQS	0  #endif -#ifdef CONFIG_MMU - -#include <linux/linkage.h> -#include <linux/hardirq.h> -#include <linux/irqreturn.h> -#include <linux/spinlock_types.h> - -/* - * The hardirq mask has to be large enough to have - * space for potentially all IRQ sources in the system - * nesting on a single CPU: - */ -#if (1 << HARDIRQ_BITS) < NR_IRQS -# error HARDIRQ_BITS is too low! -#endif +#if defined(CONFIG_M68020) || defined(CONFIG_M68030) || \ +    defined(CONFIG_M68040) || defined(CONFIG_M68060)  /*   * Interrupt source definitions @@ -63,72 +54,27 @@  #define IRQ_USER	8 -extern unsigned int irq_canonicalize(unsigned int irq); - -struct pt_regs; +struct irq_data; +struct irq_chip; +struct irq_desc; +extern unsigned int m68k_irq_startup(struct irq_data *data); +extern unsigned int m68k_irq_startup_irq(unsigned int irq); +extern void m68k_irq_shutdown(struct irq_data *data); +extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, +						      struct pt_regs *)); +extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt); +extern void m68k_setup_irq_controller(struct irq_chip *, +				      void (*handle)(unsigned int irq, +						     struct irq_desc *desc), +				      unsigned int irq, unsigned int cnt); -/* - * various flags for request_irq() - the Amiga now uses the standard - * mechanism like all other architectures - IRQF_DISABLED and - * IRQF_SHARED are your friends. - */ -#ifndef MACH_AMIGA_ONLY -#define IRQ_FLG_LOCK	(0x0001)	/* handler is not replaceable	*/ -#define IRQ_FLG_REPLACE	(0x0002)	/* replace existing handler	*/ -#define IRQ_FLG_FAST	(0x0004) -#define IRQ_FLG_SLOW	(0x0008) -#define IRQ_FLG_STD	(0x8000)	/* internally used		*/ -#endif - -/* - * This structure is used to chain together the ISRs for a particular - * interrupt source (if it supports chaining). - */ -typedef struct irq_node { -	irqreturn_t	(*handler)(int, void *); -	void		*dev_id; -	struct irq_node *next; -	unsigned long	flags; -	const char	*devname; -} irq_node_t; - -/* - * This structure has only 4 elements for speed reasons - */ -struct irq_handler { -	int		(*handler)(int, void *); -	unsigned long	flags; -	void		*dev_id; -	const char	*devname; -}; - -struct irq_controller { -	const char *name; -	spinlock_t lock; -	int (*startup)(unsigned int irq); -	void (*shutdown)(unsigned int irq); -	void (*enable)(unsigned int irq); -	void (*disable)(unsigned int irq); -}; - -extern int m68k_irq_startup(unsigned int); -extern void m68k_irq_shutdown(unsigned int); - -/* - * This function returns a new irq_node_t - */ -extern irq_node_t *new_irq_node(void); - -extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *)); -extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt, -				      void (*handler)(unsigned int, struct pt_regs *)); -extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int); - -asmlinkage void m68k_handle_int(unsigned int); -asmlinkage void __m68k_handle_int(unsigned int, struct pt_regs *); +extern unsigned int irq_canonicalize(unsigned int irq);  #else  #define irq_canonicalize(irq)  (irq) -#endif /* CONFIG_MMU */ +#endif /* !(CONFIG_M68020 || CONFIG_M68030 || CONFIG_M68040 || CONFIG_M68060) */ + +asmlinkage void do_IRQ(int irq, struct pt_regs *regs); +extern atomic_t irq_err_count;  #endif /* _M68K_IRQ_H_ */ diff --git a/arch/m68k/include/asm/irq_regs.h b/arch/m68k/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b7027..00000000000 --- a/arch/m68k/include/asm/irq_regs.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/irq_regs.h> diff --git a/arch/m68k/include/asm/irqflags.h b/arch/m68k/include/asm/irqflags.h index 7ef4115b8c4..a823cd73dc0 100644 --- a/arch/m68k/include/asm/irqflags.h +++ b/arch/m68k/include/asm/irqflags.h @@ -3,7 +3,7 @@  #include <linux/types.h>  #ifdef CONFIG_MMU -#include <linux/hardirq.h> +#include <linux/preempt_mask.h>  #endif  #include <linux/preempt.h>  #include <asm/thread_info.h> @@ -67,6 +67,10 @@ static inline void arch_local_irq_restore(unsigned long flags)  static inline bool arch_irqs_disabled_flags(unsigned long flags)  { +	if (MACH_IS_ATARI) { +		/* Ignore HSYNC = ipl 2 on Atari */ +		return (flags & ~(ALLOWINT | 0x200)) != 0; +	}  	return (flags & ~ALLOWINT) != 0;  } diff --git a/arch/m68k/include/asm/kdebug.h b/arch/m68k/include/asm/kdebug.h deleted file mode 100644 index 6ece1b03766..00000000000 --- a/arch/m68k/include/asm/kdebug.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/kdebug.h> diff --git a/arch/m68k/include/asm/kexec.h b/arch/m68k/include/asm/kexec.h new file mode 100644 index 00000000000..3df97abac14 --- /dev/null +++ b/arch/m68k/include/asm/kexec.h @@ -0,0 +1,29 @@ +#ifndef _ASM_M68K_KEXEC_H +#define _ASM_M68K_KEXEC_H + +#ifdef CONFIG_KEXEC + +/* Maximum physical address we can use pages from */ +#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) +/* Maximum address we can reach in physical address mode */ +#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL) +/* Maximum address we can use for the control code buffer */ +#define KEXEC_CONTROL_MEMORY_LIMIT (-1UL) + +#define KEXEC_CONTROL_PAGE_SIZE	4096 + +#define KEXEC_ARCH KEXEC_ARCH_68K + +#ifndef __ASSEMBLY__ + +static inline void crash_setup_regs(struct pt_regs *newregs, +				    struct pt_regs *oldregs) +{ +	/* Dummy implementation for now */ +} + +#endif /* __ASSEMBLY__ */ + +#endif /* CONFIG_KEXEC */ + +#endif /* _ASM_M68K_KEXEC_H */ diff --git a/arch/m68k/include/asm/kmap_types.h b/arch/m68k/include/asm/kmap_types.h deleted file mode 100644 index 3413cc1390e..00000000000 --- a/arch/m68k/include/asm/kmap_types.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_M68K_KMAP_TYPES_H -#define __ASM_M68K_KMAP_TYPES_H - -#include <asm-generic/kmap_types.h> - -#endif	/* __ASM_M68K_KMAP_TYPES_H */ diff --git a/arch/m68k/include/asm/local.h b/arch/m68k/include/asm/local.h deleted file mode 100644 index 6c259263e1f..00000000000 --- a/arch/m68k/include/asm/local.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_M68K_LOCAL_H -#define _ASM_M68K_LOCAL_H - -#include <asm-generic/local.h> - -#endif /* _ASM_M68K_LOCAL_H */ diff --git a/arch/m68k/include/asm/local64.h b/arch/m68k/include/asm/local64.h deleted file mode 100644 index 36c93b5cc23..00000000000 --- a/arch/m68k/include/asm/local64.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/local64.h> diff --git a/arch/m68k/include/asm/m5206sim.h b/arch/m68k/include/asm/m5206sim.h index 9c384e294af..4cf864f5ea7 100644 --- a/arch/m68k/include/asm/m5206sim.h +++ b/arch/m68k/include/asm/m5206sim.h @@ -12,90 +12,111 @@  #define	m5206sim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m5206)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		MCF_CLK + +#include <asm/m52xxacr.h>  /*   *	Define the 5206 SIM register set addresses.   */ -#define	MCFSIM_SIMR		0x03		/* SIM Config reg (r/w) */ -#define	MCFSIM_ICR1		0x14		/* Intr Ctrl reg 1 (r/w) */ -#define	MCFSIM_ICR2		0x15		/* Intr Ctrl reg 2 (r/w) */ -#define	MCFSIM_ICR3		0x16		/* Intr Ctrl reg 3 (r/w) */ -#define	MCFSIM_ICR4		0x17		/* Intr Ctrl reg 4 (r/w) */ -#define	MCFSIM_ICR5		0x18		/* Intr Ctrl reg 5 (r/w) */ -#define	MCFSIM_ICR6		0x19		/* Intr Ctrl reg 6 (r/w) */ -#define	MCFSIM_ICR7		0x1a		/* Intr Ctrl reg 7 (r/w) */ -#define	MCFSIM_ICR8		0x1b		/* Intr Ctrl reg 8 (r/w) */ -#define	MCFSIM_ICR9		0x1c		/* Intr Ctrl reg 9 (r/w) */ -#define	MCFSIM_ICR10		0x1d		/* Intr Ctrl reg 10 (r/w) */ -#define	MCFSIM_ICR11		0x1e		/* Intr Ctrl reg 11 (r/w) */ -#define	MCFSIM_ICR12		0x1f		/* Intr Ctrl reg 12 (r/w) */ -#define	MCFSIM_ICR13		0x20		/* Intr Ctrl reg 13 (r/w) */ +#define	MCFSIM_SIMR		(MCF_MBAR + 0x03)	/* SIM Config reg */ +#define	MCFSIM_ICR1		(MCF_MBAR + 0x14)	/* Intr Ctrl reg 1 */ +#define	MCFSIM_ICR2		(MCF_MBAR + 0x15)	/* Intr Ctrl reg 2 */ +#define	MCFSIM_ICR3		(MCF_MBAR + 0x16)	/* Intr Ctrl reg 3 */ +#define	MCFSIM_ICR4		(MCF_MBAR + 0x17)	/* Intr Ctrl reg 4 */ +#define	MCFSIM_ICR5		(MCF_MBAR + 0x18)	/* Intr Ctrl reg 5 */ +#define	MCFSIM_ICR6		(MCF_MBAR + 0x19)	/* Intr Ctrl reg 6 */ +#define	MCFSIM_ICR7		(MCF_MBAR + 0x1a)	/* Intr Ctrl reg 7 */ +#define	MCFSIM_ICR8		(MCF_MBAR + 0x1b)	/* Intr Ctrl reg 8 */ +#define	MCFSIM_ICR9		(MCF_MBAR + 0x1c)	/* Intr Ctrl reg 9 */ +#define	MCFSIM_ICR10		(MCF_MBAR + 0x1d)	/* Intr Ctrl reg 10 */ +#define	MCFSIM_ICR11		(MCF_MBAR + 0x1e)	/* Intr Ctrl reg 11 */ +#define	MCFSIM_ICR12		(MCF_MBAR + 0x1f)	/* Intr Ctrl reg 12 */ +#define	MCFSIM_ICR13		(MCF_MBAR + 0x20)	/* Intr Ctrl reg 13 */  #ifdef CONFIG_M5206e -#define	MCFSIM_ICR14		0x21		/* Intr Ctrl reg 14 (r/w) */ -#define	MCFSIM_ICR15		0x22		/* Intr Ctrl reg 15 (r/w) */ +#define	MCFSIM_ICR14		(MCF_MBAR + 0x21)	/* Intr Ctrl reg 14 */ +#define	MCFSIM_ICR15		(MCF_MBAR + 0x22)	/* Intr Ctrl reg 15 */  #endif -#define MCFSIM_IMR		0x36		/* Interrupt Mask reg (r/w) */ -#define MCFSIM_IPR		0x3a		/* Interrupt Pend reg (r/w) */ - -#define	MCFSIM_RSR		0x40		/* Reset Status reg (r/w) */ -#define	MCFSIM_SYPCR		0x41		/* System Protection reg (r/w)*/ - -#define	MCFSIM_SWIVR		0x42		/* SW Watchdog intr reg (r/w) */ -#define	MCFSIM_SWSR		0x43		/* SW Watchdog service (r/w) */ - -#define	MCFSIM_DCRR		0x46		/* DRAM Refresh reg (r/w) */ -#define	MCFSIM_DCTR		0x4a		/* DRAM Timing reg (r/w) */ -#define	MCFSIM_DAR0		0x4c		/* DRAM 0 Address reg(r/w) */ -#define	MCFSIM_DMR0		0x50		/* DRAM 0 Mask reg (r/w) */ -#define	MCFSIM_DCR0		0x57		/* DRAM 0 Control reg (r/w) */ -#define	MCFSIM_DAR1		0x58		/* DRAM 1 Address reg (r/w) */ -#define	MCFSIM_DMR1		0x5c		/* DRAM 1 Mask reg (r/w) */ -#define	MCFSIM_DCR1		0x63		/* DRAM 1 Control reg (r/w) */ - -#define	MCFSIM_CSAR0		0x64		/* CS 0 Address 0 reg (r/w) */ -#define	MCFSIM_CSMR0		0x68		/* CS 0 Mask 0 reg (r/w) */ -#define	MCFSIM_CSCR0		0x6e		/* CS 0 Control reg (r/w) */ -#define	MCFSIM_CSAR1		0x70		/* CS 1 Address reg (r/w) */ -#define	MCFSIM_CSMR1		0x74		/* CS 1 Mask reg (r/w) */ -#define	MCFSIM_CSCR1		0x7a		/* CS 1 Control reg (r/w) */ -#define	MCFSIM_CSAR2		0x7c		/* CS 2 Address reg (r/w) */ -#define	MCFSIM_CSMR2		0x80		/* CS 2 Mask reg (r/w) */ -#define	MCFSIM_CSCR2		0x86		/* CS 2 Control reg (r/w) */ -#define	MCFSIM_CSAR3		0x88		/* CS 3 Address reg (r/w) */ -#define	MCFSIM_CSMR3		0x8c		/* CS 3 Mask reg (r/w) */ -#define	MCFSIM_CSCR3		0x92		/* CS 3 Control reg (r/w) */ -#define	MCFSIM_CSAR4		0x94		/* CS 4 Address reg (r/w) */ -#define	MCFSIM_CSMR4		0x98		/* CS 4 Mask reg (r/w) */ -#define	MCFSIM_CSCR4		0x9e		/* CS 4 Control reg (r/w) */ -#define	MCFSIM_CSAR5		0xa0		/* CS 5 Address reg (r/w) */ -#define	MCFSIM_CSMR5		0xa4		/* CS 5 Mask reg (r/w) */ -#define	MCFSIM_CSCR5		0xaa		/* CS 5 Control reg (r/w) */ -#define	MCFSIM_CSAR6		0xac		/* CS 6 Address reg (r/w) */ -#define	MCFSIM_CSMR6		0xb0		/* CS 6 Mask reg (r/w) */ -#define	MCFSIM_CSCR6		0xb6		/* CS 6 Control reg (r/w) */ -#define	MCFSIM_CSAR7		0xb8		/* CS 7 Address reg (r/w) */ -#define	MCFSIM_CSMR7		0xbc		/* CS 7 Mask reg (r/w) */ -#define	MCFSIM_CSCR7		0xc2		/* CS 7 Control reg (r/w) */ -#define	MCFSIM_DMCR		0xc6		/* Default control */ +#define	MCFSIM_IMR		(MCF_MBAR + 0x36)	/* Interrupt Mask */ +#define	MCFSIM_IPR		(MCF_MBAR + 0x3a)	/* Interrupt Pending */ + +#define	MCFSIM_RSR		(MCF_MBAR + 0x40)	/* Reset Status */ +#define	MCFSIM_SYPCR		(MCF_MBAR + 0x41)	/* System Protection */ + +#define	MCFSIM_SWIVR		(MCF_MBAR + 0x42)	/* SW Watchdog intr */ +#define	MCFSIM_SWSR		(MCF_MBAR + 0x43)	/* SW Watchdog srv */ + +#define	MCFSIM_DCRR		(MCF_MBAR + 0x46) /* DRAM Refresh reg (r/w) */ +#define	MCFSIM_DCTR		(MCF_MBAR + 0x4a) /* DRAM Timing reg (r/w) */ +#define	MCFSIM_DAR0		(MCF_MBAR + 0x4c) /* DRAM 0 Address reg(r/w) */ +#define	MCFSIM_DMR0		(MCF_MBAR + 0x50) /* DRAM 0 Mask reg (r/w) */ +#define	MCFSIM_DCR0		(MCF_MBAR + 0x57) /* DRAM 0 Control reg (r/w) */ +#define	MCFSIM_DAR1		(MCF_MBAR + 0x58) /* DRAM 1 Address reg (r/w) */ +#define	MCFSIM_DMR1		(MCF_MBAR + 0x5c) /* DRAM 1 Mask reg (r/w) */ +#define	MCFSIM_DCR1		(MCF_MBAR + 0x63) /* DRAM 1 Control reg (r/w) */ + +#define	MCFSIM_CSAR0		(MCF_MBAR + 0x64)	/* CS 0 Address reg */ +#define	MCFSIM_CSMR0		(MCF_MBAR + 0x68)	/* CS 0 Mask reg */ +#define	MCFSIM_CSCR0		(MCF_MBAR + 0x6e)	/* CS 0 Control reg */ +#define	MCFSIM_CSAR1		(MCF_MBAR + 0x70)	/* CS 1 Address reg */ +#define	MCFSIM_CSMR1		(MCF_MBAR + 0x74)	/* CS 1 Mask reg */ +#define	MCFSIM_CSCR1		(MCF_MBAR + 0x7a)	/* CS 1 Control reg */ +#define	MCFSIM_CSAR2		(MCF_MBAR + 0x7c)	/* CS 2 Address reg */ +#define	MCFSIM_CSMR2		(MCF_MBAR + 0x80)	/* CS 2 Mask reg */ +#define	MCFSIM_CSCR2		(MCF_MBAR + 0x86)	/* CS 2 Control reg */ +#define	MCFSIM_CSAR3		(MCF_MBAR + 0x88)	/* CS 3 Address reg */ +#define	MCFSIM_CSMR3		(MCF_MBAR + 0x8c)	/* CS 3 Mask reg */ +#define	MCFSIM_CSCR3		(MCF_MBAR + 0x92)	/* CS 3 Control reg */ +#define	MCFSIM_CSAR4		(MCF_MBAR + 0x94)	/* CS 4 Address reg */ +#define	MCFSIM_CSMR4		(MCF_MBAR + 0x98)	/* CS 4 Mask reg */ +#define	MCFSIM_CSCR4		(MCF_MBAR + 0x9e)	/* CS 4 Control reg */ +#define	MCFSIM_CSAR5		(MCF_MBAR + 0xa0)	/* CS 5 Address reg */ +#define	MCFSIM_CSMR5		(MCF_MBAR + 0xa4)	/* CS 5 Mask reg */ +#define	MCFSIM_CSCR5		(MCF_MBAR + 0xaa)	/* CS 5 Control reg */ +#define	MCFSIM_CSAR6		(MCF_MBAR + 0xac)	/* CS 6 Address reg */ +#define	MCFSIM_CSMR6		(MCF_MBAR + 0xb0)	/* CS 6 Mask reg */ +#define	MCFSIM_CSCR6		(MCF_MBAR + 0xb6)	/* CS 6 Control reg */ +#define	MCFSIM_CSAR7		(MCF_MBAR + 0xb8)	/* CS 7 Address reg */ +#define	MCFSIM_CSMR7		(MCF_MBAR + 0xbc)	/* CS 7 Mask reg */ +#define	MCFSIM_CSCR7		(MCF_MBAR + 0xc2)	/* CS 7 Control reg */ +#define	MCFSIM_DMCR		(MCF_MBAR + 0xc6)	/* Default control */  #ifdef CONFIG_M5206e -#define	MCFSIM_PAR		0xca		/* Pin Assignment reg (r/w) */ +#define	MCFSIM_PAR		(MCF_MBAR + 0xca)	/* Pin Assignment */  #else -#define	MCFSIM_PAR		0xcb		/* Pin Assignment reg (r/w) */ +#define	MCFSIM_PAR		(MCF_MBAR + 0xcb)	/* Pin Assignment */  #endif +#define	MCFTIMER_BASE1		(MCF_MBAR + 0x100)	/* Base of TIMER1 */ +#define	MCFTIMER_BASE2		(MCF_MBAR + 0x120)	/* Base of TIMER2 */ +  #define	MCFSIM_PADDR		(MCF_MBAR + 0x1c5)	/* Parallel Direction (r/w) */  #define	MCFSIM_PADAT		(MCF_MBAR + 0x1c9)	/* Parallel Port Value (r/w) */ +#define	MCFDMA_BASE0		(MCF_MBAR + 0x200)	/* Base address DMA 0 */ +#define	MCFDMA_BASE1		(MCF_MBAR + 0x240)	/* Base address DMA 1 */ + +#if defined(CONFIG_NETtel) +#define	MCFUART_BASE0		(MCF_MBAR + 0x180)	/* Base address UART0 */ +#define	MCFUART_BASE1		(MCF_MBAR + 0x140)	/* Base address UART1 */ +#else +#define	MCFUART_BASE0		(MCF_MBAR + 0x140)	/* Base address UART0 */ +#define	MCFUART_BASE1		(MCF_MBAR + 0x180)	/* Base address UART1 */ +#endif +  /*   *	Define system peripheral IRQ usage.   */  #define	MCF_IRQ_TIMER		30		/* Timer0, Level 6 */  #define	MCF_IRQ_PROFILER	31		/* Timer1, Level 7 */ +#define	MCF_IRQ_UART0		73		/* UART0 */ +#define	MCF_IRQ_UART1		74		/* UART1 */  /* - * Generic GPIO + *	Generic GPIO   */  #define MCFGPIO_PIN_MAX		8  #define MCFGPIO_IRQ_VECBASE	-1 diff --git a/arch/m68k/include/asm/m520xsim.h b/arch/m68k/include/asm/m520xsim.h index db824a4b136..db3f8ee4a6c 100644 --- a/arch/m68k/include/asm/m520xsim.h +++ b/arch/m68k/include/asm/m520xsim.h @@ -11,10 +11,16 @@  #define m520xsim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m520x)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m52xxacr.h> +  /*   *  Define the 520x SIM register set addresses.   */ -#define MCFICM_INTC0        0x48000     /* Base for Interrupt Ctrl 0 */ +#define MCFICM_INTC0        0xFC048000  /* Base for Interrupt Ctrl 0 */  #define MCFINTC_IPRH        0x00        /* Interrupt pending 32-63 */  #define MCFINTC_IPRL        0x04        /* Interrupt pending 1-31 */  #define MCFINTC_IMRH        0x08        /* Interrupt mask 32-63 */ @@ -30,33 +36,56 @@   *  address to the SIMR and CIMR registers (not offsets into IPSBAR).   *  The 520x family only has a single INTC unit.   */ -#define MCFINTC0_SIMR       (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_SIMR) -#define MCFINTC0_CIMR       (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_CIMR) -#define	MCFINTC0_ICR0       (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0) +#define MCFINTC0_SIMR       (MCFICM_INTC0 + MCFINTC_SIMR) +#define MCFINTC0_CIMR       (MCFICM_INTC0 + MCFINTC_CIMR) +#define	MCFINTC0_ICR0       (MCFICM_INTC0 + MCFINTC_ICR0)  #define MCFINTC1_SIMR       (0)  #define MCFINTC1_CIMR       (0)  #define	MCFINTC1_ICR0       (0) +#define MCFINTC2_SIMR       (0) +#define MCFINTC2_CIMR       (0) +#define MCFINTC2_ICR0       (0)  #define MCFINT_VECBASE      64  #define MCFINT_UART0        26          /* Interrupt number for UART0 */  #define MCFINT_UART1        27          /* Interrupt number for UART1 */  #define MCFINT_UART2        28          /* Interrupt number for UART2 */  #define MCFINT_QSPI         31          /* Interrupt number for QSPI */ +#define MCFINT_FECRX0	    36		/* Interrupt number for FEC RX */ +#define MCFINT_FECTX0	    40		/* Interrupt number for FEC RX */ +#define MCFINT_FECENTC0	    42		/* Interrupt number for FEC RX */  #define MCFINT_PIT1         4           /* Interrupt number for PIT1 (PIT0 in processor) */ +#define MCF_IRQ_UART0	    (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1	    (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2	    (MCFINT_VECBASE + MCFINT_UART2) + +#define MCF_IRQ_FECRX0	    (MCFINT_VECBASE + MCFINT_FECRX0) +#define MCF_IRQ_FECTX0	    (MCFINT_VECBASE + MCFINT_FECTX0) +#define MCF_IRQ_FECENTC0    (MCFINT_VECBASE + MCFINT_FECENTC0) + +#define	MCF_IRQ_QSPI	    (MCFINT_VECBASE + MCFINT_QSPI) +#define MCF_IRQ_PIT1        (MCFINT_VECBASE + MCFINT_PIT1) +  /*   *  SDRAM configuration registers.   */ -#define MCFSIM_SDMR         0x000a8000	/* SDRAM Mode/Extended Mode Register */ -#define MCFSIM_SDCR         0x000a8004	/* SDRAM Control Register */ -#define MCFSIM_SDCFG1       0x000a8008	/* SDRAM Configuration Register 1 */ -#define MCFSIM_SDCFG2       0x000a800c	/* SDRAM Configuration Register 2 */ -#define MCFSIM_SDCS0        0x000a8110	/* SDRAM Chip Select 0 Configuration */ -#define MCFSIM_SDCS1        0x000a8114	/* SDRAM Chip Select 1 Configuration */ +#define MCFSIM_SDMR         0xFC0a8000	/* SDRAM Mode/Extended Mode Register */ +#define MCFSIM_SDCR         0xFC0a8004	/* SDRAM Control Register */ +#define MCFSIM_SDCFG1       0xFC0a8008	/* SDRAM Configuration Register 1 */ +#define MCFSIM_SDCFG2       0xFC0a800c	/* SDRAM Configuration Register 2 */ +#define MCFSIM_SDCS0        0xFC0a8110	/* SDRAM Chip Select 0 Configuration */ +#define MCFSIM_SDCS1        0xFC0a8114	/* SDRAM Chip Select 1 Configuration */ +/* + * EPORT and GPIO registers. + */ +#define MCFEPORT_EPPAR			0xFC088000  #define MCFEPORT_EPDDR			0xFC088002 +#define MCFEPORT_EPIER			0xFC088003  #define MCFEPORT_EPDR			0xFC088004  #define MCFEPORT_EPPDR			0xFC088005 +#define MCFEPORT_EPFR			0xFC088006  #define MCFGPIO_PODR_BUSCTL		0xFC0A4000  #define MCFGPIO_PODR_BE			0xFC0A4001 @@ -78,15 +107,13 @@  #define MCFGPIO_PDDR_FECH		0xFC0A4013  #define MCFGPIO_PDDR_FECL		0xFC0A4014 -#define MCFGPIO_PPDSDR_BUSCTL		0xFC0A401A -#define MCFGPIO_PPDSDR_BE		0xFC0A401B -#define MCFGPIO_PPDSDR_CS		0xFC0A401C -#define MCFGPIO_PPDSDR_FECI2C		0xFC0A401D -#define MCFGPIO_PPDSDR_QSPI		0xFC0A401E -#define MCFGPIO_PPDSDR_TIMER		0xFC0A401F -#define MCFGPIO_PPDSDR_UART		0xFC0A4021 -#define MCFGPIO_PPDSDR_FECH		0xFC0A4021 -#define MCFGPIO_PPDSDR_FECL		0xFC0A4022 +#define MCFGPIO_PPDSDR_CS		0xFC0A401A +#define MCFGPIO_PPDSDR_FECI2C		0xFC0A401B +#define MCFGPIO_PPDSDR_QSPI		0xFC0A401C +#define MCFGPIO_PPDSDR_TIMER		0xFC0A401D +#define MCFGPIO_PPDSDR_UART		0xFC0A401E +#define MCFGPIO_PPDSDR_FECH		0xFC0A401F +#define MCFGPIO_PPDSDR_FECL		0xFC0A4020  #define MCFGPIO_PCLRR_BUSCTL		0xFC0A4024  #define MCFGPIO_PCLRR_BE		0xFC0A4025 @@ -97,24 +124,24 @@  #define MCFGPIO_PCLRR_UART		0xFC0A402A  #define MCFGPIO_PCLRR_FECH		0xFC0A402B  #define MCFGPIO_PCLRR_FECL		0xFC0A402C +  /*   * Generic GPIO support   */ -#define MCFGPIO_PODR			MCFGPIO_PODR_BUSCTL -#define MCFGPIO_PDDR			MCFGPIO_PDDR_BUSCTL -#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_BUSCTL -#define MCFGPIO_SETR			MCFGPIO_PPDSDR_BUSCTL -#define MCFGPIO_CLRR			MCFGPIO_PCLRR_BUSCTL +#define MCFGPIO_PODR			MCFGPIO_PODR_CS +#define MCFGPIO_PDDR			MCFGPIO_PDDR_CS +#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_CS +#define MCFGPIO_SETR			MCFGPIO_PPDSDR_CS +#define MCFGPIO_CLRR			MCFGPIO_PCLRR_CS  #define MCFGPIO_PIN_MAX			80  #define MCFGPIO_IRQ_MAX			8  #define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE -/****************************************************************************/ -#define MCF_GPIO_PAR_UART                   (0xA4036) -#define MCF_GPIO_PAR_FECI2C                 (0xA4033) -#define MCF_GPIO_PAR_QSPI                   (0xA4034) -#define MCF_GPIO_PAR_FEC                    (0xA4038) +#define MCF_GPIO_PAR_UART		0xFC0A4036 +#define MCF_GPIO_PAR_FECI2C		0xFC0A4033 +#define MCF_GPIO_PAR_QSPI		0xFC0A4034 +#define MCF_GPIO_PAR_FEC		0xFC0A4038  #define MCF_GPIO_PAR_UART_PAR_URXD0         (0x0001)  #define MCF_GPIO_PAR_UART_PAR_UTXD0         (0x0002) @@ -126,7 +153,36 @@  #define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2   (0x04)  /* - *  Reset Controll Unit. + *  PIT timer module. + */ +#define	MCFPIT_BASE1		0xFC080000	/* Base address of TIMER1 */ +#define	MCFPIT_BASE2		0xFC084000	/* Base address of TIMER2 */ + +/* + *  UART module. + */ +#define MCFUART_BASE0		0xFC060000	/* Base address of UART0 */ +#define MCFUART_BASE1		0xFC064000	/* Base address of UART1 */ +#define MCFUART_BASE2		0xFC068000	/* Base address of UART2 */ + +/* + *  FEC module. + */ +#define	MCFFEC_BASE0		0xFC030000	/* Base of FEC ethernet */ +#define	MCFFEC_SIZE0		0x800		/* Register set size */ + +/* + *  QSPI module. + */ +#define	MCFQSPI_BASE		0xFC05C000	/* Base of QSPI module */ +#define	MCFQSPI_SIZE		0x40		/* Register set size */ + +#define	MCFQSPI_CS0		46 +#define	MCFQSPI_CS1		47 +#define	MCFQSPI_CS2		27 + +/* + *  Reset Control Unit.   */  #define	MCF_RCR			0xFC0A0000  #define	MCF_RSR			0xFC0A0001 @@ -134,5 +190,15 @@  #define	MCF_RCR_SWRESET		0x80		/* Software reset bit */  #define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ +/* + *  Power Management. + */ +#define MCFPM_WCR		0xfc040013 +#define MCFPM_PPMSR0		0xfc04002c +#define MCFPM_PPMCR0		0xfc04002d +#define MCFPM_PPMHR0		0xfc040030 +#define MCFPM_PPMLR0		0xfc040034 +#define MCFPM_LPCR		0xfc0a0007 +  /****************************************************************************/  #endif  /* m520xsim_h */ diff --git a/arch/m68k/include/asm/m523xsim.h b/arch/m68k/include/asm/m523xsim.h index e8d06b24a48..5e06b4eb57f 100644 --- a/arch/m68k/include/asm/m523xsim.h +++ b/arch/m68k/include/asm/m523xsim.h @@ -11,12 +11,18 @@  #define	m523xsim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m523x)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m52xxacr.h>  /*   *	Define the 523x SIM register set addresses.   */ -#define	MCFICM_INTC0		0x0c00		/* Base for Interrupt Ctrl 0 */ -#define	MCFICM_INTC1		0x0d00		/* Base for Interrupt Ctrl 0 */ +#define	MCFICM_INTC0		(MCF_IPSBAR + 0x0c00)	/* Base for Interrupt Ctrl 0 */ +#define	MCFICM_INTC1		(MCF_IPSBAR + 0x0d00)	/* Base for Interrupt Ctrl 0 */ +  #define	MCFINTC_IPRH		0x00		/* Interrupt pending 32-63 */  #define	MCFINTC_IPRL		0x04		/* Interrupt pending 1-31 */  #define	MCFINTC_IMRH		0x08		/* Interrupt mask 32-63 */ @@ -29,27 +35,70 @@  #define	MCFINT_VECBASE		64		/* Vector base number */  #define	MCFINT_UART0		13		/* Interrupt number for UART0 */ -#define	MCFINT_PIT1		36		/* Interrupt number for PIT1 */ +#define	MCFINT_UART1		14		/* Interrupt number for UART1 */ +#define	MCFINT_UART2		15		/* Interrupt number for UART2 */  #define MCFINT_QSPI		18		/* Interrupt number for QSPI */ +#define	MCFINT_FECRX0		23		/* Interrupt number for FEC */ +#define	MCFINT_FECTX0		27		/* Interrupt number for FEC */ +#define	MCFINT_FECENTC0		29		/* Interrupt number for FEC */ +#define	MCFINT_PIT1		36		/* Interrupt number for PIT1 */ + +#define	MCF_IRQ_UART0	        (MCFINT_VECBASE + MCFINT_UART0) +#define	MCF_IRQ_UART1	        (MCFINT_VECBASE + MCFINT_UART1) +#define	MCF_IRQ_UART2	        (MCFINT_VECBASE + MCFINT_UART2) + +#define	MCF_IRQ_FECRX0		(MCFINT_VECBASE + MCFINT_FECRX0) +#define	MCF_IRQ_FECTX0		(MCFINT_VECBASE + MCFINT_FECTX0) +#define	MCF_IRQ_FECENTC0	(MCFINT_VECBASE + MCFINT_FECENTC0) + +#define	MCF_IRQ_QSPI		(MCFINT_VECBASE + MCFINT_QSPI) +#define MCF_IRQ_PIT1		(MCFINT_VECBASE + MCFINT_PIT1)  /*   *	SDRAM configuration registers.   */ -#define	MCFSIM_DCR		0x44		/* SDRAM control */ -#define	MCFSIM_DACR0		0x48		/* SDRAM base address 0 */ -#define	MCFSIM_DMR0		0x4c		/* SDRAM address mask 0 */ -#define	MCFSIM_DACR1		0x50		/* SDRAM base address 1 */ -#define	MCFSIM_DMR1		0x54		/* SDRAM address mask 1 */ +#define	MCFSIM_DCR		(MCF_IPSBAR + 0x44)	/* Control */ +#define	MCFSIM_DACR0		(MCF_IPSBAR + 0x48)	/* Base address 0 */ +#define	MCFSIM_DMR0		(MCF_IPSBAR + 0x4c)	/* Address mask 0 */ +#define	MCFSIM_DACR1		(MCF_IPSBAR + 0x50)	/* Base address 1 */ +#define	MCFSIM_DMR1		(MCF_IPSBAR + 0x54)	/* Address mask 1 */  /* - *  Reset Controll Unit (relative to IPSBAR). + *  Reset Control Unit (relative to IPSBAR).   */ -#define	MCF_RCR			0x110000 -#define	MCF_RSR			0x110001 +#define	MCF_RCR			(MCF_IPSBAR + 0x110000) +#define	MCF_RSR			(MCF_IPSBAR + 0x110001)  #define	MCF_RCR_SWRESET		0x80		/* Software reset bit */  #define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ +/* + *  UART module. + */ +#define MCFUART_BASE0		(MCF_IPSBAR + 0x200) +#define MCFUART_BASE1		(MCF_IPSBAR + 0x240) +#define MCFUART_BASE2		(MCF_IPSBAR + 0x280) + +/* + *  FEC ethernet module. + */ +#define	MCFFEC_BASE0		(MCF_IPSBAR + 0x1000) +#define	MCFFEC_SIZE0		0x800 + +/* + *  QSPI module. + */ +#define	MCFQSPI_BASE		(MCF_IPSBAR + 0x340) +#define	MCFQSPI_SIZE		0x40 + +#define	MCFQSPI_CS0		91 +#define	MCFQSPI_CS1		92 +#define	MCFQSPI_CS2		103 +#define	MCFQSPI_CS3		99 + +/* + *  GPIO module. + */  #define MCFGPIO_PODR_ADDR	(MCF_IPSBAR + 0x100000)  #define MCFGPIO_PODR_DATAH	(MCF_IPSBAR + 0x100001)  #define MCFGPIO_PODR_DATAL	(MCF_IPSBAR + 0x100002) @@ -107,30 +156,57 @@  #define MCFGPIO_PCLRR_ETPU	(MCF_IPSBAR + 0x10003C)  /* - * EPort + * PIT timer base addresses.   */ +#define	MCFPIT_BASE1		(MCF_IPSBAR + 0x150000) +#define	MCFPIT_BASE2		(MCF_IPSBAR + 0x160000) +#define	MCFPIT_BASE3		(MCF_IPSBAR + 0x170000) +#define	MCFPIT_BASE4		(MCF_IPSBAR + 0x180000) +/* + * EPort + */ +#define MCFEPORT_EPPAR		(MCF_IPSBAR + 0x130000)  #define MCFEPORT_EPDDR		(MCF_IPSBAR + 0x130002) +#define MCFEPORT_EPIER		(MCF_IPSBAR + 0x130003)  #define MCFEPORT_EPDR		(MCF_IPSBAR + 0x130004)  #define MCFEPORT_EPPDR		(MCF_IPSBAR + 0x130005) +#define MCFEPORT_EPFR		(MCF_IPSBAR + 0x130006)  /*   * Generic GPIO support   */ -#define MCFGPIO_PODR			MCFGPIO_PODR_ADDR -#define MCFGPIO_PDDR			MCFGPIO_PDDR_ADDR -#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_ADDR -#define MCFGPIO_SETR			MCFGPIO_PPDSDR_ADDR -#define MCFGPIO_CLRR			MCFGPIO_PCLRR_ADDR +#define MCFGPIO_PODR		MCFGPIO_PODR_ADDR +#define MCFGPIO_PDDR		MCFGPIO_PDDR_ADDR +#define MCFGPIO_PPDR		MCFGPIO_PPDSDR_ADDR +#define MCFGPIO_SETR		MCFGPIO_PPDSDR_ADDR +#define MCFGPIO_CLRR		MCFGPIO_PCLRR_ADDR -#define MCFGPIO_PIN_MAX			107 -#define MCFGPIO_IRQ_MAX			8 -#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE +#define MCFGPIO_PIN_MAX		107 +#define MCFGPIO_IRQ_MAX		8 +#define MCFGPIO_IRQ_VECBASE	MCFINT_VECBASE  /*   * Pin Assignment  */ +#define	MCFGPIO_PAR_AD		(MCF_IPSBAR + 0x100040) +#define	MCFGPIO_PAR_BUSCTL	(MCF_IPSBAR + 0x100042) +#define	MCFGPIO_PAR_BS		(MCF_IPSBAR + 0x100044) +#define	MCFGPIO_PAR_CS		(MCF_IPSBAR + 0x100045) +#define	MCFGPIO_PAR_SDRAM	(MCF_IPSBAR + 0x100046) +#define	MCFGPIO_PAR_FECI2C	(MCF_IPSBAR + 0x100047) +#define	MCFGPIO_PAR_UART	(MCF_IPSBAR + 0x100048)  #define	MCFGPIO_PAR_QSPI	(MCF_IPSBAR + 0x10004A)  #define	MCFGPIO_PAR_TIMER	(MCF_IPSBAR + 0x10004C) +#define	MCFGPIO_PAR_ETPU	(MCF_IPSBAR + 0x10004E) + +/* + * DMA unit base addresses. + */ +#define	MCFDMA_BASE0		(MCF_IPSBAR + 0x100) +#define	MCFDMA_BASE1		(MCF_IPSBAR + 0x140) +#define	MCFDMA_BASE2		(MCF_IPSBAR + 0x180) +#define	MCFDMA_BASE3		(MCF_IPSBAR + 0x1C0) +  /****************************************************************************/  #endif	/* m523xsim_h */ diff --git a/arch/m68k/include/asm/m5249sim.h b/arch/m68k/include/asm/m5249sim.h deleted file mode 100644 index 79b7b402f3c..00000000000 --- a/arch/m68k/include/asm/m5249sim.h +++ /dev/null @@ -1,225 +0,0 @@ -/****************************************************************************/ - -/* - *	m5249sim.h -- ColdFire 5249 System Integration Module support. - * - *	(C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) - */ - -/****************************************************************************/ -#ifndef	m5249sim_h -#define	m5249sim_h -/****************************************************************************/ - -/* - *	Define the 5249 SIM register set addresses. - */ -#define	MCFSIM_RSR		0x00		/* Reset Status reg (r/w) */ -#define	MCFSIM_SYPCR		0x01		/* System Protection reg (r/w)*/ -#define	MCFSIM_SWIVR		0x02		/* SW Watchdog intr reg (r/w) */ -#define	MCFSIM_SWSR		0x03		/* SW Watchdog service (r/w) */ -#define	MCFSIM_PAR		0x04		/* Pin Assignment reg (r/w) */ -#define	MCFSIM_IRQPAR		0x06		/* Interrupt Assignment reg (r/w) */ -#define	MCFSIM_MPARK		0x0C		/* BUS Master Control Reg*/ -#define	MCFSIM_IPR		0x40		/* Interrupt Pend reg (r/w) */ -#define	MCFSIM_IMR		0x44		/* Interrupt Mask reg (r/w) */ -#define	MCFSIM_AVR		0x4b		/* Autovector Ctrl reg (r/w) */ -#define	MCFSIM_ICR0		0x4c		/* Intr Ctrl reg 0 (r/w) */ -#define	MCFSIM_ICR1		0x4d		/* Intr Ctrl reg 1 (r/w) */ -#define	MCFSIM_ICR2		0x4e		/* Intr Ctrl reg 2 (r/w) */ -#define	MCFSIM_ICR3		0x4f		/* Intr Ctrl reg 3 (r/w) */ -#define	MCFSIM_ICR4		0x50		/* Intr Ctrl reg 4 (r/w) */ -#define	MCFSIM_ICR5		0x51		/* Intr Ctrl reg 5 (r/w) */ -#define	MCFSIM_ICR6		0x52		/* Intr Ctrl reg 6 (r/w) */ -#define	MCFSIM_ICR7		0x53		/* Intr Ctrl reg 7 (r/w) */ -#define	MCFSIM_ICR8		0x54		/* Intr Ctrl reg 8 (r/w) */ -#define	MCFSIM_ICR9		0x55		/* Intr Ctrl reg 9 (r/w) */ -#define	MCFSIM_ICR10		0x56		/* Intr Ctrl reg 10 (r/w) */ -#define	MCFSIM_ICR11		0x57		/* Intr Ctrl reg 11 (r/w) */ - -#define MCFSIM_CSAR0		0x80		/* CS 0 Address 0 reg (r/w) */ -#define MCFSIM_CSMR0		0x84		/* CS 0 Mask 0 reg (r/w) */ -#define MCFSIM_CSCR0		0x8a		/* CS 0 Control reg (r/w) */ -#define MCFSIM_CSAR1		0x8c		/* CS 1 Address reg (r/w) */ -#define MCFSIM_CSMR1		0x90		/* CS 1 Mask reg (r/w) */ -#define MCFSIM_CSCR1		0x96		/* CS 1 Control reg (r/w) */ -#define MCFSIM_CSAR2		0x98		/* CS 2 Address reg (r/w) */ -#define MCFSIM_CSMR2		0x9c		/* CS 2 Mask reg (r/w) */ -#define MCFSIM_CSCR2		0xa2		/* CS 2 Control reg (r/w) */ -#define MCFSIM_CSAR3		0xa4		/* CS 3 Address reg (r/w) */ -#define MCFSIM_CSMR3		0xa8		/* CS 3 Mask reg (r/w) */ -#define MCFSIM_CSCR3		0xae		/* CS 3 Control reg (r/w) */ - -#define MCFSIM_DCR		0x100		/* DRAM Control reg (r/w) */ -#define MCFSIM_DACR0		0x108		/* DRAM 0 Addr and Ctrl (r/w) */ -#define MCFSIM_DMR0		0x10c		/* DRAM 0 Mask reg (r/w) */ -#define MCFSIM_DACR1		0x110		/* DRAM 1 Addr and Ctrl (r/w) */ -#define MCFSIM_DMR1		0x114		/* DRAM 1 Mask reg (r/w) */ - - -/* - *	Some symbol defines for the above... - */ -#define	MCFSIM_SWDICR		MCFSIM_ICR0	/* Watchdog timer ICR */ -#define	MCFSIM_TIMER1ICR	MCFSIM_ICR1	/* Timer 1 ICR */ -#define	MCFSIM_TIMER2ICR	MCFSIM_ICR2	/* Timer 2 ICR */ -#define	MCFSIM_UART1ICR		MCFSIM_ICR4	/* UART 1 ICR */ -#define	MCFSIM_UART2ICR		MCFSIM_ICR5	/* UART 2 ICR */ -#define	MCFSIM_DMA0ICR		MCFSIM_ICR6	/* DMA 0 ICR */ -#define	MCFSIM_DMA1ICR		MCFSIM_ICR7	/* DMA 1 ICR */ -#define	MCFSIM_DMA2ICR		MCFSIM_ICR8	/* DMA 2 ICR */ -#define	MCFSIM_DMA3ICR		MCFSIM_ICR9	/* DMA 3 ICR */ -#define	MCFSIM_QSPIICR		MCFSIM_ICR10	/* QSPI ICR */ - -/* - *	Define system peripheral IRQ usage. - */ -#define	MCF_IRQ_QSPI		28		/* QSPI, Level 4 */ -#define	MCF_IRQ_TIMER		30		/* Timer0, Level 6 */ -#define	MCF_IRQ_PROFILER	31		/* Timer1, Level 7 */ - -/* - *	General purpose IO registers (in MBAR2). - */ -#define	MCFSIM2_GPIOREAD	(MCF_MBAR2 + 0x000)	/* GPIO read values */ -#define	MCFSIM2_GPIOWRITE	(MCF_MBAR2 + 0x004)	/* GPIO write values */ -#define	MCFSIM2_GPIOENABLE	(MCF_MBAR2 + 0x008)	/* GPIO enabled */ -#define	MCFSIM2_GPIOFUNC	(MCF_MBAR2 + 0x00C)	/* GPIO function */ -#define	MCFSIM2_GPIO1READ	(MCF_MBAR2 + 0x0B0)	/* GPIO1 read values */ -#define	MCFSIM2_GPIO1WRITE	(MCF_MBAR2 + 0x0B4)	/* GPIO1 write values */ -#define	MCFSIM2_GPIO1ENABLE	(MCF_MBAR2 + 0x0B8)	/* GPIO1 enabled */ -#define	MCFSIM2_GPIO1FUNC	(MCF_MBAR2 + 0x0BC)	/* GPIO1 function */ - -#define	MCFSIM2_GPIOINTSTAT	0xc0		/* GPIO interrupt status */ -#define	MCFSIM2_GPIOINTCLEAR	0xc0		/* GPIO interrupt clear */ -#define	MCFSIM2_GPIOINTENABLE	0xc4		/* GPIO interrupt enable */ - -#define	MCFSIM2_INTLEVEL1	0x140		/* Interrupt level reg 1 */ -#define	MCFSIM2_INTLEVEL2	0x144		/* Interrupt level reg 2 */ -#define	MCFSIM2_INTLEVEL3	0x148		/* Interrupt level reg 3 */ -#define	MCFSIM2_INTLEVEL4	0x14c		/* Interrupt level reg 4 */ -#define	MCFSIM2_INTLEVEL5	0x150		/* Interrupt level reg 5 */ -#define	MCFSIM2_INTLEVEL6	0x154		/* Interrupt level reg 6 */ -#define	MCFSIM2_INTLEVEL7	0x158		/* Interrupt level reg 7 */ -#define	MCFSIM2_INTLEVEL8	0x15c		/* Interrupt level reg 8 */ - -#define	MCFSIM2_DMAROUTE	0x188		/* DMA routing */ - -#define	MCFSIM2_IDECONFIG1	0x18c		/* IDEconfig1 */ -#define	MCFSIM2_IDECONFIG2	0x190		/* IDEconfig2 */ - -/* - * Define the base interrupt for the second interrupt controller. - * We set it to 128, out of the way of the base interrupts, and plenty - * of room for its 64 interrupts. - */ -#define	MCFINTC2_VECBASE	128 - -#define	MCFINTC2_GPIOIRQ0	(MCFINTC2_VECBASE + 32) -#define	MCFINTC2_GPIOIRQ1	(MCFINTC2_VECBASE + 33) -#define	MCFINTC2_GPIOIRQ2	(MCFINTC2_VECBASE + 34) -#define	MCFINTC2_GPIOIRQ3	(MCFINTC2_VECBASE + 35) -#define	MCFINTC2_GPIOIRQ4	(MCFINTC2_VECBASE + 36) -#define	MCFINTC2_GPIOIRQ5	(MCFINTC2_VECBASE + 37) -#define	MCFINTC2_GPIOIRQ6	(MCFINTC2_VECBASE + 38) -#define	MCFINTC2_GPIOIRQ7	(MCFINTC2_VECBASE + 39) - -/* - * Generic GPIO support - */ -#define MCFGPIO_PIN_MAX		64 -#define MCFGPIO_IRQ_MAX		-1 -#define MCFGPIO_IRQ_VECBASE	-1 - -/****************************************************************************/ - -#ifdef __ASSEMBLER__ - -/* - *	The M5249C3 board needs a little help getting all its SIM devices - *	initialized at kernel start time. dBUG doesn't set much up, so - *	we need to do it manually. - */ -.macro m5249c3_setup -	/* -	 *	Set MBAR1 and MBAR2, just incase they are not set. -	 */ -	movel	#0x10000001,%a0 -	movec	%a0,%MBAR			/* map MBAR region */ -	subql	#1,%a0				/* get MBAR address in a0 */ - -	movel	#0x80000001,%a1 -	movec	%a1,#3086			/* map MBAR2 region */ -	subql	#1,%a1				/* get MBAR2 address in a1 */ - -	/* -	 *      Move secondary interrupts to their base (128). -	 */ -	moveb	#MCFINTC2_VECBASE,%d0 -	moveb	%d0,0x16b(%a1)			/* interrupt base register */ - -	/* -	 *      Work around broken CSMR0/DRAM vector problem. -	 */ -	movel	#0x001F0021,%d0			/* disable C/I bit */ -	movel	%d0,0x84(%a0)			/* set CSMR0 */ - -	/* -	 *	Disable the PLL firstly. (Who knows what state it is -	 *	in here!). -	 */ -	movel	0x180(%a1),%d0			/* get current PLL value */ -	andl	#0xfffffffe,%d0			/* PLL bypass first */ -	movel	%d0,0x180(%a1)			/* set PLL register */ -	nop - -#if CONFIG_CLOCK_FREQ == 140000000 -	/* -	 *	Set initial clock frequency. This assumes M5249C3 board -	 *	is fitted with 11.2896MHz crystal. It will program the -	 *	PLL for 140MHz. Lets go fast :-) -	 */ -	movel	#0x125a40f0,%d0			/* set for 140MHz */ -	movel	%d0,0x180(%a1)			/* set PLL register */ -	orl	#0x1,%d0 -	movel	%d0,0x180(%a1)			/* set PLL register */ -#endif - -	/* -	 *	Setup CS1 for ethernet controller. -	 *	(Setup as per M5249C3 doco). -	 */ -	movel  #0xe0000000,%d0			/* CS1 mapped at 0xe0000000 */ -	movel  %d0,0x8c(%a0) -	movel  #0x001f0021,%d0			/* CS1 size of 1Mb */ -	movel  %d0,0x90(%a0) -	movew  #0x0080,%d0			/* CS1 = 16bit port, AA */ -	movew  %d0,0x96(%a0) - -	/* -	 *	Setup CS2 for IDE interface. -	 */ -	movel	#0x50000000,%d0			/* CS2 mapped at 0x50000000 */ -	movel	%d0,0x98(%a0) -	movel	#0x001f0001,%d0			/* CS2 size of 1MB */ -	movel	%d0,0x9c(%a0) -	movew	#0x0080,%d0			/* CS2 = 16bit, TA */ -	movew	%d0,0xa2(%a0) - -	movel	#0x00107000,%d0			/* IDEconfig1 */ -	movel	%d0,0x18c(%a1) -	movel	#0x000c0400,%d0			/* IDEconfig2 */ -	movel	%d0,0x190(%a1) - -	movel	#0x00080000,%d0			/* GPIO19, IDE reset bit */ -	orl	%d0,0xc(%a1)			/* function GPIO19 */ -	orl	%d0,0x8(%a1)			/* enable GPIO19 as output */ -        orl	%d0,0x4(%a1)			/* de-assert IDE reset */ -.endm - -#define	PLATFORM_SETUP	m5249c3_setup - -#endif /* __ASSEMBLER__ */ - -/****************************************************************************/ -#endif	/* m5249sim_h */ diff --git a/arch/m68k/include/asm/m525xsim.h b/arch/m68k/include/asm/m525xsim.h new file mode 100644 index 00000000000..f186459072e --- /dev/null +++ b/arch/m68k/include/asm/m525xsim.h @@ -0,0 +1,308 @@ +/****************************************************************************/ + +/* + *	m525xsim.h -- ColdFire 525x System Integration Module support. + * + *	(C) Copyright 2012, Steven king <sfking@fdwdc.com> + *	(C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) + */ + +/****************************************************************************/ +#ifndef	m525xsim_h +#define m525xsim_h +/****************************************************************************/ + +/* + *	This header supports ColdFire 5249, 5251 and 5253. There are a few + *	little differences between them, but most of the peripheral support + *	can be used by all of them. + */ +#define CPU_NAME		"COLDFIRE(m525x)" +#define CPU_INSTR_PER_JIFFY	3 +#define MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m52xxacr.h> + +/* + *	The 525x has a second MBAR region, define its address. + */ +#define MCF_MBAR2		0x80000000 + +/* + *	Define the 525x SIM register set addresses. + */ +#define MCFSIM_RSR		(MCF_MBAR + 0x00)	/* Reset Status */ +#define MCFSIM_SYPCR		(MCF_MBAR + 0x01)	/* System Protection */ +#define MCFSIM_SWIVR		(MCF_MBAR + 0x02)	/* SW Watchdog intr */ +#define MCFSIM_SWSR		(MCF_MBAR + 0x03)	/* SW Watchdog srv */ +#define MCFSIM_MPARK		(MCF_MBAR + 0x0C)	/* BUS Master Ctrl */ +#define MCFSIM_IPR		(MCF_MBAR + 0x40)	/* Interrupt Pending */ +#define MCFSIM_IMR		(MCF_MBAR + 0x44)	/* Interrupt Mask */ +#define MCFSIM_ICR0		(MCF_MBAR + 0x4c)	/* Intr Ctrl reg 0 */ +#define MCFSIM_ICR1		(MCF_MBAR + 0x4d)	/* Intr Ctrl reg 1 */ +#define MCFSIM_ICR2		(MCF_MBAR + 0x4e)	/* Intr Ctrl reg 2 */ +#define MCFSIM_ICR3		(MCF_MBAR + 0x4f)	/* Intr Ctrl reg 3 */ +#define MCFSIM_ICR4		(MCF_MBAR + 0x50)	/* Intr Ctrl reg 4 */ +#define MCFSIM_ICR5		(MCF_MBAR + 0x51)	/* Intr Ctrl reg 5 */ +#define MCFSIM_ICR6		(MCF_MBAR + 0x52)	/* Intr Ctrl reg 6 */ +#define MCFSIM_ICR7		(MCF_MBAR + 0x53)	/* Intr Ctrl reg 7 */ +#define MCFSIM_ICR8		(MCF_MBAR + 0x54)	/* Intr Ctrl reg 8 */ +#define MCFSIM_ICR9		(MCF_MBAR + 0x55)	/* Intr Ctrl reg 9 */ +#define MCFSIM_ICR10		(MCF_MBAR + 0x56)	/* Intr Ctrl reg 10 */ +#define MCFSIM_ICR11		(MCF_MBAR + 0x57)	/* Intr Ctrl reg 11 */ + +#define MCFSIM_CSAR0		(MCF_MBAR + 0x80)	/* CS 0 Address reg */ +#define MCFSIM_CSMR0		(MCF_MBAR + 0x84)	/* CS 0 Mask reg */ +#define MCFSIM_CSCR0		(MCF_MBAR + 0x8a)	/* CS 0 Control reg */ +#define MCFSIM_CSAR1		(MCF_MBAR + 0x8c)	/* CS 1 Address reg */ +#define MCFSIM_CSMR1		(MCF_MBAR + 0x90)	/* CS 1 Mask reg */ +#define MCFSIM_CSCR1		(MCF_MBAR + 0x96)	/* CS 1 Control reg */ +#define MCFSIM_CSAR2		(MCF_MBAR + 0x98)	/* CS 2 Address reg */ +#define MCFSIM_CSMR2		(MCF_MBAR + 0x9c)	/* CS 2 Mask reg */ +#define MCFSIM_CSCR2		(MCF_MBAR + 0xa2)	/* CS 2 Control reg */ +#define MCFSIM_CSAR3		(MCF_MBAR + 0xa4)	/* CS 3 Address reg */ +#define MCFSIM_CSMR3		(MCF_MBAR + 0xa8)	/* CS 3 Mask reg */ +#define MCFSIM_CSCR3		(MCF_MBAR + 0xae)	/* CS 3 Control reg */ +#define MCFSIM_CSAR4		(MCF_MBAR + 0xb0)	/* CS 4 Address reg */ +#define MCFSIM_CSMR4		(MCF_MBAR + 0xb4)	/* CS 4 Mask reg */ +#define MCFSIM_CSCR4		(MCF_MBAR + 0xba)	/* CS 4 Control reg */ + +#define MCFSIM_DCR		(MCF_MBAR + 0x100)	/* DRAM Control */ +#define MCFSIM_DACR0		(MCF_MBAR + 0x108)	/* DRAM 0 Addr/Ctrl */ +#define MCFSIM_DMR0		(MCF_MBAR + 0x10c)	/* DRAM 0 Mask */ +#define MCFSIM_DACR1		(MCF_MBAR + 0x110)	/* DRAM 1 Addr/Ctrl */ +#define MCFSIM_DMR1		(MCF_MBAR + 0x114)	/* DRAM 1 Mask */ + +/* + * Secondary Interrupt Controller (in MBAR2) +*/ +#define MCFINTC2_INTBASE	(MCF_MBAR2 + 0x168)	/* Base Vector Reg */ +#define MCFINTC2_INTPRI1	(MCF_MBAR2 + 0x140)	/* 0-7 priority */ +#define MCFINTC2_INTPRI2	(MCF_MBAR2 + 0x144)	/* 8-15 priority */ +#define MCFINTC2_INTPRI3	(MCF_MBAR2 + 0x148)	/* 16-23 priority */ +#define MCFINTC2_INTPRI4	(MCF_MBAR2 + 0x14c)	/* 24-31 priority */ +#define MCFINTC2_INTPRI5	(MCF_MBAR2 + 0x150)	/* 32-39 priority */ +#define MCFINTC2_INTPRI6	(MCF_MBAR2 + 0x154)	/* 40-47 priority */ +#define MCFINTC2_INTPRI7	(MCF_MBAR2 + 0x158)	/* 48-55 priority */ +#define MCFINTC2_INTPRI8	(MCF_MBAR2 + 0x15c)	/* 56-63 priority */ + +#define MCFINTC2_INTPRI_REG(i)	(MCFINTC2_INTPRI1 + \ +				((((i) - MCFINTC2_VECBASE) / 8) * 4)) +#define MCFINTC2_INTPRI_BITS(b, i)	((b) << (((i) % 8) * 4)) + +/* + *	Timer module. + */ +#define MCFTIMER_BASE1		(MCF_MBAR + 0x140)	/* Base of TIMER1 */ +#define MCFTIMER_BASE2		(MCF_MBAR + 0x180)	/* Base of TIMER2 */ + +/* + *	UART module. + */ +#define MCFUART_BASE0		(MCF_MBAR + 0x1c0)	/* Base address UART0 */ +#define MCFUART_BASE1		(MCF_MBAR + 0x200)	/* Base address UART1 */ + +/* + *	QSPI module. + */ +#define MCFQSPI_BASE		(MCF_MBAR + 0x400)	/* Base address QSPI */ +#define MCFQSPI_SIZE		0x40			/* Register set size */ + +#ifdef CONFIG_M5249 +#define MCFQSPI_CS0		29 +#define MCFQSPI_CS1		24 +#define MCFQSPI_CS2		21 +#define MCFQSPI_CS3		22 +#else +#define MCFQSPI_CS0		15 +#define MCFQSPI_CS1		16 +#define MCFQSPI_CS2		24 +#define MCFQSPI_CS3		28 +#endif + +/* + *	I2C module. + */ +#define MCFI2C_BASE0		(MCF_MBAR + 0x280)	/* Base addreess I2C0 */ +#define MCFI2C_SIZE0		0x20			/* Register set size */ + +#define MCFI2C_BASE1		(MCF_MBAR2 + 0x440)	/* Base addreess I2C1 */ +#define MCFI2C_SIZE1		0x20			/* Register set size */ + +/* + *	DMA unit base addresses. + */ +#define MCFDMA_BASE0		(MCF_MBAR + 0x300)	/* Base address DMA 0 */ +#define MCFDMA_BASE1		(MCF_MBAR + 0x340)	/* Base address DMA 1 */ +#define MCFDMA_BASE2		(MCF_MBAR + 0x380)	/* Base address DMA 2 */ +#define MCFDMA_BASE3		(MCF_MBAR + 0x3C0)	/* Base address DMA 3 */ + +/* + *	Some symbol defines for the above... + */ +#define MCFSIM_SWDICR		MCFSIM_ICR0	/* Watchdog timer ICR */ +#define MCFSIM_TIMER1ICR	MCFSIM_ICR1	/* Timer 1 ICR */ +#define MCFSIM_TIMER2ICR	MCFSIM_ICR2	/* Timer 2 ICR */ +#define MCFSIM_I2CICR		MCFSIM_ICR3	/* I2C ICR */ +#define MCFSIM_UART1ICR		MCFSIM_ICR4	/* UART 1 ICR */ +#define MCFSIM_UART2ICR		MCFSIM_ICR5	/* UART 2 ICR */ +#define MCFSIM_DMA0ICR		MCFSIM_ICR6	/* DMA 0 ICR */ +#define MCFSIM_DMA1ICR		MCFSIM_ICR7	/* DMA 1 ICR */ +#define MCFSIM_DMA2ICR		MCFSIM_ICR8	/* DMA 2 ICR */ +#define MCFSIM_DMA3ICR		MCFSIM_ICR9	/* DMA 3 ICR */ +#define MCFSIM_QSPIICR		MCFSIM_ICR10	/* QSPI ICR */ + +/* + *	Define system peripheral IRQ usage. + */ +#define MCF_IRQ_QSPI		28		/* QSPI, Level 4 */ +#define MCF_IRQ_I2C0		29 +#define MCF_IRQ_TIMER		30		/* Timer0, Level 6 */ +#define MCF_IRQ_PROFILER	31		/* Timer1, Level 7 */ + +#define MCF_IRQ_UART0		73		/* UART0 */ +#define MCF_IRQ_UART1		74		/* UART1 */ + +/* + * Define the base interrupt for the second interrupt controller. + * We set it to 128, out of the way of the base interrupts, and plenty + * of room for its 64 interrupts. + */ +#define MCFINTC2_VECBASE	128 + +#define MCF_IRQ_GPIO0		(MCFINTC2_VECBASE + 32) +#define MCF_IRQ_GPIO1		(MCFINTC2_VECBASE + 33) +#define MCF_IRQ_GPIO2		(MCFINTC2_VECBASE + 34) +#define MCF_IRQ_GPIO3		(MCFINTC2_VECBASE + 35) +#define MCF_IRQ_GPIO4		(MCFINTC2_VECBASE + 36) +#define MCF_IRQ_GPIO5		(MCFINTC2_VECBASE + 37) +#define MCF_IRQ_GPIO6		(MCFINTC2_VECBASE + 38) +#define MCF_IRQ_GPIO7		(MCFINTC2_VECBASE + 39) + +#define MCF_IRQ_USBWUP		(MCFINTC2_VECBASE + 40) +#define MCF_IRQ_I2C1		(MCFINTC2_VECBASE + 62) + +/* + *	General purpose IO registers (in MBAR2). + */ +#define MCFSIM2_GPIOREAD	(MCF_MBAR2 + 0x000)	/* GPIO read values */ +#define MCFSIM2_GPIOWRITE	(MCF_MBAR2 + 0x004)	/* GPIO write values */ +#define MCFSIM2_GPIOENABLE	(MCF_MBAR2 + 0x008)	/* GPIO enabled */ +#define MCFSIM2_GPIOFUNC	(MCF_MBAR2 + 0x00C)	/* GPIO function */ +#define MCFSIM2_GPIO1READ	(MCF_MBAR2 + 0x0B0)	/* GPIO1 read values */ +#define MCFSIM2_GPIO1WRITE	(MCF_MBAR2 + 0x0B4)	/* GPIO1 write values */ +#define MCFSIM2_GPIO1ENABLE	(MCF_MBAR2 + 0x0B8)	/* GPIO1 enabled */ +#define MCFSIM2_GPIO1FUNC	(MCF_MBAR2 + 0x0BC)	/* GPIO1 function */ + +#define MCFSIM2_GPIOINTSTAT	(MCF_MBAR2 + 0xc0)	/* GPIO intr status */ +#define MCFSIM2_GPIOINTCLEAR	(MCF_MBAR2 + 0xc0)	/* GPIO intr clear */ +#define MCFSIM2_GPIOINTENABLE	(MCF_MBAR2 + 0xc4)	/* GPIO intr enable */ + +#define MCFSIM2_DMAROUTE	(MCF_MBAR2 + 0x188)     /* DMA routing */ +#define MCFSIM2_IDECONFIG1	(MCF_MBAR2 + 0x18c)	/* IDEconfig1 */ +#define MCFSIM2_IDECONFIG2	(MCF_MBAR2 + 0x190)	/* IDEconfig2 */ + +/* + * Generic GPIO support + */ +#define MCFGPIO_PIN_MAX		64 +#ifdef CONFIG_M5249 +#define MCFGPIO_IRQ_MAX		-1 +#define MCFGPIO_IRQ_VECBASE	-1 +#else +#define MCFGPIO_IRQ_MAX		7 +#define MCFGPIO_IRQ_VECBASE	MCF_IRQ_GPIO0 +#endif + +/****************************************************************************/ + +#ifdef __ASSEMBLER__ +#ifdef CONFIG_M5249C3 +/* + *	The M5249C3 board needs a little help getting all its SIM devices + *	initialized at kernel start time. dBUG doesn't set much up, so + *	we need to do it manually. + */ +.macro m5249c3_setup +	/* +	 *	Set MBAR1 and MBAR2, just incase they are not set. +	 */ +	movel	#0x10000001,%a0 +	movec	%a0,%MBAR			/* map MBAR region */ +	subql	#1,%a0				/* get MBAR address in a0 */ + +	movel	#0x80000001,%a1 +	movec	%a1,#3086			/* map MBAR2 region */ +	subql	#1,%a1				/* get MBAR2 address in a1 */ + +	/* +	 *      Move secondary interrupts to their base (128). +	 */ +	moveb	#MCFINTC2_VECBASE,%d0 +	moveb	%d0,0x16b(%a1)			/* interrupt base register */ + +	/* +	 *      Work around broken CSMR0/DRAM vector problem. +	 */ +	movel	#0x001F0021,%d0			/* disable C/I bit */ +	movel	%d0,0x84(%a0)			/* set CSMR0 */ + +	/* +	 *	Disable the PLL firstly. (Who knows what state it is +	 *	in here!). +	 */ +	movel	0x180(%a1),%d0			/* get current PLL value */ +	andl	#0xfffffffe,%d0			/* PLL bypass first */ +	movel	%d0,0x180(%a1)			/* set PLL register */ +	nop + +#if CONFIG_CLOCK_FREQ == 140000000 +	/* +	 *	Set initial clock frequency. This assumes M5249C3 board +	 *	is fitted with 11.2896MHz crystal. It will program the +	 *	PLL for 140MHz. Lets go fast :-) +	 */ +	movel	#0x125a40f0,%d0			/* set for 140MHz */ +	movel	%d0,0x180(%a1)			/* set PLL register */ +	orl	#0x1,%d0 +	movel	%d0,0x180(%a1)			/* set PLL register */ +#endif + +	/* +	 *	Setup CS1 for ethernet controller. +	 *	(Setup as per M5249C3 doco). +	 */ +	movel  #0xe0000000,%d0			/* CS1 mapped at 0xe0000000 */ +	movel  %d0,0x8c(%a0) +	movel  #0x001f0021,%d0			/* CS1 size of 1Mb */ +	movel  %d0,0x90(%a0) +	movew  #0x0080,%d0			/* CS1 = 16bit port, AA */ +	movew  %d0,0x96(%a0) + +	/* +	 *	Setup CS2 for IDE interface. +	 */ +	movel	#0x50000000,%d0			/* CS2 mapped at 0x50000000 */ +	movel	%d0,0x98(%a0) +	movel	#0x001f0001,%d0			/* CS2 size of 1MB */ +	movel	%d0,0x9c(%a0) +	movew	#0x0080,%d0			/* CS2 = 16bit, TA */ +	movew	%d0,0xa2(%a0) + +	movel	#0x00107000,%d0			/* IDEconfig1 */ +	movel	%d0,0x18c(%a1) +	movel	#0x000c0400,%d0			/* IDEconfig2 */ +	movel	%d0,0x190(%a1) + +	movel	#0x00080000,%d0			/* GPIO19, IDE reset bit */ +	orl	%d0,0xc(%a1)			/* function GPIO19 */ +	orl	%d0,0x8(%a1)			/* enable GPIO19 as output */ +        orl	%d0,0x4(%a1)			/* de-assert IDE reset */ +.endm + +#define	PLATFORM_SETUP	m5249c3_setup + +#endif /* CONFIG_M5249C3 */ +#endif /* __ASSEMBLER__ */ +/****************************************************************************/ +#endif	/* m525xsim_h */ diff --git a/arch/m68k/include/asm/m5272sim.h b/arch/m68k/include/asm/m5272sim.h index df3332c2317..1fb01bb05d6 100644 --- a/arch/m68k/include/asm/m5272sim.h +++ b/arch/m68k/include/asm/m5272sim.h @@ -12,55 +12,64 @@  #define	m5272sim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m5272)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		MCF_CLK + +#include <asm/m52xxacr.h> +  /*   *	Define the 5272 SIM register set addresses.   */ -#define	MCFSIM_SCR		0x04		/* SIM Config reg (r/w) */ -#define	MCFSIM_SPR		0x06		/* System Protection reg (r/w)*/ -#define	MCFSIM_PMR		0x08		/* Power Management reg (r/w) */ -#define	MCFSIM_APMR		0x0e		/* Active Low Power reg (r/w) */ -#define	MCFSIM_DIR		0x10		/* Device Identity reg (r/w) */ - -#define	MCFSIM_ICR1		0x20		/* Intr Ctrl reg 1 (r/w) */ -#define	MCFSIM_ICR2		0x24		/* Intr Ctrl reg 2 (r/w) */ -#define	MCFSIM_ICR3		0x28		/* Intr Ctrl reg 3 (r/w) */ -#define	MCFSIM_ICR4		0x2c		/* Intr Ctrl reg 4 (r/w) */ - -#define MCFSIM_ISR		0x30		/* Interrupt Source reg (r/w) */ -#define MCFSIM_PITR		0x34		/* Interrupt Transition (r/w) */ -#define	MCFSIM_PIWR		0x38		/* Interrupt Wakeup reg (r/w) */ -#define	MCFSIM_PIVR		0x3f		/* Interrupt Vector reg (r/w( */ - -#define	MCFSIM_WRRR		0x280		/* Watchdog reference (r/w) */ -#define	MCFSIM_WIRR		0x284		/* Watchdog interrupt (r/w) */ -#define	MCFSIM_WCR		0x288		/* Watchdog counter (r/w) */ -#define	MCFSIM_WER		0x28c		/* Watchdog event (r/w) */ - -#define	MCFSIM_CSBR0		0x40		/* CS0 Base Address (r/w) */ -#define	MCFSIM_CSOR0		0x44		/* CS0 Option (r/w) */ -#define	MCFSIM_CSBR1		0x48		/* CS1 Base Address (r/w) */ -#define	MCFSIM_CSOR1		0x4c		/* CS1 Option (r/w) */ -#define	MCFSIM_CSBR2		0x50		/* CS2 Base Address (r/w) */ -#define	MCFSIM_CSOR2		0x54		/* CS2 Option (r/w) */ -#define	MCFSIM_CSBR3		0x58		/* CS3 Base Address (r/w) */ -#define	MCFSIM_CSOR3		0x5c		/* CS3 Option (r/w) */ -#define	MCFSIM_CSBR4		0x60		/* CS4 Base Address (r/w) */ -#define	MCFSIM_CSOR4		0x64		/* CS4 Option (r/w) */ -#define	MCFSIM_CSBR5		0x68		/* CS5 Base Address (r/w) */ -#define	MCFSIM_CSOR5		0x6c		/* CS5 Option (r/w) */ -#define	MCFSIM_CSBR6		0x70		/* CS6 Base Address (r/w) */ -#define	MCFSIM_CSOR6		0x74		/* CS6 Option (r/w) */ -#define	MCFSIM_CSBR7		0x78		/* CS7 Base Address (r/w) */ -#define	MCFSIM_CSOR7		0x7c		/* CS7 Option (r/w) */ - -#define	MCFSIM_SDCR		0x180		/* SDRAM Configuration (r/w) */ -#define	MCFSIM_SDTR		0x184		/* SDRAM Timing (r/w) */ -#define	MCFSIM_DCAR0		0x4c		/* DRAM 0 Address reg(r/w) */ -#define	MCFSIM_DCMR0		0x50		/* DRAM 0 Mask reg (r/w) */ -#define	MCFSIM_DCCR0		0x57		/* DRAM 0 Control reg (r/w) */ -#define	MCFSIM_DCAR1		0x58		/* DRAM 1 Address reg (r/w) */ -#define	MCFSIM_DCMR1		0x5c		/* DRAM 1 Mask reg (r/w) */ -#define	MCFSIM_DCCR1		0x63		/* DRAM 1 Control reg (r/w) */ +#define	MCFSIM_SCR		(MCF_MBAR + 0x04)	/* SIM Config reg */ +#define	MCFSIM_SPR		(MCF_MBAR + 0x06)	/* System Protection */ +#define	MCFSIM_PMR		(MCF_MBAR + 0x08)	/* Power Management */ +#define	MCFSIM_APMR		(MCF_MBAR + 0x0e)	/* Active Low Power */ +#define	MCFSIM_DIR		(MCF_MBAR + 0x10)	/* Device Identity */ + +#define	MCFSIM_ICR1		(MCF_MBAR + 0x20)	/* Intr Ctrl reg 1 */ +#define	MCFSIM_ICR2		(MCF_MBAR + 0x24)	/* Intr Ctrl reg 2 */ +#define	MCFSIM_ICR3		(MCF_MBAR + 0x28)	/* Intr Ctrl reg 3 */ +#define	MCFSIM_ICR4		(MCF_MBAR + 0x2c)	/* Intr Ctrl reg 4 */ + +#define	MCFSIM_ISR		(MCF_MBAR + 0x30)	/* Intr Source */ +#define	MCFSIM_PITR		(MCF_MBAR + 0x34)	/* Intr Transition */ +#define	MCFSIM_PIWR		(MCF_MBAR + 0x38)	/* Intr Wakeup */ +#define	MCFSIM_PIVR		(MCF_MBAR + 0x3f)	/* Intr Vector */ + +#define	MCFSIM_WRRR		(MCF_MBAR + 0x280)	/* Watchdog reference */ +#define	MCFSIM_WIRR		(MCF_MBAR + 0x284)	/* Watchdog interrupt */ +#define	MCFSIM_WCR		(MCF_MBAR + 0x288)	/* Watchdog counter */ +#define	MCFSIM_WER		(MCF_MBAR + 0x28c)	/* Watchdog event */ + +#define	MCFSIM_CSBR0		(MCF_MBAR + 0x40)	/* CS0 Base Address */ +#define	MCFSIM_CSOR0		(MCF_MBAR + 0x44)	/* CS0 Option */ +#define	MCFSIM_CSBR1		(MCF_MBAR + 0x48)	/* CS1 Base Address */ +#define	MCFSIM_CSOR1		(MCF_MBAR + 0x4c)	/* CS1 Option */ +#define	MCFSIM_CSBR2		(MCF_MBAR + 0x50)	/* CS2 Base Address */ +#define	MCFSIM_CSOR2		(MCF_MBAR + 0x54)	/* CS2 Option */ +#define	MCFSIM_CSBR3		(MCF_MBAR + 0x58)	/* CS3 Base Address */ +#define	MCFSIM_CSOR3		(MCF_MBAR + 0x5c)	/* CS3 Option */ +#define	MCFSIM_CSBR4		(MCF_MBAR + 0x60)	/* CS4 Base Address */ +#define	MCFSIM_CSOR4		(MCF_MBAR + 0x64)	/* CS4 Option */ +#define	MCFSIM_CSBR5		(MCF_MBAR + 0x68)	/* CS5 Base Address */ +#define	MCFSIM_CSOR5		(MCF_MBAR + 0x6c)	/* CS5 Option */ +#define	MCFSIM_CSBR6		(MCF_MBAR + 0x70)	/* CS6 Base Address */ +#define	MCFSIM_CSOR6		(MCF_MBAR + 0x74)	/* CS6 Option */ +#define	MCFSIM_CSBR7		(MCF_MBAR + 0x78)	/* CS7 Base Address */ +#define	MCFSIM_CSOR7		(MCF_MBAR + 0x7c)	/* CS7 Option */ + +#define	MCFSIM_SDCR		(MCF_MBAR + 0x180)	/* SDRAM Config */ +#define	MCFSIM_SDTR		(MCF_MBAR + 0x184)	/* SDRAM Timing */ +#define	MCFSIM_DCAR0		(MCF_MBAR + 0x4c)	/* DRAM 0 Address */ +#define	MCFSIM_DCMR0		(MCF_MBAR + 0x50)	/* DRAM 0 Mask */ +#define	MCFSIM_DCCR0		(MCF_MBAR + 0x57)	/* DRAM 0 Control */ +#define	MCFSIM_DCAR1		(MCF_MBAR + 0x58)	/* DRAM 1 Address */ +#define	MCFSIM_DCMR1		(MCF_MBAR + 0x5c)	/* DRAM 1 Mask reg */ +#define	MCFSIM_DCCR1		(MCF_MBAR + 0x63)	/* DRAM 1 Control */ + +#define	MCFUART_BASE0		(MCF_MBAR + 0x100) /* Base address UART0 */ +#define	MCFUART_BASE1		(MCF_MBAR + 0x140) /* Base address UART1 */  #define	MCFSIM_PACNT		(MCF_MBAR + 0x80) /* Port A Control (r/w) */  #define	MCFSIM_PADDR		(MCF_MBAR + 0x84) /* Port A Direction (r/w) */ @@ -72,6 +81,16 @@  #define	MCFSIM_PCDAT		(MCF_MBAR + 0x96) /* Port C Data (r/w) */  #define	MCFSIM_PDCNT		(MCF_MBAR + 0x98) /* Port D Control (r/w) */ +#define	MCFDMA_BASE0		(MCF_MBAR + 0xe0) /* Base address DMA 0 */ + +#define	MCFTIMER_BASE1		(MCF_MBAR + 0x200) /* Base address TIMER1 */ +#define	MCFTIMER_BASE2		(MCF_MBAR + 0x220) /* Base address TIMER2 */ +#define	MCFTIMER_BASE3		(MCF_MBAR + 0x240) /* Base address TIMER4 */ +#define	MCFTIMER_BASE4		(MCF_MBAR + 0x260) /* Base address TIMER3 */ + +#define	MCFFEC_BASE0		(MCF_MBAR + 0x840) /* Base FEC ethernet */ +#define	MCFFEC_SIZE0		0x1d0 +  /*   *	Define system peripheral IRQ usage.   */ @@ -85,8 +104,8 @@  #define	MCF_IRQ_TIMER2		70		/* Timer 2 */  #define	MCF_IRQ_TIMER3		71		/* Timer 3 */  #define	MCF_IRQ_TIMER4		72		/* Timer 4 */ -#define	MCF_IRQ_UART1		73		/* UART 1 */ -#define	MCF_IRQ_UART2		74		/* UART 2 */ +#define	MCF_IRQ_UART0		73		/* UART 0 */ +#define	MCF_IRQ_UART1		74		/* UART 1 */  #define	MCF_IRQ_PLIP		75		/* PLIC 2Khz Periodic */  #define	MCF_IRQ_PLIA		76		/* PLIC Asynchronous */  #define	MCF_IRQ_USB0		77		/* USB Endpoint 0 */ @@ -98,9 +117,9 @@  #define	MCF_IRQ_USB6		83		/* USB Endpoint 6 */  #define	MCF_IRQ_USB7		84		/* USB Endpoint 7 */  #define	MCF_IRQ_DMA		85		/* DMA Controller */ -#define	MCF_IRQ_ERX		86		/* Ethernet Receiver */ -#define	MCF_IRQ_ETX		87		/* Ethernet Transmitter */ -#define	MCF_IRQ_ENTC		88		/* Ethernet Non-Time Critical */ +#define	MCF_IRQ_FECRX0		86		/* Ethernet Receiver */ +#define	MCF_IRQ_FECTX0		87		/* Ethernet Transmitter */ +#define	MCF_IRQ_FECENTC0	88		/* Ethernet Non-Time Critical */  #define	MCF_IRQ_QSPI		89		/* Queued Serial Interface */  #define	MCF_IRQ_EINT5		90		/* External Interrupt 5 */  #define	MCF_IRQ_EINT6		91		/* External Interrupt 6 */ @@ -113,8 +132,9 @@  /*   * Generic GPIO support   */ -#define MCFGPIO_PIN_MAX			48 -#define MCFGPIO_IRQ_MAX			-1 -#define MCFGPIO_IRQ_VECBASE		-1 +#define MCFGPIO_PIN_MAX		48 +#define MCFGPIO_IRQ_MAX		-1 +#define MCFGPIO_IRQ_VECBASE	-1 +  /****************************************************************************/  #endif	/* m5272sim_h */ diff --git a/arch/m68k/include/asm/m527xsim.h b/arch/m68k/include/asm/m527xsim.h index 1feb46f108c..1bebbe78055 100644 --- a/arch/m68k/include/asm/m527xsim.h +++ b/arch/m68k/include/asm/m527xsim.h @@ -11,12 +11,18 @@  #define	m527xsim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m527x)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m52xxacr.h>  /*   *	Define the 5270/5271 SIM register set addresses.   */ -#define	MCFICM_INTC0		0x0c00		/* Base for Interrupt Ctrl 0 */ -#define	MCFICM_INTC1		0x0d00		/* Base for Interrupt Ctrl 1 */ +#define	MCFICM_INTC0		(MCF_IPSBAR + 0x0c00)	/* Base for Interrupt Ctrl 0 */ +#define	MCFICM_INTC1		(MCF_IPSBAR + 0x0d00)	/* Base for Interrupt Ctrl 1 */ +  #define	MCFINTC_IPRH		0x00		/* Interrupt pending 32-63 */  #define	MCFINTC_IPRL		0x04		/* Interrupt pending 1-31 */  #define	MCFINTC_IMRH		0x08		/* Interrupt mask 32-63 */ @@ -32,30 +38,96 @@  #define	MCFINT_UART1		14		/* Interrupt number for UART1 */  #define	MCFINT_UART2		15		/* Interrupt number for UART2 */  #define	MCFINT_QSPI		18		/* Interrupt number for QSPI */ +#define	MCFINT_FECRX0		23		/* Interrupt number for FEC0 */ +#define	MCFINT_FECTX0		27		/* Interrupt number for FEC0 */ +#define	MCFINT_FECENTC0		29		/* Interrupt number for FEC0 */  #define	MCFINT_PIT1		36		/* Interrupt number for PIT1 */ +#define	MCFINT2_VECBASE		128		/* Vector base number 2 */ +#define	MCFINT2_FECRX1		23		/* Interrupt number for FEC1 */ +#define	MCFINT2_FECTX1		27		/* Interrupt number for FEC1 */ +#define	MCFINT2_FECENTC1	29		/* Interrupt number for FEC1 */ + +#define	MCF_IRQ_UART0	        (MCFINT_VECBASE + MCFINT_UART0) +#define	MCF_IRQ_UART1	        (MCFINT_VECBASE + MCFINT_UART1) +#define	MCF_IRQ_UART2	        (MCFINT_VECBASE + MCFINT_UART2) + +#define	MCF_IRQ_FECRX0		(MCFINT_VECBASE + MCFINT_FECRX0) +#define	MCF_IRQ_FECTX0		(MCFINT_VECBASE + MCFINT_FECTX0) +#define	MCF_IRQ_FECENTC0	(MCFINT_VECBASE + MCFINT_FECENTC0) +#define	MCF_IRQ_FECRX1		(MCFINT2_VECBASE + MCFINT2_FECRX1) +#define	MCF_IRQ_FECTX1		(MCFINT2_VECBASE + MCFINT2_FECTX1) +#define	MCF_IRQ_FECENTC1	(MCFINT2_VECBASE + MCFINT2_FECENTC1) + +#define	MCF_IRQ_QSPI		(MCFINT_VECBASE + MCFINT_QSPI) +#define MCF_IRQ_PIT1		(MCFINT_VECBASE + MCFINT_PIT1) +  /*   *	SDRAM configuration registers.   */  #ifdef CONFIG_M5271 -#define	MCFSIM_DCR		0x40		/* SDRAM control */ -#define	MCFSIM_DACR0		0x48		/* SDRAM base address 0 */ -#define	MCFSIM_DMR0		0x4c		/* SDRAM address mask 0 */ -#define	MCFSIM_DACR1		0x50		/* SDRAM base address 1 */ -#define	MCFSIM_DMR1		0x54		/* SDRAM address mask 1 */ +#define	MCFSIM_DCR		(MCF_IPSBAR + 0x40)	/* Control */ +#define	MCFSIM_DACR0		(MCF_IPSBAR + 0x48)	/* Base address 0 */ +#define	MCFSIM_DMR0		(MCF_IPSBAR + 0x4c)	/* Address mask 0 */ +#define	MCFSIM_DACR1		(MCF_IPSBAR + 0x50)	/* Base address 1 */ +#define	MCFSIM_DMR1		(MCF_IPSBAR + 0x54)	/* Address mask 1 */  #endif  #ifdef CONFIG_M5275 -#define	MCFSIM_DMR		0x40		/* SDRAM mode */ -#define	MCFSIM_DCR		0x44		/* SDRAM control */ -#define	MCFSIM_DCFG1		0x48		/* SDRAM configuration 1 */ -#define	MCFSIM_DCFG2		0x4c		/* SDRAM configuration 2 */ -#define	MCFSIM_DBAR0		0x50		/* SDRAM base address 0 */ -#define	MCFSIM_DMR0		0x54		/* SDRAM address mask 0 */ -#define	MCFSIM_DBAR1		0x58		/* SDRAM base address 1 */ -#define	MCFSIM_DMR1		0x5c		/* SDRAM address mask 1 */ +#define	MCFSIM_DMR		(MCF_IPSBAR + 0x40)	/* Mode */ +#define	MCFSIM_DCR		(MCF_IPSBAR + 0x44)	/* Control */ +#define	MCFSIM_DCFG1		(MCF_IPSBAR + 0x48)	/* Configuration 1 */ +#define	MCFSIM_DCFG2		(MCF_IPSBAR + 0x4c)	/* Configuration 2 */ +#define	MCFSIM_DBAR0		(MCF_IPSBAR + 0x50)	/* Base address 0 */ +#define	MCFSIM_DMR0		(MCF_IPSBAR + 0x54)	/* Address mask 0 */ +#define	MCFSIM_DBAR1		(MCF_IPSBAR + 0x58)	/* Base address 1 */ +#define	MCFSIM_DMR1		(MCF_IPSBAR + 0x5c)	/* Address mask 1 */  #endif +/* + *	DMA unit base addresses. + */ +#define	MCFDMA_BASE0		(MCF_IPSBAR + 0x100) +#define	MCFDMA_BASE1		(MCF_IPSBAR + 0x140) +#define	MCFDMA_BASE2		(MCF_IPSBAR + 0x180) +#define	MCFDMA_BASE3		(MCF_IPSBAR + 0x1C0) + +/* + *	UART module. + */ +#define MCFUART_BASE0		(MCF_IPSBAR + 0x200) +#define MCFUART_BASE1		(MCF_IPSBAR + 0x240) +#define MCFUART_BASE2		(MCF_IPSBAR + 0x280) + +/* + *	FEC ethernet module. + */ +#define	MCFFEC_BASE0		(MCF_IPSBAR + 0x1000) +#define	MCFFEC_SIZE0		0x800 +#define	MCFFEC_BASE1		(MCF_IPSBAR + 0x1800) +#define	MCFFEC_SIZE1		0x800 + +/* + *	QSPI module. + */ +#define	MCFQSPI_BASE		(MCF_IPSBAR + 0x340) +#define	MCFQSPI_SIZE		0x40 + +#ifdef CONFIG_M5271 +#define	MCFQSPI_CS0		91 +#define	MCFQSPI_CS1		92 +#define	MCFQSPI_CS2		99 +#define	MCFQSPI_CS3		103 +#endif +#ifdef CONFIG_M5275 +#define	MCFQSPI_CS0		59 +#define	MCFQSPI_CS1		60 +#define	MCFQSPI_CS2		61 +#define	MCFQSPI_CS3		62 +#endif +/* + *	GPIO module. + */  #ifdef CONFIG_M5271  #define MCFGPIO_PODR_ADDR	(MCF_IPSBAR + 0x100000)  #define MCFGPIO_PODR_DATAH	(MCF_IPSBAR + 0x100001) @@ -112,19 +184,33 @@  /*   * Generic GPIO support   */ -#define MCFGPIO_PODR			MCFGPIO_PODR_ADDR -#define MCFGPIO_PDDR			MCFGPIO_PDDR_ADDR -#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_ADDR -#define MCFGPIO_SETR			MCFGPIO_PPDSDR_ADDR -#define MCFGPIO_CLRR			MCFGPIO_PCLRR_ADDR +#define MCFGPIO_PODR		MCFGPIO_PODR_ADDR +#define MCFGPIO_PDDR		MCFGPIO_PDDR_ADDR +#define MCFGPIO_PPDR		MCFGPIO_PPDSDR_ADDR +#define MCFGPIO_SETR		MCFGPIO_PPDSDR_ADDR +#define MCFGPIO_CLRR		MCFGPIO_PCLRR_ADDR -#define MCFGPIO_PIN_MAX			100 -#define MCFGPIO_IRQ_MAX			8 -#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE +#define MCFGPIO_PIN_MAX		100 +#define MCFGPIO_IRQ_MAX		8 +#define MCFGPIO_IRQ_VECBASE	MCFINT_VECBASE +/* + * Port Pin Assignment registers. + */ +#define MCFGPIO_PAR_AD		(MCF_IPSBAR + 0x100040) +#define MCFGPIO_PAR_BUSCTL	(MCF_IPSBAR + 0x100042) +#define MCFGPIO_PAR_BS		(MCF_IPSBAR + 0x100044) +#define MCFGPIO_PAR_CS		(MCF_IPSBAR + 0x100045) +#define MCFGPIO_PAR_SDRAM	(MCF_IPSBAR + 0x100046) +#define MCFGPIO_PAR_FECI2C	(MCF_IPSBAR + 0x100047) +#define MCFGPIO_PAR_UART	(MCF_IPSBAR + 0x100048)  #define MCFGPIO_PAR_QSPI	(MCF_IPSBAR + 0x10004A)  #define MCFGPIO_PAR_TIMER	(MCF_IPSBAR + 0x10004C) -#endif + +#define UART0_ENABLE_MASK	0x000f +#define UART1_ENABLE_MASK	0x0ff0 +#define UART2_ENABLE_MASK	0x3000 +#endif /* CONFIG_M5271 */  #ifdef CONFIG_M5275  #define MCFGPIO_PODR_BUSCTL	(MCF_IPSBAR + 0x100004) @@ -207,50 +293,60 @@  /*   * Generic GPIO support   */ -#define MCFGPIO_PODR			MCFGPIO_PODR_BUSCTL -#define MCFGPIO_PDDR			MCFGPIO_PDDR_BUSCTL -#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_BUSCTL -#define MCFGPIO_SETR			MCFGPIO_PPDSDR_BUSCTL -#define MCFGPIO_CLRR			MCFGPIO_PCLRR_BUSCTL +#define MCFGPIO_PODR		MCFGPIO_PODR_BUSCTL +#define MCFGPIO_PDDR		MCFGPIO_PDDR_BUSCTL +#define MCFGPIO_PPDR		MCFGPIO_PPDSDR_BUSCTL +#define MCFGPIO_SETR		MCFGPIO_PPDSDR_BUSCTL +#define MCFGPIO_CLRR		MCFGPIO_PCLRR_BUSCTL -#define MCFGPIO_PIN_MAX			148 -#define MCFGPIO_IRQ_MAX			8 -#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE +#define MCFGPIO_PIN_MAX		148 +#define MCFGPIO_IRQ_MAX		8 +#define MCFGPIO_IRQ_VECBASE	MCFINT_VECBASE +/* + * Port Pin Assignment registers. + */ +#define MCFGPIO_PAR_AD		(MCF_IPSBAR + 0x100070) +#define MCFGPIO_PAR_CS		(MCF_IPSBAR + 0x100071) +#define MCFGPIO_PAR_BUSCTL	(MCF_IPSBAR + 0x100072) +#define MCFGPIO_PAR_USB		(MCF_IPSBAR + 0x100076) +#define MCFGPIO_PAR_FEC0HL	(MCF_IPSBAR + 0x100078) +#define MCFGPIO_PAR_FEC1HL	(MCF_IPSBAR + 0x100079) +#define MCFGPIO_PAR_TIMER	(MCF_IPSBAR + 0x10007A) +#define MCFGPIO_PAR_UART	(MCF_IPSBAR + 0x10007C)  #define MCFGPIO_PAR_QSPI	(MCF_IPSBAR + 0x10007E) -#endif +#define MCFGPIO_PAR_SDRAM	(MCF_IPSBAR + 0x100080) +#define MCFGPIO_PAR_FECI2C	(MCF_IPSBAR + 0x100082) +#define MCFGPIO_PAR_BS		(MCF_IPSBAR + 0x100084) + +#define UART0_ENABLE_MASK	0x000f +#define UART1_ENABLE_MASK	0x00f0 +#define UART2_ENABLE_MASK	0x3f00 +#endif /* CONFIG_M5275 */  /* - * EPort + * PIT timer base addresses.   */ +#define	MCFPIT_BASE1		(MCF_IPSBAR + 0x150000) +#define	MCFPIT_BASE2		(MCF_IPSBAR + 0x160000) +#define	MCFPIT_BASE3		(MCF_IPSBAR + 0x170000) +#define	MCFPIT_BASE4		(MCF_IPSBAR + 0x180000) +/* + * EPort + */ +#define MCFEPORT_EPPAR		(MCF_IPSBAR + 0x130000)  #define MCFEPORT_EPDDR		(MCF_IPSBAR + 0x130002) +#define MCFEPORT_EPIER		(MCF_IPSBAR + 0x130003)  #define MCFEPORT_EPDR		(MCF_IPSBAR + 0x130004)  #define MCFEPORT_EPPDR		(MCF_IPSBAR + 0x130005) - - - -/* - *	GPIO pins setups to enable the UARTs. - */ -#ifdef CONFIG_M5271 -#define MCF_GPIO_PAR_UART	0x100048	/* PAR UART address */ -#define UART0_ENABLE_MASK	0x000f -#define UART1_ENABLE_MASK	0x0ff0 -#define UART2_ENABLE_MASK	0x3000 -#endif -#ifdef CONFIG_M5275 -#define MCF_GPIO_PAR_UART	0x10007c	/* PAR UART address */ -#define UART0_ENABLE_MASK	0x000f -#define UART1_ENABLE_MASK	0x00f0 -#define UART2_ENABLE_MASK	0x3f00  -#endif +#define MCFEPORT_EPFR		(MCF_IPSBAR + 0x130006)  /* - *  Reset Controll Unit (relative to IPSBAR). + *  Reset Control Unit (relative to IPSBAR).   */ -#define	MCF_RCR			0x110000 -#define	MCF_RSR			0x110001 +#define	MCF_RCR			(MCF_IPSBAR + 0x110000) +#define	MCF_RSR			(MCF_IPSBAR + 0x110001)  #define	MCF_RCR_SWRESET		0x80		/* Software reset bit */  #define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ diff --git a/arch/m68k/include/asm/m528xsim.h b/arch/m68k/include/asm/m528xsim.h index 891cbedad97..cf68ca0ac3a 100644 --- a/arch/m68k/include/asm/m528xsim.h +++ b/arch/m68k/include/asm/m528xsim.h @@ -11,12 +11,18 @@  #define	m528xsim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m528x)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		MCF_CLK + +#include <asm/m52xxacr.h>  /*   *	Define the 5280/5282 SIM register set addresses.   */ -#define	MCFICM_INTC0		0x0c00		/* Base for Interrupt Ctrl 0 */ -#define	MCFICM_INTC1		0x0d00		/* Base for Interrupt Ctrl 0 */ +#define	MCFICM_INTC0		(MCF_IPSBAR + 0x0c00)	/* Base for Interrupt Ctrl 0 */ +#define	MCFICM_INTC1		(MCF_IPSBAR + 0x0d00)	/* Base for Interrupt Ctrl 0 */ +  #define	MCFINTC_IPRH		0x00		/* Interrupt pending 32-63 */  #define	MCFINTC_IPRL		0x04		/* Interrupt pending 1-31 */  #define	MCFINTC_IMRH		0x08		/* Interrupt mask 32-63 */ @@ -29,115 +35,143 @@  #define	MCFINT_VECBASE		64		/* Vector base number */  #define	MCFINT_UART0		13		/* Interrupt number for UART0 */ +#define	MCFINT_UART1		14		/* Interrupt number for UART1 */ +#define	MCFINT_UART2		15		/* Interrupt number for UART2 */  #define	MCFINT_QSPI		18		/* Interrupt number for QSPI */ +#define	MCFINT_FECRX0		23		/* Interrupt number for FEC */ +#define	MCFINT_FECTX0		27		/* Interrupt number for FEC */ +#define	MCFINT_FECENTC0		29		/* Interrupt number for FEC */  #define	MCFINT_PIT1		55		/* Interrupt number for PIT1 */ +#define	MCF_IRQ_UART0	        (MCFINT_VECBASE + MCFINT_UART0) +#define	MCF_IRQ_UART1	        (MCFINT_VECBASE + MCFINT_UART1) +#define	MCF_IRQ_UART2	        (MCFINT_VECBASE + MCFINT_UART2) + +#define	MCF_IRQ_FECRX0		(MCFINT_VECBASE + MCFINT_FECRX0) +#define	MCF_IRQ_FECTX0		(MCFINT_VECBASE + MCFINT_FECTX0) +#define	MCF_IRQ_FECENTC0	(MCFINT_VECBASE + MCFINT_FECENTC0) + +#define	MCF_IRQ_QSPI		(MCFINT_VECBASE + MCFINT_QSPI) +#define MCF_IRQ_PIT1		(MCFINT_VECBASE + MCFINT_PIT1)  /*   *	SDRAM configuration registers.   */ -#define	MCFSIM_DCR		0x44		/* SDRAM control */ -#define	MCFSIM_DACR0		0x48		/* SDRAM base address 0 */ -#define	MCFSIM_DMR0		0x4c		/* SDRAM address mask 0 */ -#define	MCFSIM_DACR1		0x50		/* SDRAM base address 1 */ -#define	MCFSIM_DMR1		0x54		/* SDRAM address mask 1 */ +#define	MCFSIM_DCR		(MCF_IPSBAR + 0x00000044) /* Control */ +#define	MCFSIM_DACR0		(MCF_IPSBAR + 0x00000048) /* Base address 0 */ +#define	MCFSIM_DMR0		(MCF_IPSBAR + 0x0000004c) /* Address mask 0 */ +#define	MCFSIM_DACR1		(MCF_IPSBAR + 0x00000050) /* Base address 1 */ +#define	MCFSIM_DMR1		(MCF_IPSBAR + 0x00000054) /* Address mask 1 */ + +/* + *	DMA unit base addresses. + */ +#define	MCFDMA_BASE0		(MCF_IPSBAR + 0x00000100) +#define	MCFDMA_BASE1		(MCF_IPSBAR + 0x00000140) +#define	MCFDMA_BASE2		(MCF_IPSBAR + 0x00000180) +#define	MCFDMA_BASE3		(MCF_IPSBAR + 0x000001C0) + +/* + *	UART module. + */ +#define	MCFUART_BASE0		(MCF_IPSBAR + 0x00000200) +#define	MCFUART_BASE1		(MCF_IPSBAR + 0x00000240) +#define	MCFUART_BASE2		(MCF_IPSBAR + 0x00000280) + +/* + *	FEC ethernet module. + */ +#define	MCFFEC_BASE0		(MCF_IPSBAR + 0x00001000) +#define	MCFFEC_SIZE0		0x800 + +/* + *	QSPI module. + */ +#define	MCFQSPI_BASE		(MCF_IPSBAR + 0x340) +#define	MCFQSPI_SIZE		0x40 + +#define	MCFQSPI_CS0		147 +#define	MCFQSPI_CS1		148 +#define	MCFQSPI_CS2		149 +#define	MCFQSPI_CS3		150  /*   * 	GPIO registers   */ -#define MCFGPIO_PORTA		(MCF_IPSBAR + 0x00100000) -#define MCFGPIO_PORTB		(MCF_IPSBAR + 0x00100001) -#define MCFGPIO_PORTC		(MCF_IPSBAR + 0x00100002) -#define MCFGPIO_PORTD		(MCF_IPSBAR + 0x00100003) -#define MCFGPIO_PORTE		(MCF_IPSBAR + 0x00100004) -#define MCFGPIO_PORTF		(MCF_IPSBAR + 0x00100005) -#define MCFGPIO_PORTG		(MCF_IPSBAR + 0x00100006) -#define MCFGPIO_PORTH		(MCF_IPSBAR + 0x00100007) -#define MCFGPIO_PORTJ		(MCF_IPSBAR + 0x00100008) -#define MCFGPIO_PORTDD		(MCF_IPSBAR + 0x00100009) -#define MCFGPIO_PORTEH		(MCF_IPSBAR + 0x0010000A) -#define MCFGPIO_PORTEL		(MCF_IPSBAR + 0x0010000B) -#define MCFGPIO_PORTAS		(MCF_IPSBAR + 0x0010000C) -#define MCFGPIO_PORTQS		(MCF_IPSBAR + 0x0010000D) -#define MCFGPIO_PORTSD		(MCF_IPSBAR + 0x0010000E) -#define MCFGPIO_PORTTC		(MCF_IPSBAR + 0x0010000F) -#define MCFGPIO_PORTTD		(MCF_IPSBAR + 0x00100010) -#define MCFGPIO_PORTUA		(MCF_IPSBAR + 0x00100011) - -#define MCFGPIO_DDRA		(MCF_IPSBAR + 0x00100014) -#define MCFGPIO_DDRB		(MCF_IPSBAR + 0x00100015) -#define MCFGPIO_DDRC		(MCF_IPSBAR + 0x00100016) -#define MCFGPIO_DDRD		(MCF_IPSBAR + 0x00100017) -#define MCFGPIO_DDRE		(MCF_IPSBAR + 0x00100018) -#define MCFGPIO_DDRF		(MCF_IPSBAR + 0x00100019) -#define MCFGPIO_DDRG		(MCF_IPSBAR + 0x0010001A) -#define MCFGPIO_DDRH		(MCF_IPSBAR + 0x0010001B) -#define MCFGPIO_DDRJ		(MCF_IPSBAR + 0x0010001C) -#define MCFGPIO_DDRDD		(MCF_IPSBAR + 0x0010001D) -#define MCFGPIO_DDREH		(MCF_IPSBAR + 0x0010001E) -#define MCFGPIO_DDREL		(MCF_IPSBAR + 0x0010001F) -#define MCFGPIO_DDRAS		(MCF_IPSBAR + 0x00100020) -#define MCFGPIO_DDRQS		(MCF_IPSBAR + 0x00100021) -#define MCFGPIO_DDRSD		(MCF_IPSBAR + 0x00100022) -#define MCFGPIO_DDRTC		(MCF_IPSBAR + 0x00100023) -#define MCFGPIO_DDRTD		(MCF_IPSBAR + 0x00100024) -#define MCFGPIO_DDRUA		(MCF_IPSBAR + 0x00100025) - -#define MCFGPIO_PORTAP		(MCF_IPSBAR + 0x00100028) -#define MCFGPIO_PORTBP		(MCF_IPSBAR + 0x00100029) -#define MCFGPIO_PORTCP		(MCF_IPSBAR + 0x0010002A) -#define MCFGPIO_PORTDP		(MCF_IPSBAR + 0x0010002B) -#define MCFGPIO_PORTEP		(MCF_IPSBAR + 0x0010002C) -#define MCFGPIO_PORTFP		(MCF_IPSBAR + 0x0010002D) -#define MCFGPIO_PORTGP		(MCF_IPSBAR + 0x0010002E) -#define MCFGPIO_PORTHP		(MCF_IPSBAR + 0x0010002F) -#define MCFGPIO_PORTJP		(MCF_IPSBAR + 0x00100030) -#define MCFGPIO_PORTDDP		(MCF_IPSBAR + 0x00100031) -#define MCFGPIO_PORTEHP		(MCF_IPSBAR + 0x00100032) -#define MCFGPIO_PORTELP		(MCF_IPSBAR + 0x00100033) -#define MCFGPIO_PORTASP		(MCF_IPSBAR + 0x00100034) -#define MCFGPIO_PORTQSP		(MCF_IPSBAR + 0x00100035) -#define MCFGPIO_PORTSDP		(MCF_IPSBAR + 0x00100036) -#define MCFGPIO_PORTTCP		(MCF_IPSBAR + 0x00100037) -#define MCFGPIO_PORTTDP		(MCF_IPSBAR + 0x00100038) -#define MCFGPIO_PORTUAP		(MCF_IPSBAR + 0x00100039) - -#define MCFGPIO_SETA		(MCF_IPSBAR + 0x00100028) -#define MCFGPIO_SETB		(MCF_IPSBAR + 0x00100029) -#define MCFGPIO_SETC		(MCF_IPSBAR + 0x0010002A) -#define MCFGPIO_SETD		(MCF_IPSBAR + 0x0010002B) -#define MCFGPIO_SETE		(MCF_IPSBAR + 0x0010002C) -#define MCFGPIO_SETF		(MCF_IPSBAR + 0x0010002D) -#define MCFGPIO_SETG		(MCF_IPSBAR + 0x0010002E) -#define MCFGPIO_SETH		(MCF_IPSBAR + 0x0010002F) -#define MCFGPIO_SETJ		(MCF_IPSBAR + 0x00100030) -#define MCFGPIO_SETDD		(MCF_IPSBAR + 0x00100031) -#define MCFGPIO_SETEH		(MCF_IPSBAR + 0x00100032) -#define MCFGPIO_SETEL		(MCF_IPSBAR + 0x00100033) -#define MCFGPIO_SETAS		(MCF_IPSBAR + 0x00100034) -#define MCFGPIO_SETQS		(MCF_IPSBAR + 0x00100035) -#define MCFGPIO_SETSD		(MCF_IPSBAR + 0x00100036) -#define MCFGPIO_SETTC		(MCF_IPSBAR + 0x00100037) -#define MCFGPIO_SETTD		(MCF_IPSBAR + 0x00100038) -#define MCFGPIO_SETUA		(MCF_IPSBAR + 0x00100039) - -#define MCFGPIO_CLRA		(MCF_IPSBAR + 0x0010003C) -#define MCFGPIO_CLRB		(MCF_IPSBAR + 0x0010003D) -#define MCFGPIO_CLRC		(MCF_IPSBAR + 0x0010003E) -#define MCFGPIO_CLRD		(MCF_IPSBAR + 0x0010003F) -#define MCFGPIO_CLRE		(MCF_IPSBAR + 0x00100040) -#define MCFGPIO_CLRF		(MCF_IPSBAR + 0x00100041) -#define MCFGPIO_CLRG		(MCF_IPSBAR + 0x00100042) -#define MCFGPIO_CLRH		(MCF_IPSBAR + 0x00100043) -#define MCFGPIO_CLRJ		(MCF_IPSBAR + 0x00100044) -#define MCFGPIO_CLRDD		(MCF_IPSBAR + 0x00100045) -#define MCFGPIO_CLREH		(MCF_IPSBAR + 0x00100046) -#define MCFGPIO_CLREL		(MCF_IPSBAR + 0x00100047) -#define MCFGPIO_CLRAS		(MCF_IPSBAR + 0x00100048) -#define MCFGPIO_CLRQS		(MCF_IPSBAR + 0x00100049) -#define MCFGPIO_CLRSD		(MCF_IPSBAR + 0x0010004A) -#define MCFGPIO_CLRTC		(MCF_IPSBAR + 0x0010004B) -#define MCFGPIO_CLRTD		(MCF_IPSBAR + 0x0010004C) -#define MCFGPIO_CLRUA		(MCF_IPSBAR + 0x0010004D) +#define MCFGPIO_PODR_A		(MCF_IPSBAR + 0x00100000) +#define MCFGPIO_PODR_B		(MCF_IPSBAR + 0x00100001) +#define MCFGPIO_PODR_C		(MCF_IPSBAR + 0x00100002) +#define MCFGPIO_PODR_D		(MCF_IPSBAR + 0x00100003) +#define MCFGPIO_PODR_E		(MCF_IPSBAR + 0x00100004) +#define MCFGPIO_PODR_F		(MCF_IPSBAR + 0x00100005) +#define MCFGPIO_PODR_G		(MCF_IPSBAR + 0x00100006) +#define MCFGPIO_PODR_H		(MCF_IPSBAR + 0x00100007) +#define MCFGPIO_PODR_J		(MCF_IPSBAR + 0x00100008) +#define MCFGPIO_PODR_DD		(MCF_IPSBAR + 0x00100009) +#define MCFGPIO_PODR_EH		(MCF_IPSBAR + 0x0010000A) +#define MCFGPIO_PODR_EL		(MCF_IPSBAR + 0x0010000B) +#define MCFGPIO_PODR_AS		(MCF_IPSBAR + 0x0010000C) +#define MCFGPIO_PODR_QS		(MCF_IPSBAR + 0x0010000D) +#define MCFGPIO_PODR_SD		(MCF_IPSBAR + 0x0010000E) +#define MCFGPIO_PODR_TC		(MCF_IPSBAR + 0x0010000F) +#define MCFGPIO_PODR_TD		(MCF_IPSBAR + 0x00100010) +#define MCFGPIO_PODR_UA		(MCF_IPSBAR + 0x00100011) + +#define MCFGPIO_PDDR_A		(MCF_IPSBAR + 0x00100014) +#define MCFGPIO_PDDR_B		(MCF_IPSBAR + 0x00100015) +#define MCFGPIO_PDDR_C		(MCF_IPSBAR + 0x00100016) +#define MCFGPIO_PDDR_D		(MCF_IPSBAR + 0x00100017) +#define MCFGPIO_PDDR_E		(MCF_IPSBAR + 0x00100018) +#define MCFGPIO_PDDR_F		(MCF_IPSBAR + 0x00100019) +#define MCFGPIO_PDDR_G		(MCF_IPSBAR + 0x0010001A) +#define MCFGPIO_PDDR_H		(MCF_IPSBAR + 0x0010001B) +#define MCFGPIO_PDDR_J		(MCF_IPSBAR + 0x0010001C) +#define MCFGPIO_PDDR_DD		(MCF_IPSBAR + 0x0010001D) +#define MCFGPIO_PDDR_EH		(MCF_IPSBAR + 0x0010001E) +#define MCFGPIO_PDDR_EL		(MCF_IPSBAR + 0x0010001F) +#define MCFGPIO_PDDR_AS		(MCF_IPSBAR + 0x00100020) +#define MCFGPIO_PDDR_QS		(MCF_IPSBAR + 0x00100021) +#define MCFGPIO_PDDR_SD		(MCF_IPSBAR + 0x00100022) +#define MCFGPIO_PDDR_TC		(MCF_IPSBAR + 0x00100023) +#define MCFGPIO_PDDR_TD		(MCF_IPSBAR + 0x00100024) +#define MCFGPIO_PDDR_UA		(MCF_IPSBAR + 0x00100025) + +#define MCFGPIO_PPDSDR_A	(MCF_IPSBAR + 0x00100028) +#define MCFGPIO_PPDSDR_B	(MCF_IPSBAR + 0x00100029) +#define MCFGPIO_PPDSDR_C	(MCF_IPSBAR + 0x0010002A) +#define MCFGPIO_PPDSDR_D	(MCF_IPSBAR + 0x0010002B) +#define MCFGPIO_PPDSDR_E	(MCF_IPSBAR + 0x0010002C) +#define MCFGPIO_PPDSDR_F	(MCF_IPSBAR + 0x0010002D) +#define MCFGPIO_PPDSDR_G	(MCF_IPSBAR + 0x0010002E) +#define MCFGPIO_PPDSDR_H	(MCF_IPSBAR + 0x0010002F) +#define MCFGPIO_PPDSDR_J	(MCF_IPSBAR + 0x00100030) +#define MCFGPIO_PPDSDR_DD	(MCF_IPSBAR + 0x00100031) +#define MCFGPIO_PPDSDR_EH	(MCF_IPSBAR + 0x00100032) +#define MCFGPIO_PPDSDR_EL	(MCF_IPSBAR + 0x00100033) +#define MCFGPIO_PPDSDR_AS	(MCF_IPSBAR + 0x00100034) +#define MCFGPIO_PPDSDR_QS	(MCF_IPSBAR + 0x00100035) +#define MCFGPIO_PPDSDR_SD	(MCF_IPSBAR + 0x00100036) +#define MCFGPIO_PPDSDR_TC	(MCF_IPSBAR + 0x00100037) +#define MCFGPIO_PPDSDR_TD	(MCF_IPSBAR + 0x00100038) +#define MCFGPIO_PPDSDR_UA	(MCF_IPSBAR + 0x00100039) + +#define MCFGPIO_PCLRR_A		(MCF_IPSBAR + 0x0010003C) +#define MCFGPIO_PCLRR_B		(MCF_IPSBAR + 0x0010003D) +#define MCFGPIO_PCLRR_C		(MCF_IPSBAR + 0x0010003E) +#define MCFGPIO_PCLRR_D		(MCF_IPSBAR + 0x0010003F) +#define MCFGPIO_PCLRR_E		(MCF_IPSBAR + 0x00100040) +#define MCFGPIO_PCLRR_F		(MCF_IPSBAR + 0x00100041) +#define MCFGPIO_PCLRR_G		(MCF_IPSBAR + 0x00100042) +#define MCFGPIO_PCLRR_H		(MCF_IPSBAR + 0x00100043) +#define MCFGPIO_PCLRR_J		(MCF_IPSBAR + 0x00100044) +#define MCFGPIO_PCLRR_DD	(MCF_IPSBAR + 0x00100045) +#define MCFGPIO_PCLRR_EH	(MCF_IPSBAR + 0x00100046) +#define MCFGPIO_PCLRR_EL	(MCF_IPSBAR + 0x00100047) +#define MCFGPIO_PCLRR_AS	(MCF_IPSBAR + 0x00100048) +#define MCFGPIO_PCLRR_QS	(MCF_IPSBAR + 0x00100049) +#define MCFGPIO_PCLRR_SD	(MCF_IPSBAR + 0x0010004A) +#define MCFGPIO_PCLRR_TC	(MCF_IPSBAR + 0x0010004B) +#define MCFGPIO_PCLRR_TD	(MCF_IPSBAR + 0x0010004C) +#define MCFGPIO_PCLRR_UA	(MCF_IPSBAR + 0x0010004D)  #define MCFGPIO_PBCDPAR		(MCF_IPSBAR + 0x00100050)  #define MCFGPIO_PFPAR		(MCF_IPSBAR + 0x00100051) @@ -152,6 +186,14 @@  #define MCFGPIO_PUAPAR		(MCF_IPSBAR + 0x0010005C)  /* + * PIT timer base addresses. + */ +#define	MCFPIT_BASE1		(MCF_IPSBAR + 0x00150000) +#define	MCFPIT_BASE2		(MCF_IPSBAR + 0x00160000) +#define	MCFPIT_BASE3		(MCF_IPSBAR + 0x00170000) +#define	MCFPIT_BASE4		(MCF_IPSBAR + 0x00180000) + +/*   * 	Edge Port registers   */  #define MCFEPORT_EPPAR		(MCF_IPSBAR + 0x00130000) @@ -181,73 +223,24 @@   * definitions for generic gpio support   *   */ -#define MCFGPIO_PODR		MCFGPIO_PORTA	/* port output data */ -#define MCFGPIO_PDDR		MCFGPIO_DDRA	/* port data direction */ -#define MCFGPIO_PPDR		MCFGPIO_PORTAP	/* port pin data */ -#define MCFGPIO_SETR		MCFGPIO_SETA	/* set output */ -#define MCFGPIO_CLRR		MCFGPIO_CLRA	/* clr output */ +#define MCFGPIO_PODR		MCFGPIO_PODR_A	/* port output data */ +#define MCFGPIO_PDDR		MCFGPIO_PDDR_A	/* port data direction */ +#define MCFGPIO_PPDR		MCFGPIO_PPDSDR_A/* port pin data */ +#define MCFGPIO_SETR		MCFGPIO_PPDSDR_A/* set output */ +#define MCFGPIO_CLRR		MCFGPIO_PCLRR_A	/* clr output */  #define MCFGPIO_IRQ_MAX		8  #define MCFGPIO_IRQ_VECBASE	MCFINT_VECBASE  #define MCFGPIO_PIN_MAX		180 - -/* - *	Derek Cheung - 6 Feb 2005 - *		add I2C and QSPI register definition using Freescale's MCF5282 - */ -/* set Port AS pin for I2C or UART */ -#define MCF5282_GPIO_PASPAR     (volatile u16 *) (MCF_IPSBAR + 0x00100056) - -/* Port UA Pin Assignment Register (8 Bit) */ -#define MCF5282_GPIO_PUAPAR	0x10005C - -/* Interrupt Mask Register Register Low */  -#define MCF5282_INTC0_IMRL      (volatile u32 *) (MCF_IPSBAR + 0x0C0C) -/* Interrupt Control Register 7 */ -#define MCF5282_INTC0_ICR17     (volatile u8 *) (MCF_IPSBAR + 0x0C51) - -  /*   *  Reset Control Unit (relative to IPSBAR).   */ -#define	MCF_RCR			0x110000 -#define	MCF_RSR			0x110001 +#define	MCF_RCR			(MCF_IPSBAR + 0x110000) +#define	MCF_RSR			(MCF_IPSBAR + 0x110001)  #define	MCF_RCR_SWRESET		0x80		/* Software reset bit */  #define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ -/********************************************************************* -* -* Inter-IC (I2C) Module -* -*********************************************************************/ -/* Read/Write access macros for general use */ -#define MCF5282_I2C_I2ADR       (volatile u8 *) (MCF_IPSBAR + 0x0300) // Address  -#define MCF5282_I2C_I2FDR       (volatile u8 *) (MCF_IPSBAR + 0x0304) // Freq Divider -#define MCF5282_I2C_I2CR        (volatile u8 *) (MCF_IPSBAR + 0x0308) // Control -#define MCF5282_I2C_I2SR        (volatile u8 *) (MCF_IPSBAR + 0x030C) // Status -#define MCF5282_I2C_I2DR        (volatile u8 *) (MCF_IPSBAR + 0x0310) // Data I/O - -/* Bit level definitions and macros */ -#define MCF5282_I2C_I2ADR_ADDR(x)                       (((x)&0x7F)<<0x01) - -#define MCF5282_I2C_I2FDR_IC(x)                         (((x)&0x3F)) - -#define MCF5282_I2C_I2CR_IEN    (0x80)	// I2C enable -#define MCF5282_I2C_I2CR_IIEN   (0x40)  // interrupt enable -#define MCF5282_I2C_I2CR_MSTA   (0x20)  // master/slave mode -#define MCF5282_I2C_I2CR_MTX    (0x10)  // transmit/receive mode -#define MCF5282_I2C_I2CR_TXAK   (0x08)  // transmit acknowledge enable -#define MCF5282_I2C_I2CR_RSTA   (0x04)  // repeat start - -#define MCF5282_I2C_I2SR_ICF    (0x80)  // data transfer bit -#define MCF5282_I2C_I2SR_IAAS   (0x40)  // I2C addressed as a slave -#define MCF5282_I2C_I2SR_IBB    (0x20)  // I2C bus busy -#define MCF5282_I2C_I2SR_IAL    (0x10)  // aribitration lost -#define MCF5282_I2C_I2SR_SRW    (0x04)  // slave read/write -#define MCF5282_I2C_I2SR_IIF    (0x02)  // I2C interrupt -#define MCF5282_I2C_I2SR_RXAK   (0x01)  // received acknowledge - - +/****************************************************************************/  #endif	/* m528xsim_h */ diff --git a/arch/m68k/include/asm/m52xxacr.h b/arch/m68k/include/asm/m52xxacr.h new file mode 100644 index 00000000000..abc391a9ae8 --- /dev/null +++ b/arch/m68k/include/asm/m52xxacr.h @@ -0,0 +1,94 @@ +/****************************************************************************/ + +/* + * m52xxacr.h -- ColdFire version 2 core cache support + * + * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com> + */ + +/****************************************************************************/ +#ifndef m52xxacr_h +#define m52xxacr_h +/****************************************************************************/ + +/* + * All varients of the ColdFire using version 2 cores have a similar + * cache setup. Although not absolutely identical the cache register + * definitions are compatible for all of them. Mostly they support a + * configurable cache memory that can be instruction only, data only, + * or split instruction and data. The exception is the very old version 2 + * core based parts, like the 5206(e), 5249 and 5272, which are instruction + * cache only. Cache size varies from 2k up to 16k. + */ + +/* + * Define the Cache Control register flags. + */ +#define CACR_CENB	0x80000000	/* Enable cache */ +#define CACR_CDPI	0x10000000	/* Disable invalidation by CPUSHL */ +#define CACR_CFRZ	0x08000000	/* Cache freeze mode */ +#define CACR_CINV	0x01000000	/* Invalidate cache */ +#define CACR_DISI	0x00800000	/* Disable instruction cache */ +#define CACR_DISD	0x00400000	/* Disable data cache */ +#define CACR_INVI	0x00200000	/* Invalidate instruction cache */ +#define CACR_INVD	0x00100000	/* Invalidate data cache */ +#define CACR_CEIB	0x00000400	/* Non-cachable instruction burst */ +#define CACR_DCM	0x00000200	/* Default cache mode */ +#define CACR_DBWE	0x00000100	/* Buffered write enable */ +#define CACR_DWP	0x00000020	/* Write protection */ +#define CACR_EUSP	0x00000010	/* Enable separate user a7 */ + +/* + * Define the Access Control register flags. + */ +#define ACR_BASE_POS	24		/* Address Base (upper 8 bits) */ +#define ACR_MASK_POS	16		/* Address Mask (next 8 bits) */ +#define ACR_ENABLE	0x00008000	/* Enable this ACR */ +#define ACR_USER	0x00000000	/* Allow only user accesses */ +#define ACR_SUPER	0x00002000	/* Allow supervisor access only */ +#define ACR_ANY		0x00004000	/* Allow any access type */ +#define ACR_CENB	0x00000000	/* Caching of region enabled */ +#define ACR_CDIS	0x00000040	/* Caching of region disabled */ +#define ACR_BWE		0x00000020	/* Write buffer enabled */ +#define ACR_WPROTECT	0x00000004	/* Write protect region */ + +/* + * Set the cache controller settings we will use. On the cores that support + * a split cache configuration we allow all the combinations at Kconfig + * time. For those cores that only have an instruction cache we just set + * that as on. + */ +#if defined(CONFIG_CACHE_I) +#define CACHE_TYPE	(CACR_DISD + CACR_EUSP) +#define CACHE_INVTYPEI	0 +#elif defined(CONFIG_CACHE_D) +#define CACHE_TYPE	(CACR_DISI + CACR_EUSP) +#define CACHE_INVTYPED	0 +#elif defined(CONFIG_CACHE_BOTH) +#define CACHE_TYPE	CACR_EUSP +#define CACHE_INVTYPEI	CACR_INVI +#define CACHE_INVTYPED	CACR_INVD +#else +/* This is the instruction cache only devices (no split cache, no eusp) */ +#define CACHE_TYPE	0 +#define CACHE_INVTYPEI	0 +#endif + +#define CACHE_INIT	(CACR_CINV + CACHE_TYPE) +#define CACHE_MODE	(CACR_CENB + CACHE_TYPE + CACR_DCM) + +#define CACHE_INVALIDATE  (CACHE_MODE + CACR_CINV) +#if defined(CACHE_INVTYPEI) +#define CACHE_INVALIDATEI (CACHE_MODE + CACR_CINV + CACHE_INVTYPEI) +#endif +#if defined(CACHE_INVTYPED) +#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINV + CACHE_INVTYPED) +#endif + +#define ACR0_MODE	((CONFIG_RAMBASE & 0xff000000) + \ +			 (0x000f0000) + \ +			 (ACR_ENABLE + ACR_ANY + ACR_CENB + ACR_BWE)) +#define ACR1_MODE	0 + +/****************************************************************************/ +#endif  /* m52xxsim_h */ diff --git a/arch/m68k/include/asm/m5307sim.h b/arch/m68k/include/asm/m5307sim.h index c6830e5b54c..5d0bb7ec31f 100644 --- a/arch/m68k/include/asm/m5307sim.h +++ b/arch/m68k/include/asm/m5307sim.h @@ -14,91 +14,122 @@  #define	m5307sim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m5307)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m53xxacr.h> +  /*   *	Define the 5307 SIM register set addresses.   */ -#define	MCFSIM_RSR		0x00		/* Reset Status reg (r/w) */ -#define	MCFSIM_SYPCR		0x01		/* System Protection reg (r/w)*/ -#define	MCFSIM_SWIVR		0x02		/* SW Watchdog intr reg (r/w) */ -#define	MCFSIM_SWSR		0x03		/* SW Watchdog service (r/w) */ -#define	MCFSIM_PAR		0x04		/* Pin Assignment reg (r/w) */ -#define	MCFSIM_IRQPAR		0x06		/* Interrupt Assignment reg (r/w) */ -#define	MCFSIM_PLLCR		0x08		/* PLL Controll Reg*/ -#define	MCFSIM_MPARK		0x0C		/* BUS Master Control Reg*/ -#define	MCFSIM_IPR		0x40		/* Interrupt Pend reg (r/w) */ -#define	MCFSIM_IMR		0x44		/* Interrupt Mask reg (r/w) */ -#define	MCFSIM_AVR		0x4b		/* Autovector Ctrl reg (r/w) */ -#define	MCFSIM_ICR0		0x4c		/* Intr Ctrl reg 0 (r/w) */ -#define	MCFSIM_ICR1		0x4d		/* Intr Ctrl reg 1 (r/w) */ -#define	MCFSIM_ICR2		0x4e		/* Intr Ctrl reg 2 (r/w) */ -#define	MCFSIM_ICR3		0x4f		/* Intr Ctrl reg 3 (r/w) */ -#define	MCFSIM_ICR4		0x50		/* Intr Ctrl reg 4 (r/w) */ -#define	MCFSIM_ICR5		0x51		/* Intr Ctrl reg 5 (r/w) */ -#define	MCFSIM_ICR6		0x52		/* Intr Ctrl reg 6 (r/w) */ -#define	MCFSIM_ICR7		0x53		/* Intr Ctrl reg 7 (r/w) */ -#define	MCFSIM_ICR8		0x54		/* Intr Ctrl reg 8 (r/w) */ -#define	MCFSIM_ICR9		0x55		/* Intr Ctrl reg 9 (r/w) */ -#define	MCFSIM_ICR10		0x56		/* Intr Ctrl reg 10 (r/w) */ -#define	MCFSIM_ICR11		0x57		/* Intr Ctrl reg 11 (r/w) */ - -#define MCFSIM_CSAR0		0x80		/* CS 0 Address 0 reg (r/w) */ -#define MCFSIM_CSMR0		0x84		/* CS 0 Mask 0 reg (r/w) */ -#define MCFSIM_CSCR0		0x8a		/* CS 0 Control reg (r/w) */ -#define MCFSIM_CSAR1		0x8c		/* CS 1 Address reg (r/w) */ -#define MCFSIM_CSMR1		0x90		/* CS 1 Mask reg (r/w) */ -#define MCFSIM_CSCR1		0x96		/* CS 1 Control reg (r/w) */ +#define	MCFSIM_RSR		(MCF_MBAR + 0x00)	/* Reset Status reg */ +#define	MCFSIM_SYPCR		(MCF_MBAR + 0x01)	/* System Protection */ +#define	MCFSIM_SWIVR		(MCF_MBAR + 0x02)	/* SW Watchdog intr */ +#define	MCFSIM_SWSR		(MCF_MBAR + 0x03)	/* SW Watchdog service*/ +#define	MCFSIM_PAR		(MCF_MBAR + 0x04)	/* Pin Assignment */ +#define	MCFSIM_IRQPAR		(MCF_MBAR + 0x06)	/* Itr Assignment */ +#define	MCFSIM_PLLCR		(MCF_MBAR + 0x08)	/* PLL Ctrl Reg */ +#define	MCFSIM_MPARK		(MCF_MBAR + 0x0C)	/* BUS Master Ctrl */ +#define	MCFSIM_IPR		(MCF_MBAR + 0x40)	/* Interrupt Pend */ +#define	MCFSIM_IMR		(MCF_MBAR + 0x44)	/* Interrupt Mask */ +#define	MCFSIM_AVR		(MCF_MBAR + 0x4b)	/* Autovector Ctrl */ +#define	MCFSIM_ICR0		(MCF_MBAR + 0x4c)	/* Intr Ctrl reg 0 */ +#define	MCFSIM_ICR1		(MCF_MBAR + 0x4d)	/* Intr Ctrl reg 1 */ +#define	MCFSIM_ICR2		(MCF_MBAR + 0x4e)	/* Intr Ctrl reg 2 */ +#define	MCFSIM_ICR3		(MCF_MBAR + 0x4f)	/* Intr Ctrl reg 3 */ +#define	MCFSIM_ICR4		(MCF_MBAR + 0x50)	/* Intr Ctrl reg 4 */ +#define	MCFSIM_ICR5		(MCF_MBAR + 0x51)	/* Intr Ctrl reg 5 */ +#define	MCFSIM_ICR6		(MCF_MBAR + 0x52)	/* Intr Ctrl reg 6 */ +#define	MCFSIM_ICR7		(MCF_MBAR + 0x53)	/* Intr Ctrl reg 7 */ +#define	MCFSIM_ICR8		(MCF_MBAR + 0x54)	/* Intr Ctrl reg 8 */ +#define	MCFSIM_ICR9		(MCF_MBAR + 0x55)	/* Intr Ctrl reg 9 */ +#define	MCFSIM_ICR10		(MCF_MBAR + 0x56)	/* Intr Ctrl reg 10 */ +#define	MCFSIM_ICR11		(MCF_MBAR + 0x57)	/* Intr Ctrl reg 11 */ + +#define MCFSIM_CSAR0		(MCF_MBAR + 0x80)	/* CS 0 Address reg */ +#define MCFSIM_CSMR0		(MCF_MBAR + 0x84)	/* CS 0 Mask reg */ +#define MCFSIM_CSCR0		(MCF_MBAR + 0x8a)	/* CS 0 Control reg */ +#define MCFSIM_CSAR1		(MCF_MBAR + 0x8c)	/* CS 1 Address reg */ +#define MCFSIM_CSMR1		(MCF_MBAR + 0x90)	/* CS 1 Mask reg */ +#define MCFSIM_CSCR1		(MCF_MBAR + 0x96)	/* CS 1 Control reg */  #ifdef CONFIG_OLDMASK -#define MCFSIM_CSBAR		0x98		/* CS Base Address reg (r/w) */ -#define MCFSIM_CSBAMR		0x9c		/* CS Base Mask reg (r/w) */ -#define MCFSIM_CSMR2		0x9e		/* CS 2 Mask reg (r/w) */ -#define MCFSIM_CSCR2		0xa2		/* CS 2 Control reg (r/w) */ -#define MCFSIM_CSMR3		0xaa		/* CS 3 Mask reg (r/w) */ -#define MCFSIM_CSCR3		0xae		/* CS 3 Control reg (r/w) */ -#define MCFSIM_CSMR4		0xb6		/* CS 4 Mask reg (r/w) */ -#define MCFSIM_CSCR4		0xba		/* CS 4 Control reg (r/w) */ -#define MCFSIM_CSMR5		0xc2		/* CS 5 Mask reg (r/w) */ -#define MCFSIM_CSCR5		0xc6		/* CS 5 Control reg (r/w) */ -#define MCFSIM_CSMR6		0xce		/* CS 6 Mask reg (r/w) */ -#define MCFSIM_CSCR6		0xd2		/* CS 6 Control reg (r/w) */ -#define MCFSIM_CSMR7		0xda		/* CS 7 Mask reg (r/w) */ -#define MCFSIM_CSCR7		0xde		/* CS 7 Control reg (r/w) */ +#define MCFSIM_CSBAR		(MCF_MBAR + 0x98)	/* CS Base Address */ +#define MCFSIM_CSBAMR		(MCF_MBAR + 0x9c)	/* CS Base Mask */ +#define MCFSIM_CSMR2		(MCF_MBAR + 0x9e)	/* CS 2 Mask reg */ +#define MCFSIM_CSCR2		(MCF_MBAR + 0xa2)	/* CS 2 Control reg */ +#define MCFSIM_CSMR3		(MCF_MBAR + 0xaa)	/* CS 3 Mask reg */ +#define MCFSIM_CSCR3		(MCF_MBAR + 0xae)	/* CS 3 Control reg */ +#define MCFSIM_CSMR4		(MCF_MBAR + 0xb6)	/* CS 4 Mask reg */ +#define MCFSIM_CSCR4		(MCF_MBAR + 0xba)	/* CS 4 Control reg */ +#define MCFSIM_CSMR5		(MCF_MBAR + 0xc2)	/* CS 5 Mask reg */ +#define MCFSIM_CSCR5		(MCF_MBAR + 0xc6)	/* CS 5 Control reg */ +#define MCFSIM_CSMR6		(MCF_MBAR + 0xce)	/* CS 6 Mask reg */ +#define MCFSIM_CSCR6		(MCF_MBAR + 0xd2)	/* CS 6 Control reg */ +#define MCFSIM_CSMR7		(MCF_MBAR + 0xda)	/* CS 7 Mask reg */ +#define MCFSIM_CSCR7		(MCF_MBAR + 0xde)	/* CS 7 Control reg */  #else -#define MCFSIM_CSAR2		0x98		/* CS 2 Address reg (r/w) */ -#define MCFSIM_CSMR2		0x9c		/* CS 2 Mask reg (r/w) */ -#define MCFSIM_CSCR2		0xa2		/* CS 2 Control reg (r/w) */ -#define MCFSIM_CSAR3		0xa4		/* CS 3 Address reg (r/w) */ -#define MCFSIM_CSMR3		0xa8		/* CS 3 Mask reg (r/w) */ -#define MCFSIM_CSCR3		0xae		/* CS 3 Control reg (r/w) */ -#define MCFSIM_CSAR4		0xb0		/* CS 4 Address reg (r/w) */ -#define MCFSIM_CSMR4		0xb4		/* CS 4 Mask reg (r/w) */ -#define MCFSIM_CSCR4		0xba		/* CS 4 Control reg (r/w) */ -#define MCFSIM_CSAR5		0xbc		/* CS 5 Address reg (r/w) */ -#define MCFSIM_CSMR5		0xc0		/* CS 5 Mask reg (r/w) */ -#define MCFSIM_CSCR5		0xc6		/* CS 5 Control reg (r/w) */ -#define MCFSIM_CSAR6		0xc8		/* CS 6 Address reg (r/w) */ -#define MCFSIM_CSMR6		0xcc		/* CS 6 Mask reg (r/w) */ -#define MCFSIM_CSCR6		0xd2		/* CS 6 Control reg (r/w) */ -#define MCFSIM_CSAR7		0xd4		/* CS 7 Address reg (r/w) */ -#define MCFSIM_CSMR7		0xd8		/* CS 7 Mask reg (r/w) */ -#define MCFSIM_CSCR7		0xde		/* CS 7 Control reg (r/w) */ +#define MCFSIM_CSAR2		(MCF_MBAR + 0x98)	/* CS 2 Address reg */ +#define MCFSIM_CSMR2		(MCF_MBAR + 0x9c)	/* CS 2 Mask reg */ +#define MCFSIM_CSCR2		(MCF_MBAR + 0xa2)	/* CS 2 Control reg */ +#define MCFSIM_CSAR3		(MCF_MBAR + 0xa4)	/* CS 3 Address reg */ +#define MCFSIM_CSMR3		(MCF_MBAR + 0xa8)	/* CS 3 Mask reg */ +#define MCFSIM_CSCR3		(MCF_MBAR + 0xae)	/* CS 3 Control reg */ +#define MCFSIM_CSAR4		(MCF_MBAR + 0xb0)	/* CS 4 Address reg */ +#define MCFSIM_CSMR4		(MCF_MBAR + 0xb4)	/* CS 4 Mask reg */ +#define MCFSIM_CSCR4		(MCF_MBAR + 0xba)	/* CS 4 Control reg */ +#define MCFSIM_CSAR5		(MCF_MBAR + 0xbc)	/* CS 5 Address reg */ +#define MCFSIM_CSMR5		(MCF_MBAR + 0xc0)	/* CS 5 Mask reg */ +#define MCFSIM_CSCR5		(MCF_MBAR + 0xc6)	/* CS 5 Control reg */ +#define MCFSIM_CSAR6		(MCF_MBAR + 0xc8)	/* CS 6 Address reg */ +#define MCFSIM_CSMR6		(MCF_MBAR + 0xcc)	/* CS 6 Mask reg */ +#define MCFSIM_CSCR6		(MCF_MBAR + 0xd2)	/* CS 6 Control reg */ +#define MCFSIM_CSAR7		(MCF_MBAR + 0xd4)	/* CS 7 Address reg */ +#define MCFSIM_CSMR7		(MCF_MBAR + 0xd8)	/* CS 7 Mask reg */ +#define MCFSIM_CSCR7		(MCF_MBAR + 0xde)	/* CS 7 Control reg */  #endif /* CONFIG_OLDMASK */ -#define MCFSIM_DCR		0x100		/* DRAM Control reg (r/w) */ -#define MCFSIM_DACR0		0x108		/* DRAM 0 Addr and Ctrl (r/w) */ -#define MCFSIM_DMR0		0x10c		/* DRAM 0 Mask reg (r/w) */ -#define MCFSIM_DACR1		0x110		/* DRAM 1 Addr and Ctrl (r/w) */ -#define MCFSIM_DMR1		0x114		/* DRAM 1 Mask reg (r/w) */ +#define MCFSIM_DCR		(MCF_MBAR + 0x100)	/* DRAM Control */ +#define MCFSIM_DACR0		(MCF_MBAR + 0x108)	/* DRAM Addr/Ctrl 0 */ +#define MCFSIM_DMR0		(MCF_MBAR + 0x10c)	/* DRAM Mask 0 */ +#define MCFSIM_DACR1		(MCF_MBAR + 0x110)	/* DRAM Addr/Ctrl 1 */ +#define MCFSIM_DMR1		(MCF_MBAR + 0x114)	/* DRAM Mask 1 */ + +/* + *  Timer module. + */ +#define MCFTIMER_BASE1		(MCF_MBAR + 0x140)	/* Base of TIMER1 */ +#define MCFTIMER_BASE2		(MCF_MBAR + 0x180)	/* Base of TIMER2 */  #define	MCFSIM_PADDR		(MCF_MBAR + 0x244)  #define	MCFSIM_PADAT		(MCF_MBAR + 0x248)  /* + *  DMA unit base addresses. + */ +#define MCFDMA_BASE0		(MCF_MBAR + 0x300)	/* Base address DMA 0 */ +#define MCFDMA_BASE1		(MCF_MBAR + 0x340)	/* Base address DMA 1 */ +#define MCFDMA_BASE2		(MCF_MBAR + 0x380)	/* Base address DMA 2 */ +#define MCFDMA_BASE3		(MCF_MBAR + 0x3C0)	/* Base address DMA 3 */ + +/* + *  UART module. + */ +#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3) +#define MCFUART_BASE0		(MCF_MBAR + 0x200)	/* Base address UART0 */ +#define MCFUART_BASE1		(MCF_MBAR + 0x1c0)	/* Base address UART1 */ +#else +#define MCFUART_BASE0		(MCF_MBAR + 0x1c0)	/* Base address UART0 */ +#define MCFUART_BASE1		(MCF_MBAR + 0x200)	/* Base address UART1 */ +#endif + +/*   * Generic GPIO support   */ -#define MCFGPIO_PIN_MAX			16 -#define MCFGPIO_IRQ_MAX			-1 -#define MCFGPIO_IRQ_VECBASE		-1 +#define MCFGPIO_PIN_MAX		16 +#define MCFGPIO_IRQ_MAX		-1 +#define MCFGPIO_IRQ_VECBASE	-1  /* Definition offset address for CS2-7  -- old mask 5307 */ @@ -136,42 +167,17 @@  /*   *       Defines for the IRQPAR Register   */ -#define IRQ5_LEVEL4	0x80 -#define IRQ3_LEVEL6	0x40 -#define IRQ1_LEVEL2	0x20 +#define IRQ5_LEVEL4		0x80 +#define IRQ3_LEVEL6		0x40 +#define IRQ1_LEVEL2		0x20  /*   *	Define system peripheral IRQ usage.   */  #define	MCF_IRQ_TIMER		30		/* Timer0, Level 6 */  #define	MCF_IRQ_PROFILER	31		/* Timer1, Level 7 */ - -/* - *	Define the Cache register flags. - */ -#define	CACR_EC			(1<<31) -#define	CACR_ESB		(1<<29) -#define	CACR_DPI		(1<<28) -#define	CACR_HLCK		(1<<27) -#define	CACR_CINVA		(1<<24) -#define	CACR_DNFB		(1<<10) -#define	CACR_DCM_WTHRU		(0<<8) -#define	CACR_DCM_WBACK		(1<<8) -#define	CACR_DCM_OFF_PRE	(2<<8) -#define	CACR_DCM_OFF_IMP	(3<<8) -#define	CACR_DW			(1<<5) - -#define	ACR_BASE_POS		24 -#define	ACR_MASK_POS		16 -#define	ACR_ENABLE		(1<<15) -#define	ACR_USER		(0<<13) -#define	ACR_SUPER		(1<<13) -#define	ACR_ANY			(2<<13) -#define	ACR_CM_WTHRU		(0<<5) -#define	ACR_CM_WBACK		(1<<5) -#define	ACR_CM_OFF_PRE		(2<<5) -#define	ACR_CM_OFF_IMP		(3<<5) -#define	ACR_WPROTECT		(1<<2) +#define	MCF_IRQ_UART0		73		/* UART0 */ +#define	MCF_IRQ_UART1		74		/* UART1 */  /****************************************************************************/  #endif	/* m5307sim_h */ diff --git a/arch/m68k/include/asm/m532xsim.h b/arch/m68k/include/asm/m532xsim.h deleted file mode 100644 index c4bf1c81e3c..00000000000 --- a/arch/m68k/include/asm/m532xsim.h +++ /dev/null @@ -1,2240 +0,0 @@ -/****************************************************************************/ - -/* - *	m532xsim.h -- ColdFire 5329 registers - */ - -/****************************************************************************/ -#ifndef	m532xsim_h -#define	m532xsim_h -/****************************************************************************/ - -#define MCF_REG32(x) (*(volatile unsigned long  *)(x)) -#define MCF_REG16(x) (*(volatile unsigned short *)(x)) -#define MCF_REG08(x) (*(volatile unsigned char  *)(x)) - -#define MCFINT_VECBASE      64 -#define MCFINT_UART0        26          /* Interrupt number for UART0 */ -#define MCFINT_UART1        27          /* Interrupt number for UART1 */ -#define MCFINT_UART2        28          /* Interrupt number for UART2 */ -#define MCFINT_QSPI         31          /* Interrupt number for QSPI */ - -#define MCF_WTM_WCR	MCF_REG16(0xFC098000) - -/* - *	Define the 532x SIM register set addresses. - */ -#define	MCFSIM_IPRL		0xFC048004 -#define	MCFSIM_IPRH		0xFC048000 -#define	MCFSIM_IPR		MCFSIM_IPRL -#define	MCFSIM_IMRL		0xFC04800C -#define	MCFSIM_IMRH		0xFC048008 -#define	MCFSIM_IMR		MCFSIM_IMRL -#define	MCFSIM_ICR0		0xFC048040	 -#define	MCFSIM_ICR1		0xFC048041	 -#define	MCFSIM_ICR2		0xFC048042	 -#define	MCFSIM_ICR3		0xFC048043	 -#define	MCFSIM_ICR4		0xFC048044	 -#define	MCFSIM_ICR5		0xFC048045	 -#define	MCFSIM_ICR6		0xFC048046	 -#define	MCFSIM_ICR7		0xFC048047	 -#define	MCFSIM_ICR8		0xFC048048	 -#define	MCFSIM_ICR9		0xFC048049	 -#define	MCFSIM_ICR10		0xFC04804A -#define	MCFSIM_ICR11		0xFC04804B - -/* - *	Some symbol defines for the above... - */ -#define	MCFSIM_SWDICR		MCFSIM_ICR0	/* Watchdog timer ICR */ -#define	MCFSIM_TIMER1ICR	MCFSIM_ICR1	/* Timer 1 ICR */ -#define	MCFSIM_TIMER2ICR	MCFSIM_ICR2	/* Timer 2 ICR */ -#define	MCFSIM_UART1ICR		MCFSIM_ICR4	/* UART 1 ICR */ -#define	MCFSIM_UART2ICR		MCFSIM_ICR5	/* UART 2 ICR */ -#define	MCFSIM_DMA0ICR		MCFSIM_ICR6	/* DMA 0 ICR */ -#define	MCFSIM_DMA1ICR		MCFSIM_ICR7	/* DMA 1 ICR */ -#define	MCFSIM_DMA2ICR		MCFSIM_ICR8	/* DMA 2 ICR */ -#define	MCFSIM_DMA3ICR		MCFSIM_ICR9	/* DMA 3 ICR */ - - -#define	MCFINTC0_SIMR		0xFC04801C -#define	MCFINTC0_CIMR		0xFC04801D -#define	MCFINTC0_ICR0		0xFC048040 -#define	MCFINTC1_SIMR		0xFC04C01C -#define	MCFINTC1_CIMR		0xFC04C01D -#define	MCFINTC1_ICR0		0xFC04C040 - -#define MCFSIM_ICR_TIMER1	(0xFC048040+32) -#define MCFSIM_ICR_TIMER2	(0xFC048040+33) - -/* - *	Define system peripheral IRQ usage. - */ -#define	MCF_IRQ_TIMER		(64 + 32)	/* Timer0 */ -#define	MCF_IRQ_PROFILER	(64 + 33)	/* Timer1 */ - -/* - *	Define the Cache register flags. - */ -#define	CACR_EC			(1<<31) -#define	CACR_ESB		(1<<29) -#define	CACR_DPI		(1<<28) -#define	CACR_HLCK		(1<<27) -#define	CACR_CINVA		(1<<24) -#define	CACR_DNFB		(1<<10) -#define	CACR_DCM_WTHRU		(0<<8) -#define	CACR_DCM_WBACK		(1<<8) -#define	CACR_DCM_OFF_PRE	(2<<8) -#define	CACR_DCM_OFF_IMP	(3<<8) -#define	CACR_DW			(1<<5) - -#define	ACR_BASE_POS		24 -#define	ACR_MASK_POS		16 -#define	ACR_ENABLE		(1<<15) -#define	ACR_USER		(0<<13) -#define	ACR_SUPER		(1<<13) -#define	ACR_ANY			(2<<13) -#define	ACR_CM_WTHRU		(0<<5) -#define	ACR_CM_WBACK		(1<<5) -#define	ACR_CM_OFF_PRE		(2<<5) -#define	ACR_CM_OFF_IMP		(3<<5) -#define	ACR_WPROTECT		(1<<2) - -/********************************************************************* - * - * Reset Controller Module - * - *********************************************************************/ - -#define	MCF_RCR			0xFC0A0000 -#define	MCF_RSR			0xFC0A0001 - -#define	MCF_RCR_SWRESET		0x80		/* Software reset bit */ -#define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ - -/********************************************************************* - * - * Inter-IC (I2C) Module - * - *********************************************************************/ - -/* Read/Write access macros for general use */ -#define MCF532x_I2C_I2ADR       (volatile u8 *) (0xFC058000) // Address  -#define MCF532x_I2C_I2FDR       (volatile u8 *) (0xFC058004) // Freq Divider -#define MCF532x_I2C_I2CR        (volatile u8 *) (0xFC058008) // Control -#define MCF532x_I2C_I2SR        (volatile u8 *) (0xFC05800C) // Status -#define MCF532x_I2C_I2DR        (volatile u8 *) (0xFC058010) // Data I/O - -/* Bit level definitions and macros */ -#define MCF532x_I2C_I2ADR_ADDR(x)                       (((x)&0x7F)<<0x01) - -#define MCF532x_I2C_I2FDR_IC(x)                         (((x)&0x3F)) - -#define MCF532x_I2C_I2CR_IEN    (0x80)	// I2C enable -#define MCF532x_I2C_I2CR_IIEN   (0x40)  // interrupt enable -#define MCF532x_I2C_I2CR_MSTA   (0x20)  // master/slave mode -#define MCF532x_I2C_I2CR_MTX    (0x10)  // transmit/receive mode -#define MCF532x_I2C_I2CR_TXAK   (0x08)  // transmit acknowledge enable -#define MCF532x_I2C_I2CR_RSTA   (0x04)  // repeat start - -#define MCF532x_I2C_I2SR_ICF    (0x80)  // data transfer bit -#define MCF532x_I2C_I2SR_IAAS   (0x40)  // I2C addressed as a slave -#define MCF532x_I2C_I2SR_IBB    (0x20)  // I2C bus busy -#define MCF532x_I2C_I2SR_IAL    (0x10)  // aribitration lost -#define MCF532x_I2C_I2SR_SRW    (0x04)  // slave read/write -#define MCF532x_I2C_I2SR_IIF    (0x02)  // I2C interrupt -#define MCF532x_I2C_I2SR_RXAK   (0x01)  // received acknowledge - -#define MCF532x_PAR_FECI2C	(volatile u8 *) (0xFC0A4053) - - -/* - *	The M5329EVB board needs a help getting its devices initialized  - *	at kernel start time if dBUG doesn't set it up (for example  - *	it is not used), so we need to do it manually. - */ -#ifdef __ASSEMBLER__ -.macro m5329EVB_setup -	movel	#0xFC098000, %a7 -	movel	#0x0, (%a7) -#define CORE_SRAM	0x80000000	 -#define CORE_SRAM_SIZE	0x8000 -	movel	#CORE_SRAM, %d0 -	addl	#0x221, %d0 -	movec	%d0,%RAMBAR1 -	movel	#CORE_SRAM, %sp -	addl	#CORE_SRAM_SIZE, %sp -	jsr	sysinit -.endm -#define	PLATFORM_SETUP	m5329EVB_setup - -#endif /* __ASSEMBLER__ */ - -/********************************************************************* - * - * Chip Configuration Module (CCM) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_CCM_CCR               MCF_REG16(0xFC0A0004) -#define MCF_CCM_RCON              MCF_REG16(0xFC0A0008) -#define MCF_CCM_CIR               MCF_REG16(0xFC0A000A) -#define MCF_CCM_MISCCR            MCF_REG16(0xFC0A0010) -#define MCF_CCM_CDR               MCF_REG16(0xFC0A0012) -#define MCF_CCM_UHCSR             MCF_REG16(0xFC0A0014) -#define MCF_CCM_UOCSR             MCF_REG16(0xFC0A0016) - -/* Bit definitions and macros for MCF_CCM_CCR */ -#define MCF_CCM_CCR_RESERVED      (0x0001) -#define MCF_CCM_CCR_PLL_MODE      (0x0003) -#define MCF_CCM_CCR_OSC_MODE      (0x0005) -#define MCF_CCM_CCR_BOOTPS(x)     (((x)&0x0003)<<3|0x0001) -#define MCF_CCM_CCR_LOAD          (0x0021) -#define MCF_CCM_CCR_LIMP          (0x0041) -#define MCF_CCM_CCR_CSC(x)        (((x)&0x0003)<<8|0x0001) - -/* Bit definitions and macros for MCF_CCM_RCON */ -#define MCF_CCM_RCON_RESERVED     (0x0001) -#define MCF_CCM_RCON_PLL_MODE     (0x0003) -#define MCF_CCM_RCON_OSC_MODE     (0x0005) -#define MCF_CCM_RCON_BOOTPS(x)    (((x)&0x0003)<<3|0x0001) -#define MCF_CCM_RCON_LOAD         (0x0021) -#define MCF_CCM_RCON_LIMP         (0x0041) -#define MCF_CCM_RCON_CSC(x)       (((x)&0x0003)<<8|0x0001) - -/* Bit definitions and macros for MCF_CCM_CIR */ -#define MCF_CCM_CIR_PRN(x)        (((x)&0x003F)<<0) -#define MCF_CCM_CIR_PIN(x)        (((x)&0x03FF)<<6) - -/* Bit definitions and macros for MCF_CCM_MISCCR */ -#define MCF_CCM_MISCCR_USBSRC     (0x0001) -#define MCF_CCM_MISCCR_USBDIV     (0x0002) -#define MCF_CCM_MISCCR_SSI_SRC    (0x0010) -#define MCF_CCM_MISCCR_TIM_DMA   (0x0020) -#define MCF_CCM_MISCCR_SSI_PUS    (0x0040) -#define MCF_CCM_MISCCR_SSI_PUE    (0x0080) -#define MCF_CCM_MISCCR_LCD_CHEN   (0x0100) -#define MCF_CCM_MISCCR_LIMP       (0x1000) -#define MCF_CCM_MISCCR_PLL_LOCK   (0x2000) - -/* Bit definitions and macros for MCF_CCM_CDR */ -#define MCF_CCM_CDR_SSIDIV(x)     (((x)&0x000F)<<0) -#define MCF_CCM_CDR_LPDIV(x)      (((x)&0x000F)<<8) - -/* Bit definitions and macros for MCF_CCM_UHCSR */ -#define MCF_CCM_UHCSR_XPDE        (0x0001) -#define MCF_CCM_UHCSR_UHMIE       (0x0002) -#define MCF_CCM_UHCSR_WKUP        (0x0004) -#define MCF_CCM_UHCSR_PORTIND(x)  (((x)&0x0003)<<14) - -/* Bit definitions and macros for MCF_CCM_UOCSR */ -#define MCF_CCM_UOCSR_XPDE        (0x0001) -#define MCF_CCM_UOCSR_UOMIE       (0x0002) -#define MCF_CCM_UOCSR_WKUP        (0x0004) -#define MCF_CCM_UOCSR_PWRFLT      (0x0008) -#define MCF_CCM_UOCSR_SEND        (0x0010) -#define MCF_CCM_UOCSR_VVLD        (0x0020) -#define MCF_CCM_UOCSR_BVLD        (0x0040) -#define MCF_CCM_UOCSR_AVLD        (0x0080) -#define MCF_CCM_UOCSR_DPPU        (0x0100) -#define MCF_CCM_UOCSR_DCR_VBUS    (0x0200) -#define MCF_CCM_UOCSR_CRG_VBUS    (0x0400) -#define MCF_CCM_UOCSR_DRV_VBUS    (0x0800) -#define MCF_CCM_UOCSR_DMPD        (0x1000) -#define MCF_CCM_UOCSR_DPPD        (0x2000) -#define MCF_CCM_UOCSR_PORTIND(x)  (((x)&0x0003)<<14) - -/********************************************************************* - * - * DMA Timers (DTIM) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_DTIM0_DTMR           MCF_REG16(0xFC070000) -#define MCF_DTIM0_DTXMR          MCF_REG08(0xFC070002) -#define MCF_DTIM0_DTER           MCF_REG08(0xFC070003) -#define MCF_DTIM0_DTRR           MCF_REG32(0xFC070004) -#define MCF_DTIM0_DTCR           MCF_REG32(0xFC070008) -#define MCF_DTIM0_DTCN           MCF_REG32(0xFC07000C) -#define MCF_DTIM1_DTMR           MCF_REG16(0xFC074000) -#define MCF_DTIM1_DTXMR          MCF_REG08(0xFC074002) -#define MCF_DTIM1_DTER           MCF_REG08(0xFC074003) -#define MCF_DTIM1_DTRR           MCF_REG32(0xFC074004) -#define MCF_DTIM1_DTCR           MCF_REG32(0xFC074008) -#define MCF_DTIM1_DTCN           MCF_REG32(0xFC07400C) -#define MCF_DTIM2_DTMR           MCF_REG16(0xFC078000) -#define MCF_DTIM2_DTXMR          MCF_REG08(0xFC078002) -#define MCF_DTIM2_DTER           MCF_REG08(0xFC078003) -#define MCF_DTIM2_DTRR           MCF_REG32(0xFC078004) -#define MCF_DTIM2_DTCR           MCF_REG32(0xFC078008) -#define MCF_DTIM2_DTCN           MCF_REG32(0xFC07800C) -#define MCF_DTIM3_DTMR           MCF_REG16(0xFC07C000) -#define MCF_DTIM3_DTXMR          MCF_REG08(0xFC07C002) -#define MCF_DTIM3_DTER           MCF_REG08(0xFC07C003) -#define MCF_DTIM3_DTRR           MCF_REG32(0xFC07C004) -#define MCF_DTIM3_DTCR           MCF_REG32(0xFC07C008) -#define MCF_DTIM3_DTCN           MCF_REG32(0xFC07C00C) -#define MCF_DTIM_DTMR(x)         MCF_REG16(0xFC070000+((x)*0x4000)) -#define MCF_DTIM_DTXMR(x)        MCF_REG08(0xFC070002+((x)*0x4000)) -#define MCF_DTIM_DTER(x)         MCF_REG08(0xFC070003+((x)*0x4000)) -#define MCF_DTIM_DTRR(x)         MCF_REG32(0xFC070004+((x)*0x4000)) -#define MCF_DTIM_DTCR(x)         MCF_REG32(0xFC070008+((x)*0x4000)) -#define MCF_DTIM_DTCN(x)         MCF_REG32(0xFC07000C+((x)*0x4000)) - -/* Bit definitions and macros for MCF_DTIM_DTMR */ -#define MCF_DTIM_DTMR_RST        (0x0001) -#define MCF_DTIM_DTMR_CLK(x)     (((x)&0x0003)<<1) -#define MCF_DTIM_DTMR_FRR        (0x0008) -#define MCF_DTIM_DTMR_ORRI       (0x0010) -#define MCF_DTIM_DTMR_OM         (0x0020) -#define MCF_DTIM_DTMR_CE(x)      (((x)&0x0003)<<6) -#define MCF_DTIM_DTMR_PS(x)      (((x)&0x00FF)<<8) -#define MCF_DTIM_DTMR_CE_ANY     (0x00C0) -#define MCF_DTIM_DTMR_CE_FALL    (0x0080) -#define MCF_DTIM_DTMR_CE_RISE    (0x0040) -#define MCF_DTIM_DTMR_CE_NONE    (0x0000) -#define MCF_DTIM_DTMR_CLK_DTIN   (0x0006) -#define MCF_DTIM_DTMR_CLK_DIV16  (0x0004) -#define MCF_DTIM_DTMR_CLK_DIV1   (0x0002) -#define MCF_DTIM_DTMR_CLK_STOP   (0x0000) - -/* Bit definitions and macros for MCF_DTIM_DTXMR */ -#define MCF_DTIM_DTXMR_MODE16    (0x01) -#define MCF_DTIM_DTXMR_DMAEN     (0x80) - -/* Bit definitions and macros for MCF_DTIM_DTER */ -#define MCF_DTIM_DTER_CAP        (0x01) -#define MCF_DTIM_DTER_REF        (0x02) - -/* Bit definitions and macros for MCF_DTIM_DTRR */ -#define MCF_DTIM_DTRR_REF(x)     (((x)&0xFFFFFFFF)<<0) - -/* Bit definitions and macros for MCF_DTIM_DTCR */ -#define MCF_DTIM_DTCR_CAP(x)     (((x)&0xFFFFFFFF)<<0) - -/* Bit definitions and macros for MCF_DTIM_DTCN */ -#define MCF_DTIM_DTCN_CNT(x)     (((x)&0xFFFFFFFF)<<0) - -/********************************************************************* - * - * FlexBus Chip Selects (FBCS) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_FBCS0_CSAR		MCF_REG32(0xFC008000) -#define MCF_FBCS0_CSMR		MCF_REG32(0xFC008004) -#define MCF_FBCS0_CSCR		MCF_REG32(0xFC008008) -#define MCF_FBCS1_CSAR		MCF_REG32(0xFC00800C) -#define MCF_FBCS1_CSMR		MCF_REG32(0xFC008010) -#define MCF_FBCS1_CSCR		MCF_REG32(0xFC008014) -#define MCF_FBCS2_CSAR		MCF_REG32(0xFC008018) -#define MCF_FBCS2_CSMR		MCF_REG32(0xFC00801C) -#define MCF_FBCS2_CSCR		MCF_REG32(0xFC008020) -#define MCF_FBCS3_CSAR		MCF_REG32(0xFC008024) -#define MCF_FBCS3_CSMR		MCF_REG32(0xFC008028) -#define MCF_FBCS3_CSCR		MCF_REG32(0xFC00802C) -#define MCF_FBCS4_CSAR		MCF_REG32(0xFC008030) -#define MCF_FBCS4_CSMR		MCF_REG32(0xFC008034) -#define MCF_FBCS4_CSCR		MCF_REG32(0xFC008038) -#define MCF_FBCS5_CSAR		MCF_REG32(0xFC00803C) -#define MCF_FBCS5_CSMR		MCF_REG32(0xFC008040) -#define MCF_FBCS5_CSCR		MCF_REG32(0xFC008044) -#define MCF_FBCS_CSAR(x)	MCF_REG32(0xFC008000+((x)*0x00C)) -#define MCF_FBCS_CSMR(x)	MCF_REG32(0xFC008004+((x)*0x00C)) -#define MCF_FBCS_CSCR(x)	MCF_REG32(0xFC008008+((x)*0x00C)) - -/* Bit definitions and macros for MCF_FBCS_CSAR */ -#define MCF_FBCS_CSAR_BA(x)	((x)&0xFFFF0000) - -/* Bit definitions and macros for MCF_FBCS_CSMR */ -#define MCF_FBCS_CSMR_V		(0x00000001) -#define MCF_FBCS_CSMR_WP	(0x00000100) -#define MCF_FBCS_CSMR_BAM(x)	(((x)&0x0000FFFF)<<16) -#define MCF_FBCS_CSMR_BAM_4G	(0xFFFF0000) -#define MCF_FBCS_CSMR_BAM_2G	(0x7FFF0000) -#define MCF_FBCS_CSMR_BAM_1G	(0x3FFF0000) -#define MCF_FBCS_CSMR_BAM_1024M	(0x3FFF0000) -#define MCF_FBCS_CSMR_BAM_512M	(0x1FFF0000) -#define MCF_FBCS_CSMR_BAM_256M	(0x0FFF0000) -#define MCF_FBCS_CSMR_BAM_128M	(0x07FF0000) -#define MCF_FBCS_CSMR_BAM_64M	(0x03FF0000) -#define MCF_FBCS_CSMR_BAM_32M	(0x01FF0000) -#define MCF_FBCS_CSMR_BAM_16M	(0x00FF0000) -#define MCF_FBCS_CSMR_BAM_8M	(0x007F0000) -#define MCF_FBCS_CSMR_BAM_4M	(0x003F0000) -#define MCF_FBCS_CSMR_BAM_2M	(0x001F0000) -#define MCF_FBCS_CSMR_BAM_1M	(0x000F0000) -#define MCF_FBCS_CSMR_BAM_1024K	(0x000F0000) -#define MCF_FBCS_CSMR_BAM_512K	(0x00070000) -#define MCF_FBCS_CSMR_BAM_256K	(0x00030000) -#define MCF_FBCS_CSMR_BAM_128K	(0x00010000) -#define MCF_FBCS_CSMR_BAM_64K	(0x00000000) - -/* Bit definitions and macros for MCF_FBCS_CSCR */ -#define MCF_FBCS_CSCR_BSTW	(0x00000008) -#define MCF_FBCS_CSCR_BSTR	(0x00000010) -#define MCF_FBCS_CSCR_BEM	(0x00000020) -#define MCF_FBCS_CSCR_PS(x)	(((x)&0x00000003)<<6) -#define MCF_FBCS_CSCR_AA	(0x00000100) -#define MCF_FBCS_CSCR_SBM	(0x00000200) -#define MCF_FBCS_CSCR_WS(x)	(((x)&0x0000003F)<<10) -#define MCF_FBCS_CSCR_WRAH(x)	(((x)&0x00000003)<<16) -#define MCF_FBCS_CSCR_RDAH(x)	(((x)&0x00000003)<<18) -#define MCF_FBCS_CSCR_ASET(x)	(((x)&0x00000003)<<20) -#define MCF_FBCS_CSCR_SWSEN	(0x00800000) -#define MCF_FBCS_CSCR_SWS(x)	(((x)&0x0000003F)<<26) -#define MCF_FBCS_CSCR_PS_8	(0x0040) -#define MCF_FBCS_CSCR_PS_16	(0x0080) -#define MCF_FBCS_CSCR_PS_32	(0x0000) - -/********************************************************************* - * - * General Purpose I/O (GPIO) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCFGPIO_PODR_FECH		(0xFC0A4000) -#define MCFGPIO_PODR_FECL		(0xFC0A4001) -#define MCFGPIO_PODR_SSI		(0xFC0A4002) -#define MCFGPIO_PODR_BUSCTL		(0xFC0A4003) -#define MCFGPIO_PODR_BE			(0xFC0A4004) -#define MCFGPIO_PODR_CS			(0xFC0A4005) -#define MCFGPIO_PODR_PWM		(0xFC0A4006) -#define MCFGPIO_PODR_FECI2C		(0xFC0A4007) -#define MCFGPIO_PODR_UART		(0xFC0A4009) -#define MCFGPIO_PODR_QSPI		(0xFC0A400A) -#define MCFGPIO_PODR_TIMER		(0xFC0A400B) -#define MCFGPIO_PODR_LCDDATAH		(0xFC0A400D) -#define MCFGPIO_PODR_LCDDATAM		(0xFC0A400E) -#define MCFGPIO_PODR_LCDDATAL		(0xFC0A400F) -#define MCFGPIO_PODR_LCDCTLH		(0xFC0A4010) -#define MCFGPIO_PODR_LCDCTLL		(0xFC0A4011) -#define MCFGPIO_PDDR_FECH		(0xFC0A4014) -#define MCFGPIO_PDDR_FECL		(0xFC0A4015) -#define MCFGPIO_PDDR_SSI		(0xFC0A4016) -#define MCFGPIO_PDDR_BUSCTL		(0xFC0A4017) -#define MCFGPIO_PDDR_BE			(0xFC0A4018) -#define MCFGPIO_PDDR_CS			(0xFC0A4019) -#define MCFGPIO_PDDR_PWM		(0xFC0A401A) -#define MCFGPIO_PDDR_FECI2C		(0xFC0A401B) -#define MCFGPIO_PDDR_UART		(0xFC0A401C) -#define MCFGPIO_PDDR_QSPI		(0xFC0A401E) -#define MCFGPIO_PDDR_TIMER		(0xFC0A401F) -#define MCFGPIO_PDDR_LCDDATAH		(0xFC0A4021) -#define MCFGPIO_PDDR_LCDDATAM		(0xFC0A4022) -#define MCFGPIO_PDDR_LCDDATAL		(0xFC0A4023) -#define MCFGPIO_PDDR_LCDCTLH		(0xFC0A4024) -#define MCFGPIO_PDDR_LCDCTLL		(0xFC0A4025) -#define MCFGPIO_PPDSDR_FECH		(0xFC0A4028) -#define MCFGPIO_PPDSDR_FECL		(0xFC0A4029) -#define MCFGPIO_PPDSDR_SSI		(0xFC0A402A) -#define MCFGPIO_PPDSDR_BUSCTL		(0xFC0A402B) -#define MCFGPIO_PPDSDR_BE		(0xFC0A402C) -#define MCFGPIO_PPDSDR_CS		(0xFC0A402D) -#define MCFGPIO_PPDSDR_PWM		(0xFC0A402E) -#define MCFGPIO_PPDSDR_FECI2C		(0xFC0A402F) -#define MCFGPIO_PPDSDR_UART		(0xFC0A4031) -#define MCFGPIO_PPDSDR_QSPI		(0xFC0A4032) -#define MCFGPIO_PPDSDR_TIMER		(0xFC0A4033) -#define MCFGPIO_PPDSDR_LCDDATAH		(0xFC0A4035) -#define MCFGPIO_PPDSDR_LCDDATAM		(0xFC0A4036) -#define MCFGPIO_PPDSDR_LCDDATAL		(0xFC0A4037) -#define MCFGPIO_PPDSDR_LCDCTLH		(0xFC0A4038) -#define MCFGPIO_PPDSDR_LCDCTLL		(0xFC0A4039) -#define MCFGPIO_PCLRR_FECH		(0xFC0A403C) -#define MCFGPIO_PCLRR_FECL		(0xFC0A403D) -#define MCFGPIO_PCLRR_SSI		(0xFC0A403E) -#define MCFGPIO_PCLRR_BUSCTL		(0xFC0A403F) -#define MCFGPIO_PCLRR_BE		(0xFC0A4040) -#define MCFGPIO_PCLRR_CS		(0xFC0A4041) -#define MCFGPIO_PCLRR_PWM		(0xFC0A4042) -#define MCFGPIO_PCLRR_FECI2C		(0xFC0A4043) -#define MCFGPIO_PCLRR_UART		(0xFC0A4045) -#define MCFGPIO_PCLRR_QSPI		(0xFC0A4046) -#define MCFGPIO_PCLRR_TIMER		(0xFC0A4047) -#define MCFGPIO_PCLRR_LCDDATAH		(0xFC0A4049) -#define MCFGPIO_PCLRR_LCDDATAM		(0xFC0A404A) -#define MCFGPIO_PCLRR_LCDDATAL		(0xFC0A404B) -#define MCFGPIO_PCLRR_LCDCTLH		(0xFC0A404C) -#define MCFGPIO_PCLRR_LCDCTLL		(0xFC0A404D) -#define MCF_GPIO_PAR_FEC		MCF_REG08(0xFC0A4050) -#define MCF_GPIO_PAR_PWM		MCF_REG08(0xFC0A4051) -#define MCF_GPIO_PAR_BUSCTL		MCF_REG08(0xFC0A4052) -#define MCF_GPIO_PAR_FECI2C		MCF_REG08(0xFC0A4053) -#define MCF_GPIO_PAR_BE			MCF_REG08(0xFC0A4054) -#define MCF_GPIO_PAR_CS			MCF_REG08(0xFC0A4055) -#define MCF_GPIO_PAR_SSI		MCF_REG16(0xFC0A4056) -#define MCF_GPIO_PAR_UART		MCF_REG16(0xFC0A4058) -#define MCF_GPIO_PAR_QSPI		MCF_REG16(0xFC0A405A) -#define MCF_GPIO_PAR_TIMER		MCF_REG08(0xFC0A405C) -#define MCF_GPIO_PAR_LCDDATA		MCF_REG08(0xFC0A405D) -#define MCF_GPIO_PAR_LCDCTL		MCF_REG16(0xFC0A405E) -#define MCF_GPIO_PAR_IRQ		MCF_REG16(0xFC0A4060) -#define MCF_GPIO_MSCR_FLEXBUS		MCF_REG08(0xFC0A4064) -#define MCF_GPIO_MSCR_SDRAM		MCF_REG08(0xFC0A4065) -#define MCF_GPIO_DSCR_I2C		MCF_REG08(0xFC0A4068) -#define MCF_GPIO_DSCR_PWM		MCF_REG08(0xFC0A4069) -#define MCF_GPIO_DSCR_FEC		MCF_REG08(0xFC0A406A) -#define MCF_GPIO_DSCR_UART		MCF_REG08(0xFC0A406B) -#define MCF_GPIO_DSCR_QSPI		MCF_REG08(0xFC0A406C) -#define MCF_GPIO_DSCR_TIMER		MCF_REG08(0xFC0A406D) -#define MCF_GPIO_DSCR_SSI		MCF_REG08(0xFC0A406E) -#define MCF_GPIO_DSCR_LCD		MCF_REG08(0xFC0A406F) -#define MCF_GPIO_DSCR_DEBUG		MCF_REG08(0xFC0A4070) -#define MCF_GPIO_DSCR_CLKRST		MCF_REG08(0xFC0A4071) -#define MCF_GPIO_DSCR_IRQ		MCF_REG08(0xFC0A4072) - -/* Bit definitions and macros for MCF_GPIO_PODR_FECH */ -#define MCF_GPIO_PODR_FECH_PODR_FECH0              (0x01) -#define MCF_GPIO_PODR_FECH_PODR_FECH1              (0x02) -#define MCF_GPIO_PODR_FECH_PODR_FECH2              (0x04) -#define MCF_GPIO_PODR_FECH_PODR_FECH3              (0x08) -#define MCF_GPIO_PODR_FECH_PODR_FECH4              (0x10) -#define MCF_GPIO_PODR_FECH_PODR_FECH5              (0x20) -#define MCF_GPIO_PODR_FECH_PODR_FECH6              (0x40) -#define MCF_GPIO_PODR_FECH_PODR_FECH7              (0x80) - -/* Bit definitions and macros for MCF_GPIO_PODR_FECL */ -#define MCF_GPIO_PODR_FECL_PODR_FECL0              (0x01) -#define MCF_GPIO_PODR_FECL_PODR_FECL1              (0x02) -#define MCF_GPIO_PODR_FECL_PODR_FECL2              (0x04) -#define MCF_GPIO_PODR_FECL_PODR_FECL3              (0x08) -#define MCF_GPIO_PODR_FECL_PODR_FECL4              (0x10) -#define MCF_GPIO_PODR_FECL_PODR_FECL5              (0x20) -#define MCF_GPIO_PODR_FECL_PODR_FECL6              (0x40) -#define MCF_GPIO_PODR_FECL_PODR_FECL7              (0x80) - -/* Bit definitions and macros for MCF_GPIO_PODR_SSI */ -#define MCF_GPIO_PODR_SSI_PODR_SSI0                (0x01) -#define MCF_GPIO_PODR_SSI_PODR_SSI1                (0x02) -#define MCF_GPIO_PODR_SSI_PODR_SSI2                (0x04) -#define MCF_GPIO_PODR_SSI_PODR_SSI3                (0x08) -#define MCF_GPIO_PODR_SSI_PODR_SSI4                (0x10) - -/* Bit definitions and macros for MCF_GPIO_PODR_BUSCTL */ -#define MCF_GPIO_PODR_BUSCTL_POSDR_BUSCTL0         (0x01) -#define MCF_GPIO_PODR_BUSCTL_PODR_BUSCTL1          (0x02) -#define MCF_GPIO_PODR_BUSCTL_PODR_BUSCTL2          (0x04) -#define MCF_GPIO_PODR_BUSCTL_PODR_BUSCTL3          (0x08) - -/* Bit definitions and macros for MCF_GPIO_PODR_BE */ -#define MCF_GPIO_PODR_BE_PODR_BE0                  (0x01) -#define MCF_GPIO_PODR_BE_PODR_BE1                  (0x02) -#define MCF_GPIO_PODR_BE_PODR_BE2                  (0x04) -#define MCF_GPIO_PODR_BE_PODR_BE3                  (0x08) - -/* Bit definitions and macros for MCF_GPIO_PODR_CS */ -#define MCF_GPIO_PODR_CS_PODR_CS1                  (0x02) -#define MCF_GPIO_PODR_CS_PODR_CS2                  (0x04) -#define MCF_GPIO_PODR_CS_PODR_CS3                  (0x08) -#define MCF_GPIO_PODR_CS_PODR_CS4                  (0x10) -#define MCF_GPIO_PODR_CS_PODR_CS5                  (0x20) - -/* Bit definitions and macros for MCF_GPIO_PODR_PWM */ -#define MCF_GPIO_PODR_PWM_PODR_PWM2                (0x04) -#define MCF_GPIO_PODR_PWM_PODR_PWM3                (0x08) -#define MCF_GPIO_PODR_PWM_PODR_PWM4                (0x10) -#define MCF_GPIO_PODR_PWM_PODR_PWM5                (0x20) - -/* Bit definitions and macros for MCF_GPIO_PODR_FECI2C */ -#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C0          (0x01) -#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C1          (0x02) -#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C2          (0x04) -#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C3          (0x08) - -/* Bit definitions and macros for MCF_GPIO_PODR_UART */ -#define MCF_GPIO_PODR_UART_PODR_UART0              (0x01) -#define MCF_GPIO_PODR_UART_PODR_UART1              (0x02) -#define MCF_GPIO_PODR_UART_PODR_UART2              (0x04) -#define MCF_GPIO_PODR_UART_PODR_UART3              (0x08) -#define MCF_GPIO_PODR_UART_PODR_UART4              (0x10) -#define MCF_GPIO_PODR_UART_PODR_UART5              (0x20) -#define MCF_GPIO_PODR_UART_PODR_UART6              (0x40) -#define MCF_GPIO_PODR_UART_PODR_UART7              (0x80) - -/* Bit definitions and macros for MCF_GPIO_PODR_QSPI */ -#define MCF_GPIO_PODR_QSPI_PODR_QSPI0              (0x01) -#define MCF_GPIO_PODR_QSPI_PODR_QSPI1              (0x02) -#define MCF_GPIO_PODR_QSPI_PODR_QSPI2              (0x04) -#define MCF_GPIO_PODR_QSPI_PODR_QSPI3              (0x08) -#define MCF_GPIO_PODR_QSPI_PODR_QSPI4              (0x10) -#define MCF_GPIO_PODR_QSPI_PODR_QSPI5              (0x20) - -/* Bit definitions and macros for MCF_GPIO_PODR_TIMER */ -#define MCF_GPIO_PODR_TIMER_PODR_TIMER0            (0x01) -#define MCF_GPIO_PODR_TIMER_PODR_TIMER1            (0x02) -#define MCF_GPIO_PODR_TIMER_PODR_TIMER2            (0x04) -#define MCF_GPIO_PODR_TIMER_PODR_TIMER3            (0x08) - -/* Bit definitions and macros for MCF_GPIO_PODR_LCDDATAH */ -#define MCF_GPIO_PODR_LCDDATAH_PODR_LCDDATAH0      (0x01) -#define MCF_GPIO_PODR_LCDDATAH_PODR_LCDDATAH1      (0x02) - -/* Bit definitions and macros for MCF_GPIO_PODR_LCDDATAM */ -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM0      (0x01) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM1      (0x02) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM2      (0x04) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM3      (0x08) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM4      (0x10) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM5      (0x20) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM6      (0x40) -#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM7      (0x80) - -/* Bit definitions and macros for MCF_GPIO_PODR_LCDDATAL */ -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL0      (0x01) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL1      (0x02) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL2      (0x04) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL3      (0x08) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL4      (0x10) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL5      (0x20) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL6      (0x40) -#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL7      (0x80) - -/* Bit definitions and macros for MCF_GPIO_PODR_LCDCTLH */ -#define MCF_GPIO_PODR_LCDCTLH_PODR_LCDCTLH0        (0x01) - -/* Bit definitions and macros for MCF_GPIO_PODR_LCDCTLL */ -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL0        (0x01) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL1        (0x02) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL2        (0x04) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL3        (0x08) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL4        (0x10) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL5        (0x20) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL6        (0x40) -#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL7        (0x80) - -/* Bit definitions and macros for MCF_GPIO_PDDR_FECH */ -#define MCF_GPIO_PDDR_FECH_PDDR_FECH0              (0x01) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH1              (0x02) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH2              (0x04) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH3              (0x08) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH4              (0x10) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH5              (0x20) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH6              (0x40) -#define MCF_GPIO_PDDR_FECH_PDDR_FECH7              (0x80) - -/* Bit definitions and macros for MCF_GPIO_PDDR_FECL */ -#define MCF_GPIO_PDDR_FECL_PDDR_FECL0              (0x01) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL1              (0x02) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL2              (0x04) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL3              (0x08) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL4              (0x10) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL5              (0x20) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL6              (0x40) -#define MCF_GPIO_PDDR_FECL_PDDR_FECL7              (0x80) - -/* Bit definitions and macros for MCF_GPIO_PDDR_SSI */ -#define MCF_GPIO_PDDR_SSI_PDDR_SSI0                (0x01) -#define MCF_GPIO_PDDR_SSI_PDDR_SSI1                (0x02) -#define MCF_GPIO_PDDR_SSI_PDDR_SSI2                (0x04) -#define MCF_GPIO_PDDR_SSI_PDDR_SSI3                (0x08) -#define MCF_GPIO_PDDR_SSI_PDDR_SSI4                (0x10) - -/* Bit definitions and macros for MCF_GPIO_PDDR_BUSCTL */ -#define MCF_GPIO_PDDR_BUSCTL_POSDR_BUSCTL0         (0x01) -#define MCF_GPIO_PDDR_BUSCTL_PDDR_BUSCTL1          (0x02) -#define MCF_GPIO_PDDR_BUSCTL_PDDR_BUSCTL2          (0x04) -#define MCF_GPIO_PDDR_BUSCTL_PDDR_BUSCTL3          (0x08) - -/* Bit definitions and macros for MCF_GPIO_PDDR_BE */ -#define MCF_GPIO_PDDR_BE_PDDR_BE0                  (0x01) -#define MCF_GPIO_PDDR_BE_PDDR_BE1                  (0x02) -#define MCF_GPIO_PDDR_BE_PDDR_BE2                  (0x04) -#define MCF_GPIO_PDDR_BE_PDDR_BE3                  (0x08) - -/* Bit definitions and macros for MCF_GPIO_PDDR_CS */ -#define MCF_GPIO_PDDR_CS_PDDR_CS1                  (0x02) -#define MCF_GPIO_PDDR_CS_PDDR_CS2                  (0x04) -#define MCF_GPIO_PDDR_CS_PDDR_CS3                  (0x08) -#define MCF_GPIO_PDDR_CS_PDDR_CS4                  (0x10) -#define MCF_GPIO_PDDR_CS_PDDR_CS5                  (0x20) - -/* Bit definitions and macros for MCF_GPIO_PDDR_PWM */ -#define MCF_GPIO_PDDR_PWM_PDDR_PWM2                (0x04) -#define MCF_GPIO_PDDR_PWM_PDDR_PWM3                (0x08) -#define MCF_GPIO_PDDR_PWM_PDDR_PWM4                (0x10) -#define MCF_GPIO_PDDR_PWM_PDDR_PWM5                (0x20) - -/* Bit definitions and macros for MCF_GPIO_PDDR_FECI2C */ -#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C0          (0x01) -#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C1          (0x02) -#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C2          (0x04) -#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C3          (0x08) - -/* Bit definitions and macros for MCF_GPIO_PDDR_UART */ -#define MCF_GPIO_PDDR_UART_PDDR_UART0              (0x01) -#define MCF_GPIO_PDDR_UART_PDDR_UART1              (0x02) -#define MCF_GPIO_PDDR_UART_PDDR_UART2              (0x04) -#define MCF_GPIO_PDDR_UART_PDDR_UART3              (0x08) -#define MCF_GPIO_PDDR_UART_PDDR_UART4              (0x10) -#define MCF_GPIO_PDDR_UART_PDDR_UART5              (0x20) -#define MCF_GPIO_PDDR_UART_PDDR_UART6              (0x40) -#define MCF_GPIO_PDDR_UART_PDDR_UART7              (0x80) - -/* Bit definitions and macros for MCF_GPIO_PDDR_QSPI */ -#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI0              (0x01) -#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI1              (0x02) -#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI2              (0x04) -#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI3              (0x08) -#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI4              (0x10) -#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI5              (0x20) - -/* Bit definitions and macros for MCF_GPIO_PDDR_TIMER */ -#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER0            (0x01) -#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER1            (0x02) -#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER2            (0x04) -#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER3            (0x08) - -/* Bit definitions and macros for MCF_GPIO_PDDR_LCDDATAH */ -#define MCF_GPIO_PDDR_LCDDATAH_PDDR_LCDDATAH0      (0x01) -#define MCF_GPIO_PDDR_LCDDATAH_PDDR_LCDDATAH1      (0x02) - -/* Bit definitions and macros for MCF_GPIO_PDDR_LCDDATAM */ -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM0      (0x01) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM1      (0x02) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM2      (0x04) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM3      (0x08) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM4      (0x10) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM5      (0x20) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM6      (0x40) -#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM7      (0x80) - -/* Bit definitions and macros for MCF_GPIO_PDDR_LCDDATAL */ -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL0      (0x01) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL1      (0x02) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL2      (0x04) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL3      (0x08) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL4      (0x10) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL5      (0x20) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL6      (0x40) -#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL7      (0x80) - -/* Bit definitions and macros for MCF_GPIO_PDDR_LCDCTLH */ -#define MCF_GPIO_PDDR_LCDCTLH_PDDR_LCDCTLH0        (0x01) - -/* Bit definitions and macros for MCF_GPIO_PDDR_LCDCTLL */ -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL0        (0x01) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL1        (0x02) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL2        (0x04) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL3        (0x08) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL4        (0x10) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL5        (0x20) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL6        (0x40) -#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL7        (0x80) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECH */ -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH0          (0x01) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH1          (0x02) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH2          (0x04) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH3          (0x08) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH4          (0x10) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH5          (0x20) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH6          (0x40) -#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH7          (0x80) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECL */ -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL0          (0x01) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL1          (0x02) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL2          (0x04) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL3          (0x08) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL4          (0x10) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL5          (0x20) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL6          (0x40) -#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL7          (0x80) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_SSI */ -#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI0            (0x01) -#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI1            (0x02) -#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI2            (0x04) -#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI3            (0x08) -#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI4            (0x10) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_BUSCTL */ -#define MCF_GPIO_PPDSDR_BUSCTL_POSDR_BUSCTL0       (0x01) -#define MCF_GPIO_PPDSDR_BUSCTL_PPDSDR_BUSCTL1      (0x02) -#define MCF_GPIO_PPDSDR_BUSCTL_PPDSDR_BUSCTL2      (0x04) -#define MCF_GPIO_PPDSDR_BUSCTL_PPDSDR_BUSCTL3      (0x08) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_BE */ -#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE0              (0x01) -#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE1              (0x02) -#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE2              (0x04) -#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE3              (0x08) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_CS */ -#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS1              (0x02) -#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS2              (0x04) -#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS3              (0x08) -#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS4              (0x10) -#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS5              (0x20) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_PWM */ -#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM2            (0x04) -#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM3            (0x08) -#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM4            (0x10) -#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM5            (0x20) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECI2C */ -#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C0      (0x01) -#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C1      (0x02) -#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C2      (0x04) -#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C3      (0x08) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_UART */ -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART0          (0x01) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART1          (0x02) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART2          (0x04) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART3          (0x08) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART4          (0x10) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART5          (0x20) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART6          (0x40) -#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART7          (0x80) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_QSPI */ -#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI0          (0x01) -#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI1          (0x02) -#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI2          (0x04) -#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI3          (0x08) -#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI4          (0x10) -#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI5          (0x20) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_TIMER */ -#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER0        (0x01) -#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER1        (0x02) -#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER2        (0x04) -#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER3        (0x08) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDDATAH */ -#define MCF_GPIO_PPDSDR_LCDDATAH_PPDSDR_LCDDATAH0  (0x01) -#define MCF_GPIO_PPDSDR_LCDDATAH_PPDSDR_LCDDATAH1  (0x02) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDDATAM */ -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM0  (0x01) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM1  (0x02) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM2  (0x04) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM3  (0x08) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM4  (0x10) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM5  (0x20) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM6  (0x40) -#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM7  (0x80) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDDATAL */ -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL0  (0x01) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL1  (0x02) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL2  (0x04) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL3  (0x08) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL4  (0x10) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL5  (0x20) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL6  (0x40) -#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL7  (0x80) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDCTLH */ -#define MCF_GPIO_PPDSDR_LCDCTLH_PPDSDR_LCDCTLH0    (0x01) - -/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDCTLL */ -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL0    (0x01) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL1    (0x02) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL2    (0x04) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL3    (0x08) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL4    (0x10) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL5    (0x20) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL6    (0x40) -#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL7    (0x80) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_FECH */ -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH0            (0x01) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH1            (0x02) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH2            (0x04) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH3            (0x08) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH4            (0x10) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH5            (0x20) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH6            (0x40) -#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH7            (0x80) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_FECL */ -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL0            (0x01) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL1            (0x02) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL2            (0x04) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL3            (0x08) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL4            (0x10) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL5            (0x20) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL6            (0x40) -#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL7            (0x80) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_SSI */ -#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI0              (0x01) -#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI1              (0x02) -#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI2              (0x04) -#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI3              (0x08) -#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI4              (0x10) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_BUSCTL */ -#define MCF_GPIO_PCLRR_BUSCTL_POSDR_BUSCTL0        (0x01) -#define MCF_GPIO_PCLRR_BUSCTL_PCLRR_BUSCTL1        (0x02) -#define MCF_GPIO_PCLRR_BUSCTL_PCLRR_BUSCTL2        (0x04) -#define MCF_GPIO_PCLRR_BUSCTL_PCLRR_BUSCTL3        (0x08) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_BE */ -#define MCF_GPIO_PCLRR_BE_PCLRR_BE0                (0x01) -#define MCF_GPIO_PCLRR_BE_PCLRR_BE1                (0x02) -#define MCF_GPIO_PCLRR_BE_PCLRR_BE2                (0x04) -#define MCF_GPIO_PCLRR_BE_PCLRR_BE3                (0x08) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_CS */ -#define MCF_GPIO_PCLRR_CS_PCLRR_CS1                (0x02) -#define MCF_GPIO_PCLRR_CS_PCLRR_CS2                (0x04) -#define MCF_GPIO_PCLRR_CS_PCLRR_CS3                (0x08) -#define MCF_GPIO_PCLRR_CS_PCLRR_CS4                (0x10) -#define MCF_GPIO_PCLRR_CS_PCLRR_CS5                (0x20) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_PWM */ -#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM2              (0x04) -#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM3              (0x08) -#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM4              (0x10) -#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM5              (0x20) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_FECI2C */ -#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C0        (0x01) -#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C1        (0x02) -#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C2        (0x04) -#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C3        (0x08) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_UART */ -#define MCF_GPIO_PCLRR_UART_PCLRR_UART0            (0x01) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART1            (0x02) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART2            (0x04) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART3            (0x08) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART4            (0x10) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART5            (0x20) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART6            (0x40) -#define MCF_GPIO_PCLRR_UART_PCLRR_UART7            (0x80) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_QSPI */ -#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI0            (0x01) -#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI1            (0x02) -#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI2            (0x04) -#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI3            (0x08) -#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI4            (0x10) -#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI5            (0x20) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_TIMER */ -#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER0          (0x01) -#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER1          (0x02) -#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER2          (0x04) -#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER3          (0x08) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDDATAH */ -#define MCF_GPIO_PCLRR_LCDDATAH_PCLRR_LCDDATAH0    (0x01) -#define MCF_GPIO_PCLRR_LCDDATAH_PCLRR_LCDDATAH1    (0x02) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDDATAM */ -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM0    (0x01) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM1    (0x02) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM2    (0x04) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM3    (0x08) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM4    (0x10) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM5    (0x20) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM6    (0x40) -#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM7    (0x80) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDDATAL */ -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL0    (0x01) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL1    (0x02) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL2    (0x04) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL3    (0x08) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL4    (0x10) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL5    (0x20) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL6    (0x40) -#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL7    (0x80) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDCTLH */ -#define MCF_GPIO_PCLRR_LCDCTLH_PCLRR_LCDCTLH0      (0x01) - -/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDCTLL */ -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL0      (0x01) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL1      (0x02) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL2      (0x04) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL3      (0x08) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL4      (0x10) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL5      (0x20) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL6      (0x40) -#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL7      (0x80) - -/* Bit definitions and macros for MCF_GPIO_PAR_FEC */ -#define MCF_GPIO_PAR_FEC_PAR_FEC_MII(x)            (((x)&0x03)<<0) -#define MCF_GPIO_PAR_FEC_PAR_FEC_7W(x)             (((x)&0x03)<<2) -#define MCF_GPIO_PAR_FEC_PAR_FEC_7W_GPIO           (0x00) -#define MCF_GPIO_PAR_FEC_PAR_FEC_7W_URTS1          (0x04) -#define MCF_GPIO_PAR_FEC_PAR_FEC_7W_FEC            (0x0C) -#define MCF_GPIO_PAR_FEC_PAR_FEC_MII_GPIO          (0x00) -#define MCF_GPIO_PAR_FEC_PAR_FEC_MII_UART          (0x01) -#define MCF_GPIO_PAR_FEC_PAR_FEC_MII_FEC           (0x03) - -/* Bit definitions and macros for MCF_GPIO_PAR_PWM */ -#define MCF_GPIO_PAR_PWM_PAR_PWM1(x)               (((x)&0x03)<<0) -#define MCF_GPIO_PAR_PWM_PAR_PWM3(x)               (((x)&0x03)<<2) -#define MCF_GPIO_PAR_PWM_PAR_PWM5                  (0x10) -#define MCF_GPIO_PAR_PWM_PAR_PWM7                  (0x20) - -/* Bit definitions and macros for MCF_GPIO_PAR_BUSCTL */ -#define MCF_GPIO_PAR_BUSCTL_PAR_TS(x)              (((x)&0x03)<<3) -#define MCF_GPIO_PAR_BUSCTL_PAR_RWB                (0x20) -#define MCF_GPIO_PAR_BUSCTL_PAR_TA                 (0x40) -#define MCF_GPIO_PAR_BUSCTL_PAR_OE                 (0x80) -#define MCF_GPIO_PAR_BUSCTL_PAR_OE_GPIO            (0x00) -#define MCF_GPIO_PAR_BUSCTL_PAR_OE_OE              (0x80) -#define MCF_GPIO_PAR_BUSCTL_PAR_TA_GPIO            (0x00) -#define MCF_GPIO_PAR_BUSCTL_PAR_TA_TA              (0x40) -#define MCF_GPIO_PAR_BUSCTL_PAR_RWB_GPIO           (0x00) -#define MCF_GPIO_PAR_BUSCTL_PAR_RWB_RWB            (0x20) -#define MCF_GPIO_PAR_BUSCTL_PAR_TS_GPIO            (0x00) -#define MCF_GPIO_PAR_BUSCTL_PAR_TS_DACK0           (0x10) -#define MCF_GPIO_PAR_BUSCTL_PAR_TS_TS              (0x18) - -/* Bit definitions and macros for MCF_GPIO_PAR_FECI2C */ -#define MCF_GPIO_PAR_FECI2C_PAR_SDA(x)             (((x)&0x03)<<0) -#define MCF_GPIO_PAR_FECI2C_PAR_SCL(x)             (((x)&0x03)<<2) -#define MCF_GPIO_PAR_FECI2C_PAR_MDIO(x)            (((x)&0x03)<<4) -#define MCF_GPIO_PAR_FECI2C_PAR_MDC(x)             (((x)&0x03)<<6) -#define MCF_GPIO_PAR_FECI2C_PAR_MDC_GPIO           (0x00) -#define MCF_GPIO_PAR_FECI2C_PAR_MDC_UTXD2          (0x40) -#define MCF_GPIO_PAR_FECI2C_PAR_MDC_SCL            (0x80) -#define MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC           (0xC0) -#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_GPIO          (0x00) -#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_URXD2         (0x10) -#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_SDA           (0x20) -#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO         (0x30) -#define MCF_GPIO_PAR_FECI2C_PAR_SCL_GPIO           (0x00) -#define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2          (0x04) -#define MCF_GPIO_PAR_FECI2C_PAR_SCL_SCL            (0x0C) -#define MCF_GPIO_PAR_FECI2C_PAR_SDA_GPIO           (0x00) -#define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2          (0x02) -#define MCF_GPIO_PAR_FECI2C_PAR_SDA_SDA            (0x03) - -/* Bit definitions and macros for MCF_GPIO_PAR_BE */ -#define MCF_GPIO_PAR_BE_PAR_BE0                    (0x01) -#define MCF_GPIO_PAR_BE_PAR_BE1                    (0x02) -#define MCF_GPIO_PAR_BE_PAR_BE2                    (0x04) -#define MCF_GPIO_PAR_BE_PAR_BE3                    (0x08) - -/* Bit definitions and macros for MCF_GPIO_PAR_CS */ -#define MCF_GPIO_PAR_CS_PAR_CS1                    (0x02) -#define MCF_GPIO_PAR_CS_PAR_CS2                    (0x04) -#define MCF_GPIO_PAR_CS_PAR_CS3                    (0x08) -#define MCF_GPIO_PAR_CS_PAR_CS4                    (0x10) -#define MCF_GPIO_PAR_CS_PAR_CS5                    (0x20) -#define MCF_GPIO_PAR_CS_PAR_CS_CS1_GPIO            (0x00) -#define MCF_GPIO_PAR_CS_PAR_CS_CS1_SDCS1           (0x01) -#define MCF_GPIO_PAR_CS_PAR_CS_CS1_CS1             (0x03) - -/* Bit definitions and macros for MCF_GPIO_PAR_SSI */ -#define MCF_GPIO_PAR_SSI_PAR_MCLK                  (0x0080) -#define MCF_GPIO_PAR_SSI_PAR_TXD(x)                (((x)&0x0003)<<8) -#define MCF_GPIO_PAR_SSI_PAR_RXD(x)                (((x)&0x0003)<<10) -#define MCF_GPIO_PAR_SSI_PAR_FS(x)                 (((x)&0x0003)<<12) -#define MCF_GPIO_PAR_SSI_PAR_BCLK(x)               (((x)&0x0003)<<14) - -/* Bit definitions and macros for MCF_GPIO_PAR_UART */ -#define MCF_GPIO_PAR_UART_PAR_UTXD0                (0x0001) -#define MCF_GPIO_PAR_UART_PAR_URXD0                (0x0002) -#define MCF_GPIO_PAR_UART_PAR_URTS0                (0x0004) -#define MCF_GPIO_PAR_UART_PAR_UCTS0                (0x0008) -#define MCF_GPIO_PAR_UART_PAR_UTXD1(x)             (((x)&0x0003)<<4) -#define MCF_GPIO_PAR_UART_PAR_URXD1(x)             (((x)&0x0003)<<6) -#define MCF_GPIO_PAR_UART_PAR_URTS1(x)             (((x)&0x0003)<<8) -#define MCF_GPIO_PAR_UART_PAR_UCTS1(x)             (((x)&0x0003)<<10) -#define MCF_GPIO_PAR_UART_PAR_UCTS1_GPIO           (0x0000) -#define MCF_GPIO_PAR_UART_PAR_UCTS1_SSI_BCLK       (0x0800) -#define MCF_GPIO_PAR_UART_PAR_UCTS1_ULPI_D7        (0x0400) -#define MCF_GPIO_PAR_UART_PAR_UCTS1_UCTS1          (0x0C00) -#define MCF_GPIO_PAR_UART_PAR_URTS1_GPIO           (0x0000) -#define MCF_GPIO_PAR_UART_PAR_URTS1_SSI_FS         (0x0200) -#define MCF_GPIO_PAR_UART_PAR_URTS1_ULPI_D6        (0x0100) -#define MCF_GPIO_PAR_UART_PAR_URTS1_URTS1          (0x0300) -#define MCF_GPIO_PAR_UART_PAR_URXD1_GPIO           (0x0000) -#define MCF_GPIO_PAR_UART_PAR_URXD1_SSI_RXD        (0x0080) -#define MCF_GPIO_PAR_UART_PAR_URXD1_ULPI_D5        (0x0040) -#define MCF_GPIO_PAR_UART_PAR_URXD1_URXD1          (0x00C0) -#define MCF_GPIO_PAR_UART_PAR_UTXD1_GPIO           (0x0000) -#define MCF_GPIO_PAR_UART_PAR_UTXD1_SSI_TXD        (0x0020) -#define MCF_GPIO_PAR_UART_PAR_UTXD1_ULPI_D4        (0x0010) -#define MCF_GPIO_PAR_UART_PAR_UTXD1_UTXD1          (0x0030) - -/* Bit definitions and macros for MCF_GPIO_PAR_QSPI */ -#define MCF_GPIO_PAR_QSPI_PAR_SCK(x)               (((x)&0x0003)<<4) -#define MCF_GPIO_PAR_QSPI_PAR_DOUT(x)              (((x)&0x0003)<<6) -#define MCF_GPIO_PAR_QSPI_PAR_DIN(x)               (((x)&0x0003)<<8) -#define MCF_GPIO_PAR_QSPI_PAR_PCS0(x)              (((x)&0x0003)<<10) -#define MCF_GPIO_PAR_QSPI_PAR_PCS1(x)              (((x)&0x0003)<<12) -#define MCF_GPIO_PAR_QSPI_PAR_PCS2(x)              (((x)&0x0003)<<14) - -/* Bit definitions and macros for MCF_GPIO_PAR_TIMER */ -#define MCF_GPIO_PAR_TIMER_PAR_TIN0(x)             (((x)&0x03)<<0) -#define MCF_GPIO_PAR_TIMER_PAR_TIN1(x)             (((x)&0x03)<<2) -#define MCF_GPIO_PAR_TIMER_PAR_TIN2(x)             (((x)&0x03)<<4) -#define MCF_GPIO_PAR_TIMER_PAR_TIN3(x)             (((x)&0x03)<<6) -#define MCF_GPIO_PAR_TIMER_PAR_TIN3_GPIO           (0x00) -#define MCF_GPIO_PAR_TIMER_PAR_TIN3_TOUT3          (0x80) -#define MCF_GPIO_PAR_TIMER_PAR_TIN3_URXD2          (0x40) -#define MCF_GPIO_PAR_TIMER_PAR_TIN3_TIN3           (0xC0) -#define MCF_GPIO_PAR_TIMER_PAR_TIN2_GPIO           (0x00) -#define MCF_GPIO_PAR_TIMER_PAR_TIN2_TOUT2          (0x20) -#define MCF_GPIO_PAR_TIMER_PAR_TIN2_UTXD2          (0x10) -#define MCF_GPIO_PAR_TIMER_PAR_TIN2_TIN2           (0x30) -#define MCF_GPIO_PAR_TIMER_PAR_TIN1_GPIO           (0x00) -#define MCF_GPIO_PAR_TIMER_PAR_TIN1_TOUT1          (0x08) -#define MCF_GPIO_PAR_TIMER_PAR_TIN1_DACK1          (0x04) -#define MCF_GPIO_PAR_TIMER_PAR_TIN1_TIN1           (0x0C) -#define MCF_GPIO_PAR_TIMER_PAR_TIN0_GPIO           (0x00) -#define MCF_GPIO_PAR_TIMER_PAR_TIN0_TOUT0          (0x02) -#define MCF_GPIO_PAR_TIMER_PAR_TIN0_DREQ0          (0x01) -#define MCF_GPIO_PAR_TIMER_PAR_TIN0_TIN0           (0x03) - -/* Bit definitions and macros for MCF_GPIO_PAR_LCDDATA */ -#define MCF_GPIO_PAR_LCDDATA_PAR_LD7_0(x)          (((x)&0x03)<<0) -#define MCF_GPIO_PAR_LCDDATA_PAR_LD15_8(x)         (((x)&0x03)<<2) -#define MCF_GPIO_PAR_LCDDATA_PAR_LD16(x)           (((x)&0x03)<<4) -#define MCF_GPIO_PAR_LCDDATA_PAR_LD17(x)           (((x)&0x03)<<6) - -/* Bit definitions and macros for MCF_GPIO_PAR_LCDCTL */ -#define MCF_GPIO_PAR_LCDCTL_PAR_CLS                (0x0001) -#define MCF_GPIO_PAR_LCDCTL_PAR_PS                 (0x0002) -#define MCF_GPIO_PAR_LCDCTL_PAR_REV                (0x0004) -#define MCF_GPIO_PAR_LCDCTL_PAR_SPL_SPR            (0x0008) -#define MCF_GPIO_PAR_LCDCTL_PAR_CONTRAST           (0x0010) -#define MCF_GPIO_PAR_LCDCTL_PAR_LSCLK              (0x0020) -#define MCF_GPIO_PAR_LCDCTL_PAR_LP_HSYNC           (0x0040) -#define MCF_GPIO_PAR_LCDCTL_PAR_FLM_VSYNC          (0x0080) -#define MCF_GPIO_PAR_LCDCTL_PAR_ACD_OE             (0x0100) - -/* Bit definitions and macros for MCF_GPIO_PAR_IRQ */ -#define MCF_GPIO_PAR_IRQ_PAR_IRQ1(x)               (((x)&0x0003)<<4) -#define MCF_GPIO_PAR_IRQ_PAR_IRQ2(x)               (((x)&0x0003)<<6) -#define MCF_GPIO_PAR_IRQ_PAR_IRQ4(x)               (((x)&0x0003)<<8) -#define MCF_GPIO_PAR_IRQ_PAR_IRQ5(x)               (((x)&0x0003)<<10) -#define MCF_GPIO_PAR_IRQ_PAR_IRQ6(x)               (((x)&0x0003)<<12) - -/* Bit definitions and macros for MCF_GPIO_MSCR_FLEXBUS */ -#define MCF_GPIO_MSCR_FLEXBUS_MSCR_ADDRCTL(x)      (((x)&0x03)<<0) -#define MCF_GPIO_MSCR_FLEXBUS_MSCR_DLOWER(x)       (((x)&0x03)<<2) -#define MCF_GPIO_MSCR_FLEXBUS_MSCR_DUPPER(x)       (((x)&0x03)<<4) - -/* Bit definitions and macros for MCF_GPIO_MSCR_SDRAM */ -#define MCF_GPIO_MSCR_SDRAM_MSCR_SDRAM(x)          (((x)&0x03)<<0) -#define MCF_GPIO_MSCR_SDRAM_MSCR_SDCLK(x)          (((x)&0x03)<<2) -#define MCF_GPIO_MSCR_SDRAM_MSCR_SDCLKB(x)         (((x)&0x03)<<4) - -/* Bit definitions and macros for MCF_GPIO_DSCR_I2C */ -#define MCF_GPIO_DSCR_I2C_I2C_DSE(x)               (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_PWM */ -#define MCF_GPIO_DSCR_PWM_PWM_DSE(x)               (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_FEC */ -#define MCF_GPIO_DSCR_FEC_FEC_DSE(x)               (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_UART */ -#define MCF_GPIO_DSCR_UART_UART0_DSE(x)            (((x)&0x03)<<0) -#define MCF_GPIO_DSCR_UART_UART1_DSE(x)            (((x)&0x03)<<2) - -/* Bit definitions and macros for MCF_GPIO_DSCR_QSPI */ -#define MCF_GPIO_DSCR_QSPI_QSPI_DSE(x)             (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_TIMER */ -#define MCF_GPIO_DSCR_TIMER_TIMER_DSE(x)           (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_SSI */ -#define MCF_GPIO_DSCR_SSI_SSI_DSE(x)               (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_LCD */ -#define MCF_GPIO_DSCR_LCD_LCD_DSE(x)               (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_DEBUG */ -#define MCF_GPIO_DSCR_DEBUG_DEBUG_DSE(x)           (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_CLKRST */ -#define MCF_GPIO_DSCR_CLKRST_CLKRST_DSE(x)         (((x)&0x03)<<0) - -/* Bit definitions and macros for MCF_GPIO_DSCR_IRQ */ -#define MCF_GPIO_DSCR_IRQ_IRQ_DSE(x)               (((x)&0x03)<<0) - -/* - * Generic GPIO support - */ -#define MCFGPIO_PODR			MCFGPIO_PODR_FECH -#define MCFGPIO_PDDR			MCFGPIO_PDDR_FECH -#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_FECH -#define MCFGPIO_SETR			MCFGPIO_PPDSDR_FECH -#define MCFGPIO_CLRR			MCFGPIO_PCLRR_FECH - -#define MCFGPIO_PIN_MAX			136 -#define MCFGPIO_IRQ_MAX			8 -#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE - - -/********************************************************************* - * - * Interrupt Controller (INTC) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_INTC0_IPRH             MCF_REG32(0xFC048000) -#define MCF_INTC0_IPRL             MCF_REG32(0xFC048004) -#define MCF_INTC0_IMRH             MCF_REG32(0xFC048008) -#define MCF_INTC0_IMRL             MCF_REG32(0xFC04800C) -#define MCF_INTC0_INTFRCH          MCF_REG32(0xFC048010) -#define MCF_INTC0_INTFRCL          MCF_REG32(0xFC048014) -#define MCF_INTC0_ICONFIG          MCF_REG16(0xFC04801A) -#define MCF_INTC0_SIMR             MCF_REG08(0xFC04801C) -#define MCF_INTC0_CIMR             MCF_REG08(0xFC04801D) -#define MCF_INTC0_CLMASK           MCF_REG08(0xFC04801E) -#define MCF_INTC0_SLMASK           MCF_REG08(0xFC04801F) -#define MCF_INTC0_ICR0             MCF_REG08(0xFC048040) -#define MCF_INTC0_ICR1             MCF_REG08(0xFC048041) -#define MCF_INTC0_ICR2             MCF_REG08(0xFC048042) -#define MCF_INTC0_ICR3             MCF_REG08(0xFC048043) -#define MCF_INTC0_ICR4             MCF_REG08(0xFC048044) -#define MCF_INTC0_ICR5             MCF_REG08(0xFC048045) -#define MCF_INTC0_ICR6             MCF_REG08(0xFC048046) -#define MCF_INTC0_ICR7             MCF_REG08(0xFC048047) -#define MCF_INTC0_ICR8             MCF_REG08(0xFC048048) -#define MCF_INTC0_ICR9             MCF_REG08(0xFC048049) -#define MCF_INTC0_ICR10            MCF_REG08(0xFC04804A) -#define MCF_INTC0_ICR11            MCF_REG08(0xFC04804B) -#define MCF_INTC0_ICR12            MCF_REG08(0xFC04804C) -#define MCF_INTC0_ICR13            MCF_REG08(0xFC04804D) -#define MCF_INTC0_ICR14            MCF_REG08(0xFC04804E) -#define MCF_INTC0_ICR15            MCF_REG08(0xFC04804F) -#define MCF_INTC0_ICR16            MCF_REG08(0xFC048050) -#define MCF_INTC0_ICR17            MCF_REG08(0xFC048051) -#define MCF_INTC0_ICR18            MCF_REG08(0xFC048052) -#define MCF_INTC0_ICR19            MCF_REG08(0xFC048053) -#define MCF_INTC0_ICR20            MCF_REG08(0xFC048054) -#define MCF_INTC0_ICR21            MCF_REG08(0xFC048055) -#define MCF_INTC0_ICR22            MCF_REG08(0xFC048056) -#define MCF_INTC0_ICR23            MCF_REG08(0xFC048057) -#define MCF_INTC0_ICR24            MCF_REG08(0xFC048058) -#define MCF_INTC0_ICR25            MCF_REG08(0xFC048059) -#define MCF_INTC0_ICR26            MCF_REG08(0xFC04805A) -#define MCF_INTC0_ICR27            MCF_REG08(0xFC04805B) -#define MCF_INTC0_ICR28            MCF_REG08(0xFC04805C) -#define MCF_INTC0_ICR29            MCF_REG08(0xFC04805D) -#define MCF_INTC0_ICR30            MCF_REG08(0xFC04805E) -#define MCF_INTC0_ICR31            MCF_REG08(0xFC04805F) -#define MCF_INTC0_ICR32            MCF_REG08(0xFC048060) -#define MCF_INTC0_ICR33            MCF_REG08(0xFC048061) -#define MCF_INTC0_ICR34            MCF_REG08(0xFC048062) -#define MCF_INTC0_ICR35            MCF_REG08(0xFC048063) -#define MCF_INTC0_ICR36            MCF_REG08(0xFC048064) -#define MCF_INTC0_ICR37            MCF_REG08(0xFC048065) -#define MCF_INTC0_ICR38            MCF_REG08(0xFC048066) -#define MCF_INTC0_ICR39            MCF_REG08(0xFC048067) -#define MCF_INTC0_ICR40            MCF_REG08(0xFC048068) -#define MCF_INTC0_ICR41            MCF_REG08(0xFC048069) -#define MCF_INTC0_ICR42            MCF_REG08(0xFC04806A) -#define MCF_INTC0_ICR43            MCF_REG08(0xFC04806B) -#define MCF_INTC0_ICR44            MCF_REG08(0xFC04806C) -#define MCF_INTC0_ICR45            MCF_REG08(0xFC04806D) -#define MCF_INTC0_ICR46            MCF_REG08(0xFC04806E) -#define MCF_INTC0_ICR47            MCF_REG08(0xFC04806F) -#define MCF_INTC0_ICR48            MCF_REG08(0xFC048070) -#define MCF_INTC0_ICR49            MCF_REG08(0xFC048071) -#define MCF_INTC0_ICR50            MCF_REG08(0xFC048072) -#define MCF_INTC0_ICR51            MCF_REG08(0xFC048073) -#define MCF_INTC0_ICR52            MCF_REG08(0xFC048074) -#define MCF_INTC0_ICR53            MCF_REG08(0xFC048075) -#define MCF_INTC0_ICR54            MCF_REG08(0xFC048076) -#define MCF_INTC0_ICR55            MCF_REG08(0xFC048077) -#define MCF_INTC0_ICR56            MCF_REG08(0xFC048078) -#define MCF_INTC0_ICR57            MCF_REG08(0xFC048079) -#define MCF_INTC0_ICR58            MCF_REG08(0xFC04807A) -#define MCF_INTC0_ICR59            MCF_REG08(0xFC04807B) -#define MCF_INTC0_ICR60            MCF_REG08(0xFC04807C) -#define MCF_INTC0_ICR61            MCF_REG08(0xFC04807D) -#define MCF_INTC0_ICR62            MCF_REG08(0xFC04807E) -#define MCF_INTC0_ICR63            MCF_REG08(0xFC04807F) -#define MCF_INTC0_ICR(x)           MCF_REG08(0xFC048040+((x)*0x001)) -#define MCF_INTC0_SWIACK           MCF_REG08(0xFC0480E0) -#define MCF_INTC0_L1IACK           MCF_REG08(0xFC0480E4) -#define MCF_INTC0_L2IACK           MCF_REG08(0xFC0480E8) -#define MCF_INTC0_L3IACK           MCF_REG08(0xFC0480EC) -#define MCF_INTC0_L4IACK           MCF_REG08(0xFC0480F0) -#define MCF_INTC0_L5IACK           MCF_REG08(0xFC0480F4) -#define MCF_INTC0_L6IACK           MCF_REG08(0xFC0480F8) -#define MCF_INTC0_L7IACK           MCF_REG08(0xFC0480FC) -#define MCF_INTC0_LIACK(x)         MCF_REG08(0xFC0480E4+((x)*0x004)) -#define MCF_INTC1_IPRH             MCF_REG32(0xFC04C000) -#define MCF_INTC1_IPRL             MCF_REG32(0xFC04C004) -#define MCF_INTC1_IMRH             MCF_REG32(0xFC04C008) -#define MCF_INTC1_IMRL             MCF_REG32(0xFC04C00C) -#define MCF_INTC1_INTFRCH          MCF_REG32(0xFC04C010) -#define MCF_INTC1_INTFRCL          MCF_REG32(0xFC04C014) -#define MCF_INTC1_ICONFIG          MCF_REG16(0xFC04C01A) -#define MCF_INTC1_SIMR             MCF_REG08(0xFC04C01C) -#define MCF_INTC1_CIMR             MCF_REG08(0xFC04C01D) -#define MCF_INTC1_CLMASK           MCF_REG08(0xFC04C01E) -#define MCF_INTC1_SLMASK           MCF_REG08(0xFC04C01F) -#define MCF_INTC1_ICR0             MCF_REG08(0xFC04C040) -#define MCF_INTC1_ICR1             MCF_REG08(0xFC04C041) -#define MCF_INTC1_ICR2             MCF_REG08(0xFC04C042) -#define MCF_INTC1_ICR3             MCF_REG08(0xFC04C043) -#define MCF_INTC1_ICR4             MCF_REG08(0xFC04C044) -#define MCF_INTC1_ICR5             MCF_REG08(0xFC04C045) -#define MCF_INTC1_ICR6             MCF_REG08(0xFC04C046) -#define MCF_INTC1_ICR7             MCF_REG08(0xFC04C047) -#define MCF_INTC1_ICR8             MCF_REG08(0xFC04C048) -#define MCF_INTC1_ICR9             MCF_REG08(0xFC04C049) -#define MCF_INTC1_ICR10            MCF_REG08(0xFC04C04A) -#define MCF_INTC1_ICR11            MCF_REG08(0xFC04C04B) -#define MCF_INTC1_ICR12            MCF_REG08(0xFC04C04C) -#define MCF_INTC1_ICR13            MCF_REG08(0xFC04C04D) -#define MCF_INTC1_ICR14            MCF_REG08(0xFC04C04E) -#define MCF_INTC1_ICR15            MCF_REG08(0xFC04C04F) -#define MCF_INTC1_ICR16            MCF_REG08(0xFC04C050) -#define MCF_INTC1_ICR17            MCF_REG08(0xFC04C051) -#define MCF_INTC1_ICR18            MCF_REG08(0xFC04C052) -#define MCF_INTC1_ICR19            MCF_REG08(0xFC04C053) -#define MCF_INTC1_ICR20            MCF_REG08(0xFC04C054) -#define MCF_INTC1_ICR21            MCF_REG08(0xFC04C055) -#define MCF_INTC1_ICR22            MCF_REG08(0xFC04C056) -#define MCF_INTC1_ICR23            MCF_REG08(0xFC04C057) -#define MCF_INTC1_ICR24            MCF_REG08(0xFC04C058) -#define MCF_INTC1_ICR25            MCF_REG08(0xFC04C059) -#define MCF_INTC1_ICR26            MCF_REG08(0xFC04C05A) -#define MCF_INTC1_ICR27            MCF_REG08(0xFC04C05B) -#define MCF_INTC1_ICR28            MCF_REG08(0xFC04C05C) -#define MCF_INTC1_ICR29            MCF_REG08(0xFC04C05D) -#define MCF_INTC1_ICR30            MCF_REG08(0xFC04C05E) -#define MCF_INTC1_ICR31            MCF_REG08(0xFC04C05F) -#define MCF_INTC1_ICR32            MCF_REG08(0xFC04C060) -#define MCF_INTC1_ICR33            MCF_REG08(0xFC04C061) -#define MCF_INTC1_ICR34            MCF_REG08(0xFC04C062) -#define MCF_INTC1_ICR35            MCF_REG08(0xFC04C063) -#define MCF_INTC1_ICR36            MCF_REG08(0xFC04C064) -#define MCF_INTC1_ICR37            MCF_REG08(0xFC04C065) -#define MCF_INTC1_ICR38            MCF_REG08(0xFC04C066) -#define MCF_INTC1_ICR39            MCF_REG08(0xFC04C067) -#define MCF_INTC1_ICR40            MCF_REG08(0xFC04C068) -#define MCF_INTC1_ICR41            MCF_REG08(0xFC04C069) -#define MCF_INTC1_ICR42            MCF_REG08(0xFC04C06A) -#define MCF_INTC1_ICR43            MCF_REG08(0xFC04C06B) -#define MCF_INTC1_ICR44            MCF_REG08(0xFC04C06C) -#define MCF_INTC1_ICR45            MCF_REG08(0xFC04C06D) -#define MCF_INTC1_ICR46            MCF_REG08(0xFC04C06E) -#define MCF_INTC1_ICR47            MCF_REG08(0xFC04C06F) -#define MCF_INTC1_ICR48            MCF_REG08(0xFC04C070) -#define MCF_INTC1_ICR49            MCF_REG08(0xFC04C071) -#define MCF_INTC1_ICR50            MCF_REG08(0xFC04C072) -#define MCF_INTC1_ICR51            MCF_REG08(0xFC04C073) -#define MCF_INTC1_ICR52            MCF_REG08(0xFC04C074) -#define MCF_INTC1_ICR53            MCF_REG08(0xFC04C075) -#define MCF_INTC1_ICR54            MCF_REG08(0xFC04C076) -#define MCF_INTC1_ICR55            MCF_REG08(0xFC04C077) -#define MCF_INTC1_ICR56            MCF_REG08(0xFC04C078) -#define MCF_INTC1_ICR57            MCF_REG08(0xFC04C079) -#define MCF_INTC1_ICR58            MCF_REG08(0xFC04C07A) -#define MCF_INTC1_ICR59            MCF_REG08(0xFC04C07B) -#define MCF_INTC1_ICR60            MCF_REG08(0xFC04C07C) -#define MCF_INTC1_ICR61            MCF_REG08(0xFC04C07D) -#define MCF_INTC1_ICR62            MCF_REG08(0xFC04C07E) -#define MCF_INTC1_ICR63            MCF_REG08(0xFC04C07F) -#define MCF_INTC1_ICR(x)           MCF_REG08(0xFC04C040+((x)*0x001)) -#define MCF_INTC1_SWIACK           MCF_REG08(0xFC04C0E0) -#define MCF_INTC1_L1IACK           MCF_REG08(0xFC04C0E4) -#define MCF_INTC1_L2IACK           MCF_REG08(0xFC04C0E8) -#define MCF_INTC1_L3IACK           MCF_REG08(0xFC04C0EC) -#define MCF_INTC1_L4IACK           MCF_REG08(0xFC04C0F0) -#define MCF_INTC1_L5IACK           MCF_REG08(0xFC04C0F4) -#define MCF_INTC1_L6IACK           MCF_REG08(0xFC04C0F8) -#define MCF_INTC1_L7IACK           MCF_REG08(0xFC04C0FC) -#define MCF_INTC1_LIACK(x)         MCF_REG08(0xFC04C0E4+((x)*0x004)) -#define MCF_INTC_IPRH(x)           MCF_REG32(0xFC048000+((x)*0x4000)) -#define MCF_INTC_IPRL(x)           MCF_REG32(0xFC048004+((x)*0x4000)) -#define MCF_INTC_IMRH(x)           MCF_REG32(0xFC048008+((x)*0x4000)) -#define MCF_INTC_IMRL(x)           MCF_REG32(0xFC04800C+((x)*0x4000)) -#define MCF_INTC_INTFRCH(x)        MCF_REG32(0xFC048010+((x)*0x4000)) -#define MCF_INTC_INTFRCL(x)        MCF_REG32(0xFC048014+((x)*0x4000)) -#define MCF_INTC_ICONFIG(x)        MCF_REG16(0xFC04801A+((x)*0x4000)) -#define MCF_INTC_SIMR(x)           MCF_REG08(0xFC04801C+((x)*0x4000)) -#define MCF_INTC_CIMR(x)           MCF_REG08(0xFC04801D+((x)*0x4000)) -#define MCF_INTC_CLMASK(x)         MCF_REG08(0xFC04801E+((x)*0x4000)) -#define MCF_INTC_SLMASK(x)         MCF_REG08(0xFC04801F+((x)*0x4000)) -#define MCF_INTC_ICR0(x)           MCF_REG08(0xFC048040+((x)*0x4000)) -#define MCF_INTC_ICR1(x)           MCF_REG08(0xFC048041+((x)*0x4000)) -#define MCF_INTC_ICR2(x)           MCF_REG08(0xFC048042+((x)*0x4000)) -#define MCF_INTC_ICR3(x)           MCF_REG08(0xFC048043+((x)*0x4000)) -#define MCF_INTC_ICR4(x)           MCF_REG08(0xFC048044+((x)*0x4000)) -#define MCF_INTC_ICR5(x)           MCF_REG08(0xFC048045+((x)*0x4000)) -#define MCF_INTC_ICR6(x)           MCF_REG08(0xFC048046+((x)*0x4000)) -#define MCF_INTC_ICR7(x)           MCF_REG08(0xFC048047+((x)*0x4000)) -#define MCF_INTC_ICR8(x)           MCF_REG08(0xFC048048+((x)*0x4000)) -#define MCF_INTC_ICR9(x)           MCF_REG08(0xFC048049+((x)*0x4000)) -#define MCF_INTC_ICR10(x)          MCF_REG08(0xFC04804A+((x)*0x4000)) -#define MCF_INTC_ICR11(x)          MCF_REG08(0xFC04804B+((x)*0x4000)) -#define MCF_INTC_ICR12(x)          MCF_REG08(0xFC04804C+((x)*0x4000)) -#define MCF_INTC_ICR13(x)          MCF_REG08(0xFC04804D+((x)*0x4000)) -#define MCF_INTC_ICR14(x)          MCF_REG08(0xFC04804E+((x)*0x4000)) -#define MCF_INTC_ICR15(x)          MCF_REG08(0xFC04804F+((x)*0x4000)) -#define MCF_INTC_ICR16(x)          MCF_REG08(0xFC048050+((x)*0x4000)) -#define MCF_INTC_ICR17(x)          MCF_REG08(0xFC048051+((x)*0x4000)) -#define MCF_INTC_ICR18(x)          MCF_REG08(0xFC048052+((x)*0x4000)) -#define MCF_INTC_ICR19(x)          MCF_REG08(0xFC048053+((x)*0x4000)) -#define MCF_INTC_ICR20(x)          MCF_REG08(0xFC048054+((x)*0x4000)) -#define MCF_INTC_ICR21(x)          MCF_REG08(0xFC048055+((x)*0x4000)) -#define MCF_INTC_ICR22(x)          MCF_REG08(0xFC048056+((x)*0x4000)) -#define MCF_INTC_ICR23(x)          MCF_REG08(0xFC048057+((x)*0x4000)) -#define MCF_INTC_ICR24(x)          MCF_REG08(0xFC048058+((x)*0x4000)) -#define MCF_INTC_ICR25(x)          MCF_REG08(0xFC048059+((x)*0x4000)) -#define MCF_INTC_ICR26(x)          MCF_REG08(0xFC04805A+((x)*0x4000)) -#define MCF_INTC_ICR27(x)          MCF_REG08(0xFC04805B+((x)*0x4000)) -#define MCF_INTC_ICR28(x)          MCF_REG08(0xFC04805C+((x)*0x4000)) -#define MCF_INTC_ICR29(x)          MCF_REG08(0xFC04805D+((x)*0x4000)) -#define MCF_INTC_ICR30(x)          MCF_REG08(0xFC04805E+((x)*0x4000)) -#define MCF_INTC_ICR31(x)          MCF_REG08(0xFC04805F+((x)*0x4000)) -#define MCF_INTC_ICR32(x)          MCF_REG08(0xFC048060+((x)*0x4000)) -#define MCF_INTC_ICR33(x)          MCF_REG08(0xFC048061+((x)*0x4000)) -#define MCF_INTC_ICR34(x)          MCF_REG08(0xFC048062+((x)*0x4000)) -#define MCF_INTC_ICR35(x)          MCF_REG08(0xFC048063+((x)*0x4000)) -#define MCF_INTC_ICR36(x)          MCF_REG08(0xFC048064+((x)*0x4000)) -#define MCF_INTC_ICR37(x)          MCF_REG08(0xFC048065+((x)*0x4000)) -#define MCF_INTC_ICR38(x)          MCF_REG08(0xFC048066+((x)*0x4000)) -#define MCF_INTC_ICR39(x)          MCF_REG08(0xFC048067+((x)*0x4000)) -#define MCF_INTC_ICR40(x)          MCF_REG08(0xFC048068+((x)*0x4000)) -#define MCF_INTC_ICR41(x)          MCF_REG08(0xFC048069+((x)*0x4000)) -#define MCF_INTC_ICR42(x)          MCF_REG08(0xFC04806A+((x)*0x4000)) -#define MCF_INTC_ICR43(x)          MCF_REG08(0xFC04806B+((x)*0x4000)) -#define MCF_INTC_ICR44(x)          MCF_REG08(0xFC04806C+((x)*0x4000)) -#define MCF_INTC_ICR45(x)          MCF_REG08(0xFC04806D+((x)*0x4000)) -#define MCF_INTC_ICR46(x)          MCF_REG08(0xFC04806E+((x)*0x4000)) -#define MCF_INTC_ICR47(x)          MCF_REG08(0xFC04806F+((x)*0x4000)) -#define MCF_INTC_ICR48(x)          MCF_REG08(0xFC048070+((x)*0x4000)) -#define MCF_INTC_ICR49(x)          MCF_REG08(0xFC048071+((x)*0x4000)) -#define MCF_INTC_ICR50(x)          MCF_REG08(0xFC048072+((x)*0x4000)) -#define MCF_INTC_ICR51(x)          MCF_REG08(0xFC048073+((x)*0x4000)) -#define MCF_INTC_ICR52(x)          MCF_REG08(0xFC048074+((x)*0x4000)) -#define MCF_INTC_ICR53(x)          MCF_REG08(0xFC048075+((x)*0x4000)) -#define MCF_INTC_ICR54(x)          MCF_REG08(0xFC048076+((x)*0x4000)) -#define MCF_INTC_ICR55(x)          MCF_REG08(0xFC048077+((x)*0x4000)) -#define MCF_INTC_ICR56(x)          MCF_REG08(0xFC048078+((x)*0x4000)) -#define MCF_INTC_ICR57(x)          MCF_REG08(0xFC048079+((x)*0x4000)) -#define MCF_INTC_ICR58(x)          MCF_REG08(0xFC04807A+((x)*0x4000)) -#define MCF_INTC_ICR59(x)          MCF_REG08(0xFC04807B+((x)*0x4000)) -#define MCF_INTC_ICR60(x)          MCF_REG08(0xFC04807C+((x)*0x4000)) -#define MCF_INTC_ICR61(x)          MCF_REG08(0xFC04807D+((x)*0x4000)) -#define MCF_INTC_ICR62(x)          MCF_REG08(0xFC04807E+((x)*0x4000)) -#define MCF_INTC_ICR63(x)          MCF_REG08(0xFC04807F+((x)*0x4000)) -#define MCF_INTC_SWIACK(x)         MCF_REG08(0xFC0480E0+((x)*0x4000)) -#define MCF_INTC_L1IACK(x)         MCF_REG08(0xFC0480E4+((x)*0x4000)) -#define MCF_INTC_L2IACK(x)         MCF_REG08(0xFC0480E8+((x)*0x4000)) -#define MCF_INTC_L3IACK(x)         MCF_REG08(0xFC0480EC+((x)*0x4000)) -#define MCF_INTC_L4IACK(x)         MCF_REG08(0xFC0480F0+((x)*0x4000)) -#define MCF_INTC_L5IACK(x)         MCF_REG08(0xFC0480F4+((x)*0x4000)) -#define MCF_INTC_L6IACK(x)         MCF_REG08(0xFC0480F8+((x)*0x4000)) -#define MCF_INTC_L7IACK(x)         MCF_REG08(0xFC0480FC+((x)*0x4000)) - -/* Bit definitions and macros for MCF_INTC_IPRH */ -#define MCF_INTC_IPRH_INT32        (0x00000001) -#define MCF_INTC_IPRH_INT33        (0x00000002) -#define MCF_INTC_IPRH_INT34        (0x00000004) -#define MCF_INTC_IPRH_INT35        (0x00000008) -#define MCF_INTC_IPRH_INT36        (0x00000010) -#define MCF_INTC_IPRH_INT37        (0x00000020) -#define MCF_INTC_IPRH_INT38        (0x00000040) -#define MCF_INTC_IPRH_INT39        (0x00000080) -#define MCF_INTC_IPRH_INT40        (0x00000100) -#define MCF_INTC_IPRH_INT41        (0x00000200) -#define MCF_INTC_IPRH_INT42        (0x00000400) -#define MCF_INTC_IPRH_INT43        (0x00000800) -#define MCF_INTC_IPRH_INT44        (0x00001000) -#define MCF_INTC_IPRH_INT45        (0x00002000) -#define MCF_INTC_IPRH_INT46        (0x00004000) -#define MCF_INTC_IPRH_INT47        (0x00008000) -#define MCF_INTC_IPRH_INT48        (0x00010000) -#define MCF_INTC_IPRH_INT49        (0x00020000) -#define MCF_INTC_IPRH_INT50        (0x00040000) -#define MCF_INTC_IPRH_INT51        (0x00080000) -#define MCF_INTC_IPRH_INT52        (0x00100000) -#define MCF_INTC_IPRH_INT53        (0x00200000) -#define MCF_INTC_IPRH_INT54        (0x00400000) -#define MCF_INTC_IPRH_INT55        (0x00800000) -#define MCF_INTC_IPRH_INT56        (0x01000000) -#define MCF_INTC_IPRH_INT57        (0x02000000) -#define MCF_INTC_IPRH_INT58        (0x04000000) -#define MCF_INTC_IPRH_INT59        (0x08000000) -#define MCF_INTC_IPRH_INT60        (0x10000000) -#define MCF_INTC_IPRH_INT61        (0x20000000) -#define MCF_INTC_IPRH_INT62        (0x40000000) -#define MCF_INTC_IPRH_INT63        (0x80000000) - -/* Bit definitions and macros for MCF_INTC_IPRL */ -#define MCF_INTC_IPRL_INT0         (0x00000001) -#define MCF_INTC_IPRL_INT1         (0x00000002) -#define MCF_INTC_IPRL_INT2         (0x00000004) -#define MCF_INTC_IPRL_INT3         (0x00000008) -#define MCF_INTC_IPRL_INT4         (0x00000010) -#define MCF_INTC_IPRL_INT5         (0x00000020) -#define MCF_INTC_IPRL_INT6         (0x00000040) -#define MCF_INTC_IPRL_INT7         (0x00000080) -#define MCF_INTC_IPRL_INT8         (0x00000100) -#define MCF_INTC_IPRL_INT9         (0x00000200) -#define MCF_INTC_IPRL_INT10        (0x00000400) -#define MCF_INTC_IPRL_INT11        (0x00000800) -#define MCF_INTC_IPRL_INT12        (0x00001000) -#define MCF_INTC_IPRL_INT13        (0x00002000) -#define MCF_INTC_IPRL_INT14        (0x00004000) -#define MCF_INTC_IPRL_INT15        (0x00008000) -#define MCF_INTC_IPRL_INT16        (0x00010000) -#define MCF_INTC_IPRL_INT17        (0x00020000) -#define MCF_INTC_IPRL_INT18        (0x00040000) -#define MCF_INTC_IPRL_INT19        (0x00080000) -#define MCF_INTC_IPRL_INT20        (0x00100000) -#define MCF_INTC_IPRL_INT21        (0x00200000) -#define MCF_INTC_IPRL_INT22        (0x00400000) -#define MCF_INTC_IPRL_INT23        (0x00800000) -#define MCF_INTC_IPRL_INT24        (0x01000000) -#define MCF_INTC_IPRL_INT25        (0x02000000) -#define MCF_INTC_IPRL_INT26        (0x04000000) -#define MCF_INTC_IPRL_INT27        (0x08000000) -#define MCF_INTC_IPRL_INT28        (0x10000000) -#define MCF_INTC_IPRL_INT29        (0x20000000) -#define MCF_INTC_IPRL_INT30        (0x40000000) -#define MCF_INTC_IPRL_INT31        (0x80000000) - -/* Bit definitions and macros for MCF_INTC_IMRH */ -#define MCF_INTC_IMRH_INT_MASK32   (0x00000001) -#define MCF_INTC_IMRH_INT_MASK33   (0x00000002) -#define MCF_INTC_IMRH_INT_MASK34   (0x00000004) -#define MCF_INTC_IMRH_INT_MASK35   (0x00000008) -#define MCF_INTC_IMRH_INT_MASK36   (0x00000010) -#define MCF_INTC_IMRH_INT_MASK37   (0x00000020) -#define MCF_INTC_IMRH_INT_MASK38   (0x00000040) -#define MCF_INTC_IMRH_INT_MASK39   (0x00000080) -#define MCF_INTC_IMRH_INT_MASK40   (0x00000100) -#define MCF_INTC_IMRH_INT_MASK41   (0x00000200) -#define MCF_INTC_IMRH_INT_MASK42   (0x00000400) -#define MCF_INTC_IMRH_INT_MASK43   (0x00000800) -#define MCF_INTC_IMRH_INT_MASK44   (0x00001000) -#define MCF_INTC_IMRH_INT_MASK45   (0x00002000) -#define MCF_INTC_IMRH_INT_MASK46   (0x00004000) -#define MCF_INTC_IMRH_INT_MASK47   (0x00008000) -#define MCF_INTC_IMRH_INT_MASK48   (0x00010000) -#define MCF_INTC_IMRH_INT_MASK49   (0x00020000) -#define MCF_INTC_IMRH_INT_MASK50   (0x00040000) -#define MCF_INTC_IMRH_INT_MASK51   (0x00080000) -#define MCF_INTC_IMRH_INT_MASK52   (0x00100000) -#define MCF_INTC_IMRH_INT_MASK53   (0x00200000) -#define MCF_INTC_IMRH_INT_MASK54   (0x00400000) -#define MCF_INTC_IMRH_INT_MASK55   (0x00800000) -#define MCF_INTC_IMRH_INT_MASK56   (0x01000000) -#define MCF_INTC_IMRH_INT_MASK57   (0x02000000) -#define MCF_INTC_IMRH_INT_MASK58   (0x04000000) -#define MCF_INTC_IMRH_INT_MASK59   (0x08000000) -#define MCF_INTC_IMRH_INT_MASK60   (0x10000000) -#define MCF_INTC_IMRH_INT_MASK61   (0x20000000) -#define MCF_INTC_IMRH_INT_MASK62   (0x40000000) -#define MCF_INTC_IMRH_INT_MASK63   (0x80000000) - -/* Bit definitions and macros for MCF_INTC_IMRL */ -#define MCF_INTC_IMRL_INT_MASK0    (0x00000001) -#define MCF_INTC_IMRL_INT_MASK1    (0x00000002) -#define MCF_INTC_IMRL_INT_MASK2    (0x00000004) -#define MCF_INTC_IMRL_INT_MASK3    (0x00000008) -#define MCF_INTC_IMRL_INT_MASK4    (0x00000010) -#define MCF_INTC_IMRL_INT_MASK5    (0x00000020) -#define MCF_INTC_IMRL_INT_MASK6    (0x00000040) -#define MCF_INTC_IMRL_INT_MASK7    (0x00000080) -#define MCF_INTC_IMRL_INT_MASK8    (0x00000100) -#define MCF_INTC_IMRL_INT_MASK9    (0x00000200) -#define MCF_INTC_IMRL_INT_MASK10   (0x00000400) -#define MCF_INTC_IMRL_INT_MASK11   (0x00000800) -#define MCF_INTC_IMRL_INT_MASK12   (0x00001000) -#define MCF_INTC_IMRL_INT_MASK13   (0x00002000) -#define MCF_INTC_IMRL_INT_MASK14   (0x00004000) -#define MCF_INTC_IMRL_INT_MASK15   (0x00008000) -#define MCF_INTC_IMRL_INT_MASK16   (0x00010000) -#define MCF_INTC_IMRL_INT_MASK17   (0x00020000) -#define MCF_INTC_IMRL_INT_MASK18   (0x00040000) -#define MCF_INTC_IMRL_INT_MASK19   (0x00080000) -#define MCF_INTC_IMRL_INT_MASK20   (0x00100000) -#define MCF_INTC_IMRL_INT_MASK21   (0x00200000) -#define MCF_INTC_IMRL_INT_MASK22   (0x00400000) -#define MCF_INTC_IMRL_INT_MASK23   (0x00800000) -#define MCF_INTC_IMRL_INT_MASK24   (0x01000000) -#define MCF_INTC_IMRL_INT_MASK25   (0x02000000) -#define MCF_INTC_IMRL_INT_MASK26   (0x04000000) -#define MCF_INTC_IMRL_INT_MASK27   (0x08000000) -#define MCF_INTC_IMRL_INT_MASK28   (0x10000000) -#define MCF_INTC_IMRL_INT_MASK29   (0x20000000) -#define MCF_INTC_IMRL_INT_MASK30   (0x40000000) -#define MCF_INTC_IMRL_INT_MASK31   (0x80000000) - -/* Bit definitions and macros for MCF_INTC_INTFRCH */ -#define MCF_INTC_INTFRCH_INTFRC32  (0x00000001) -#define MCF_INTC_INTFRCH_INTFRC33  (0x00000002) -#define MCF_INTC_INTFRCH_INTFRC34  (0x00000004) -#define MCF_INTC_INTFRCH_INTFRC35  (0x00000008) -#define MCF_INTC_INTFRCH_INTFRC36  (0x00000010) -#define MCF_INTC_INTFRCH_INTFRC37  (0x00000020) -#define MCF_INTC_INTFRCH_INTFRC38  (0x00000040) -#define MCF_INTC_INTFRCH_INTFRC39  (0x00000080) -#define MCF_INTC_INTFRCH_INTFRC40  (0x00000100) -#define MCF_INTC_INTFRCH_INTFRC41  (0x00000200) -#define MCF_INTC_INTFRCH_INTFRC42  (0x00000400) -#define MCF_INTC_INTFRCH_INTFRC43  (0x00000800) -#define MCF_INTC_INTFRCH_INTFRC44  (0x00001000) -#define MCF_INTC_INTFRCH_INTFRC45  (0x00002000) -#define MCF_INTC_INTFRCH_INTFRC46  (0x00004000) -#define MCF_INTC_INTFRCH_INTFRC47  (0x00008000) -#define MCF_INTC_INTFRCH_INTFRC48  (0x00010000) -#define MCF_INTC_INTFRCH_INTFRC49  (0x00020000) -#define MCF_INTC_INTFRCH_INTFRC50  (0x00040000) -#define MCF_INTC_INTFRCH_INTFRC51  (0x00080000) -#define MCF_INTC_INTFRCH_INTFRC52  (0x00100000) -#define MCF_INTC_INTFRCH_INTFRC53  (0x00200000) -#define MCF_INTC_INTFRCH_INTFRC54  (0x00400000) -#define MCF_INTC_INTFRCH_INTFRC55  (0x00800000) -#define MCF_INTC_INTFRCH_INTFRC56  (0x01000000) -#define MCF_INTC_INTFRCH_INTFRC57  (0x02000000) -#define MCF_INTC_INTFRCH_INTFRC58  (0x04000000) -#define MCF_INTC_INTFRCH_INTFRC59  (0x08000000) -#define MCF_INTC_INTFRCH_INTFRC60  (0x10000000) -#define MCF_INTC_INTFRCH_INTFRC61  (0x20000000) -#define MCF_INTC_INTFRCH_INTFRC62  (0x40000000) -#define MCF_INTC_INTFRCH_INTFRC63  (0x80000000) - -/* Bit definitions and macros for MCF_INTC_INTFRCL */ -#define MCF_INTC_INTFRCL_INTFRC0   (0x00000001) -#define MCF_INTC_INTFRCL_INTFRC1   (0x00000002) -#define MCF_INTC_INTFRCL_INTFRC2   (0x00000004) -#define MCF_INTC_INTFRCL_INTFRC3   (0x00000008) -#define MCF_INTC_INTFRCL_INTFRC4   (0x00000010) -#define MCF_INTC_INTFRCL_INTFRC5   (0x00000020) -#define MCF_INTC_INTFRCL_INTFRC6   (0x00000040) -#define MCF_INTC_INTFRCL_INTFRC7   (0x00000080) -#define MCF_INTC_INTFRCL_INTFRC8   (0x00000100) -#define MCF_INTC_INTFRCL_INTFRC9   (0x00000200) -#define MCF_INTC_INTFRCL_INTFRC10  (0x00000400) -#define MCF_INTC_INTFRCL_INTFRC11  (0x00000800) -#define MCF_INTC_INTFRCL_INTFRC12  (0x00001000) -#define MCF_INTC_INTFRCL_INTFRC13  (0x00002000) -#define MCF_INTC_INTFRCL_INTFRC14  (0x00004000) -#define MCF_INTC_INTFRCL_INTFRC15  (0x00008000) -#define MCF_INTC_INTFRCL_INTFRC16  (0x00010000) -#define MCF_INTC_INTFRCL_INTFRC17  (0x00020000) -#define MCF_INTC_INTFRCL_INTFRC18  (0x00040000) -#define MCF_INTC_INTFRCL_INTFRC19  (0x00080000) -#define MCF_INTC_INTFRCL_INTFRC20  (0x00100000) -#define MCF_INTC_INTFRCL_INTFRC21  (0x00200000) -#define MCF_INTC_INTFRCL_INTFRC22  (0x00400000) -#define MCF_INTC_INTFRCL_INTFRC23  (0x00800000) -#define MCF_INTC_INTFRCL_INTFRC24  (0x01000000) -#define MCF_INTC_INTFRCL_INTFRC25  (0x02000000) -#define MCF_INTC_INTFRCL_INTFRC26  (0x04000000) -#define MCF_INTC_INTFRCL_INTFRC27  (0x08000000) -#define MCF_INTC_INTFRCL_INTFRC28  (0x10000000) -#define MCF_INTC_INTFRCL_INTFRC29  (0x20000000) -#define MCF_INTC_INTFRCL_INTFRC30  (0x40000000) -#define MCF_INTC_INTFRCL_INTFRC31  (0x80000000) - -/* Bit definitions and macros for MCF_INTC_ICONFIG */ -#define MCF_INTC_ICONFIG_EMASK     (0x0020) -#define MCF_INTC_ICONFIG_ELVLPRI1  (0x0200) -#define MCF_INTC_ICONFIG_ELVLPRI2  (0x0400) -#define MCF_INTC_ICONFIG_ELVLPRI3  (0x0800) -#define MCF_INTC_ICONFIG_ELVLPRI4  (0x1000) -#define MCF_INTC_ICONFIG_ELVLPRI5  (0x2000) -#define MCF_INTC_ICONFIG_ELVLPRI6  (0x4000) -#define MCF_INTC_ICONFIG_ELVLPRI7  (0x8000) - -/* Bit definitions and macros for MCF_INTC_SIMR */ -#define MCF_INTC_SIMR_SIMR(x)      (((x)&0x7F)<<0) - -/* Bit definitions and macros for MCF_INTC_CIMR */ -#define MCF_INTC_CIMR_CIMR(x)      (((x)&0x7F)<<0) - -/* Bit definitions and macros for MCF_INTC_CLMASK */ -#define MCF_INTC_CLMASK_CLMASK(x)  (((x)&0x0F)<<0) - -/* Bit definitions and macros for MCF_INTC_SLMASK */ -#define MCF_INTC_SLMASK_SLMASK(x)  (((x)&0x0F)<<0) - -/* Bit definitions and macros for MCF_INTC_ICR */ -#define MCF_INTC_ICR_IL(x)         (((x)&0x07)<<0) - -/* Bit definitions and macros for MCF_INTC_SWIACK */ -#define MCF_INTC_SWIACK_VECTOR(x)  (((x)&0xFF)<<0) - -/* Bit definitions and macros for MCF_INTC_LIACK */ -#define MCF_INTC_LIACK_VECTOR(x)   (((x)&0xFF)<<0) - -/********************************************************************/ -/********************************************************************* -* -* LCD Controller (LCDC) -* -*********************************************************************/ - -/* Register read/write macros */ -#define MCF_LCDC_LSSAR                  MCF_REG32(0xFC0AC000) -#define MCF_LCDC_LSR                    MCF_REG32(0xFC0AC004) -#define MCF_LCDC_LVPWR                  MCF_REG32(0xFC0AC008) -#define MCF_LCDC_LCPR                   MCF_REG32(0xFC0AC00C) -#define MCF_LCDC_LCWHBR                 MCF_REG32(0xFC0AC010) -#define MCF_LCDC_LCCMR                  MCF_REG32(0xFC0AC014) -#define MCF_LCDC_LPCR                   MCF_REG32(0xFC0AC018) -#define MCF_LCDC_LHCR                   MCF_REG32(0xFC0AC01C) -#define MCF_LCDC_LVCR                   MCF_REG32(0xFC0AC020) -#define MCF_LCDC_LPOR                   MCF_REG32(0xFC0AC024) -#define MCF_LCDC_LSCR                   MCF_REG32(0xFC0AC028) -#define MCF_LCDC_LPCCR                  MCF_REG32(0xFC0AC02C) -#define MCF_LCDC_LDCR                   MCF_REG32(0xFC0AC030) -#define MCF_LCDC_LRMCR                  MCF_REG32(0xFC0AC034) -#define MCF_LCDC_LICR                   MCF_REG32(0xFC0AC038) -#define MCF_LCDC_LIER                   MCF_REG32(0xFC0AC03C) -#define MCF_LCDC_LISR                   MCF_REG32(0xFC0AC040) -#define MCF_LCDC_LGWSAR                 MCF_REG32(0xFC0AC050) -#define MCF_LCDC_LGWSR                  MCF_REG32(0xFC0AC054) -#define MCF_LCDC_LGWVPWR                MCF_REG32(0xFC0AC058) -#define MCF_LCDC_LGWPOR                 MCF_REG32(0xFC0AC05C) -#define MCF_LCDC_LGWPR                  MCF_REG32(0xFC0AC060) -#define MCF_LCDC_LGWCR                  MCF_REG32(0xFC0AC064) -#define MCF_LCDC_LGWDCR                 MCF_REG32(0xFC0AC068) -#define MCF_LCDC_BPLUT_BASE             MCF_REG32(0xFC0AC800) -#define MCF_LCDC_GWLUT_BASE             MCF_REG32(0xFC0ACC00) - -/* Bit definitions and macros for MCF_LCDC_LSSAR */ -#define MCF_LCDC_LSSAR_SSA(x)           (((x)&0x3FFFFFFF)<<2) - -/* Bit definitions and macros for MCF_LCDC_LSR */ -#define MCF_LCDC_LSR_YMAX(x)            (((x)&0x000003FF)<<0) -#define MCF_LCDC_LSR_XMAX(x)            (((x)&0x0000003F)<<20) - -/* Bit definitions and macros for MCF_LCDC_LVPWR */ -#define MCF_LCDC_LVPWR_VPW(x)           (((x)&0x000003FF)<<0) - -/* Bit definitions and macros for MCF_LCDC_LCPR */ -#define MCF_LCDC_LCPR_CYP(x)            (((x)&0x000003FF)<<0) -#define MCF_LCDC_LCPR_CXP(x)            (((x)&0x000003FF)<<16) -#define MCF_LCDC_LCPR_OP                (0x10000000) -#define MCF_LCDC_LCPR_CC(x)             (((x)&0x00000003)<<30) -#define MCF_LCDC_LCPR_CC_TRANSPARENT    (0x00000000) -#define MCF_LCDC_LCPR_CC_OR             (0x40000000) -#define MCF_LCDC_LCPR_CC_XOR            (0x80000000) -#define MCF_LCDC_LCPR_CC_AND            (0xC0000000) -#define MCF_LCDC_LCPR_OP_ON             (0x10000000) -#define MCF_LCDC_LCPR_OP_OFF            (0x00000000) - -/* Bit definitions and macros for MCF_LCDC_LCWHBR */ -#define MCF_LCDC_LCWHBR_BD(x)           (((x)&0x000000FF)<<0) -#define MCF_LCDC_LCWHBR_CH(x)           (((x)&0x0000001F)<<16) -#define MCF_LCDC_LCWHBR_CW(x)           (((x)&0x0000001F)<<24) -#define MCF_LCDC_LCWHBR_BK_EN           (0x80000000) -#define MCF_LCDC_LCWHBR_BK_EN_ON        (0x80000000) -#define MCF_LCDC_LCWHBR_BK_EN_OFF       (0x00000000) - -/* Bit definitions and macros for MCF_LCDC_LCCMR */ -#define MCF_LCDC_LCCMR_CUR_COL_B(x)     (((x)&0x0000003F)<<0) -#define MCF_LCDC_LCCMR_CUR_COL_G(x)     (((x)&0x0000003F)<<6) -#define MCF_LCDC_LCCMR_CUR_COL_R(x)     (((x)&0x0000003F)<<12) - -/* Bit definitions and macros for MCF_LCDC_LPCR */ -#define MCF_LCDC_LPCR_PCD(x)            (((x)&0x0000003F)<<0) -#define MCF_LCDC_LPCR_SHARP             (0x00000040) -#define MCF_LCDC_LPCR_SCLKSEL           (0x00000080) -#define MCF_LCDC_LPCR_ACD(x)            (((x)&0x0000007F)<<8) -#define MCF_LCDC_LPCR_ACDSEL            (0x00008000) -#define MCF_LCDC_LPCR_REV_VS            (0x00010000) -#define MCF_LCDC_LPCR_SWAP_SEL          (0x00020000) -#define MCF_LCDC_LPCR_ENDSEL            (0x00040000) -#define MCF_LCDC_LPCR_SCLKIDLE          (0x00080000) -#define MCF_LCDC_LPCR_OEPOL             (0x00100000) -#define MCF_LCDC_LPCR_CLKPOL            (0x00200000) -#define MCF_LCDC_LPCR_LPPOL             (0x00400000) -#define MCF_LCDC_LPCR_FLM               (0x00800000) -#define MCF_LCDC_LPCR_PIXPOL            (0x01000000) -#define MCF_LCDC_LPCR_BPIX(x)           (((x)&0x00000007)<<25) -#define MCF_LCDC_LPCR_PBSIZ(x)          (((x)&0x00000003)<<28) -#define MCF_LCDC_LPCR_COLOR             (0x40000000) -#define MCF_LCDC_LPCR_TFT               (0x80000000) -#define MCF_LCDC_LPCR_MODE_MONOCGROME   (0x00000000) -#define MCF_LCDC_LPCR_MODE_CSTN         (0x40000000) -#define MCF_LCDC_LPCR_MODE_TFT          (0xC0000000) -#define MCF_LCDC_LPCR_PBSIZ_1           (0x00000000) -#define MCF_LCDC_LPCR_PBSIZ_2           (0x10000000) -#define MCF_LCDC_LPCR_PBSIZ_4           (0x20000000) -#define MCF_LCDC_LPCR_PBSIZ_8           (0x30000000) -#define MCF_LCDC_LPCR_BPIX_1bpp         (0x00000000) -#define MCF_LCDC_LPCR_BPIX_2bpp         (0x02000000) -#define MCF_LCDC_LPCR_BPIX_4bpp         (0x04000000) -#define MCF_LCDC_LPCR_BPIX_8bpp         (0x06000000) -#define MCF_LCDC_LPCR_BPIX_12bpp        (0x08000000) -#define MCF_LCDC_LPCR_BPIX_16bpp        (0x0A000000) -#define MCF_LCDC_LPCR_BPIX_18bpp        (0x0C000000) - -#define MCF_LCDC_LPCR_PANEL_TYPE(x)     (((x)&0x00000003)<<30)  - -/* Bit definitions and macros for MCF_LCDC_LHCR */ -#define MCF_LCDC_LHCR_H_WAIT_2(x)       (((x)&0x000000FF)<<0) -#define MCF_LCDC_LHCR_H_WAIT_1(x)       (((x)&0x000000FF)<<8) -#define MCF_LCDC_LHCR_H_WIDTH(x)        (((x)&0x0000003F)<<26) - -/* Bit definitions and macros for MCF_LCDC_LVCR */ -#define MCF_LCDC_LVCR_V_WAIT_2(x)       (((x)&0x000000FF)<<0) -#define MCF_LCDC_LVCR_V_WAIT_1(x)       (((x)&0x000000FF)<<8) -#define MCF_LCDC_LVCR_V_WIDTH(x)      (((x)&0x0000003F)<<26) - -/* Bit definitions and macros for MCF_LCDC_LPOR */ -#define MCF_LCDC_LPOR_POS(x)            (((x)&0x0000001F)<<0) - -/* Bit definitions and macros for MCF_LCDC_LPCCR */ -#define MCF_LCDC_LPCCR_PW(x)            (((x)&0x000000FF)<<0) -#define MCF_LCDC_LPCCR_CC_EN            (0x00000100) -#define MCF_LCDC_LPCCR_SCR(x)           (((x)&0x00000003)<<9) -#define MCF_LCDC_LPCCR_LDMSK            (0x00008000) -#define MCF_LCDC_LPCCR_CLS_HI_WIDTH(x)  (((x)&0x000001FF)<<16) -#define MCF_LCDC_LPCCR_SCR_LINEPULSE    (0x00000000) -#define MCF_LCDC_LPCCR_SCR_PIXELCLK     (0x00002000) -#define MCF_LCDC_LPCCR_SCR_LCDCLOCK     (0x00004000) - -/* Bit definitions and macros for MCF_LCDC_LDCR */ -#define MCF_LCDC_LDCR_TM(x)             (((x)&0x0000001F)<<0) -#define MCF_LCDC_LDCR_HM(x)             (((x)&0x0000001F)<<16) -#define MCF_LCDC_LDCR_BURST             (0x80000000) - -/* Bit definitions and macros for MCF_LCDC_LRMCR */ -#define MCF_LCDC_LRMCR_SEL_REF          (0x00000001) - -/* Bit definitions and macros for MCF_LCDC_LICR */ -#define MCF_LCDC_LICR_INTCON            (0x00000001) -#define MCF_LCDC_LICR_INTSYN            (0x00000004) -#define MCF_LCDC_LICR_GW_INT_CON        (0x00000010) - -/* Bit definitions and macros for MCF_LCDC_LIER */ -#define MCF_LCDC_LIER_BOF_EN            (0x00000001) -#define MCF_LCDC_LIER_EOF_EN            (0x00000002) -#define MCF_LCDC_LIER_ERR_RES_EN        (0x00000004) -#define MCF_LCDC_LIER_UDR_ERR_EN        (0x00000008) -#define MCF_LCDC_LIER_GW_BOF_EN         (0x00000010) -#define MCF_LCDC_LIER_GW_EOF_EN         (0x00000020) -#define MCF_LCDC_LIER_GW_ERR_RES_EN     (0x00000040) -#define MCF_LCDC_LIER_GW_UDR_ERR_EN     (0x00000080) - -/* Bit definitions and macros for MCF_LCDC_LISR */ -#define MCF_LCDC_LISR_BOF               (0x00000001) -#define MCF_LCDC_LISR_EOF               (0x00000002) -#define MCF_LCDC_LISR_ERR_RES           (0x00000004) -#define MCF_LCDC_LISR_UDR_ERR           (0x00000008) -#define MCF_LCDC_LISR_GW_BOF            (0x00000010) -#define MCF_LCDC_LISR_GW_EOF            (0x00000020) -#define MCF_LCDC_LISR_GW_ERR_RES        (0x00000040) -#define MCF_LCDC_LISR_GW_UDR_ERR        (0x00000080) - -/* Bit definitions and macros for MCF_LCDC_LGWSAR */ -#define MCF_LCDC_LGWSAR_GWSA(x)         (((x)&0x3FFFFFFF)<<2) - -/* Bit definitions and macros for MCF_LCDC_LGWSR */ -#define MCF_LCDC_LGWSR_GWH(x)           (((x)&0x000003FF)<<0) -#define MCF_LCDC_LGWSR_GWW(x)           (((x)&0x0000003F)<<20) - -/* Bit definitions and macros for MCF_LCDC_LGWVPWR */ -#define MCF_LCDC_LGWVPWR_GWVPW(x)       (((x)&0x000003FF)<<0) - -/* Bit definitions and macros for MCF_LCDC_LGWPOR */ -#define MCF_LCDC_LGWPOR_GWPO(x)         (((x)&0x0000001F)<<0) - -/* Bit definitions and macros for MCF_LCDC_LGWPR */ -#define MCF_LCDC_LGWPR_GWYP(x)          (((x)&0x000003FF)<<0) -#define MCF_LCDC_LGWPR_GWXP(x)          (((x)&0x000003FF)<<16) - -/* Bit definitions and macros for MCF_LCDC_LGWCR */ -#define MCF_LCDC_LGWCR_GWCKB(x)         (((x)&0x0000003F)<<0) -#define MCF_LCDC_LGWCR_GWCKG(x)         (((x)&0x0000003F)<<6) -#define MCF_LCDC_LGWCR_GWCKR(x)         (((x)&0x0000003F)<<12) -#define MCF_LCDC_LGWCR_GW_RVS           (0x00200000) -#define MCF_LCDC_LGWCR_GWE              (0x00400000) -#define MCF_LCDC_LGWCR_GWCKE            (0x00800000) -#define MCF_LCDC_LGWCR_GWAV(x)          (((x)&0x000000FF)<<24) - -/* Bit definitions and macros for MCF_LCDC_LGWDCR */ -#define MCF_LCDC_LGWDCR_GWTM(x)         (((x)&0x0000001F)<<0) -#define MCF_LCDC_LGWDCR_GWHM(x)         (((x)&0x0000001F)<<16) -#define MCF_LCDC_LGWDCR_GWBT            (0x80000000) - -/* Bit definitions and macros for MCF_LCDC_LSCR */ -#define MCF_LCDC_LSCR_PS_RISE_DELAY(x)    (((x)&0x0000003F)<<26) -#define MCF_LCDC_LSCR_CLS_RISE_DELAY(x)   (((x)&0x000000FF)<<16) -#define MCF_LCDC_LSCR_REV_TOGGLE_DELAY(x) (((x)&0x0000000F)<<8) -#define MCF_LCDC_LSCR_GRAY_2(x)  		  (((x)&0x0000000F)<<4) -#define MCF_LCDC_LSCR_GRAY_1(x)  		  (((x)&0x0000000F)<<0) - -/* Bit definitions and macros for MCF_LCDC_BPLUT_BASE */ -#define MCF_LCDC_BPLUT_BASE_BASE(x)     (((x)&0xFFFFFFFF)<<0) - -/* Bit definitions and macros for MCF_LCDC_GWLUT_BASE */ -#define MCF_LCDC_GWLUT_BASE_BASE(x)     (((x)&0xFFFFFFFF)<<0) - -/********************************************************************* - * - * Phase Locked Loop (PLL) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_PLL_PODR              MCF_REG08(0xFC0C0000) -#define MCF_PLL_PLLCR             MCF_REG08(0xFC0C0004) -#define MCF_PLL_PMDR              MCF_REG08(0xFC0C0008) -#define MCF_PLL_PFDR              MCF_REG08(0xFC0C000C) - -/* Bit definitions and macros for MCF_PLL_PODR */ -#define MCF_PLL_PODR_BUSDIV(x)    (((x)&0x0F)<<0) -#define MCF_PLL_PODR_CPUDIV(x)    (((x)&0x0F)<<4) - -/* Bit definitions and macros for MCF_PLL_PLLCR */ -#define MCF_PLL_PLLCR_DITHDEV(x)  (((x)&0x07)<<0) -#define MCF_PLL_PLLCR_DITHEN      (0x80) - -/* Bit definitions and macros for MCF_PLL_PMDR */ -#define MCF_PLL_PMDR_MODDIV(x)    (((x)&0xFF)<<0) - -/* Bit definitions and macros for MCF_PLL_PFDR */ -#define MCF_PLL_PFDR_MFD(x)       (((x)&0xFF)<<0) - -/********************************************************************* - * - * System Control Module Registers (SCM) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_SCM_MPR			MCF_REG32(0xFC000000) -#define MCF_SCM_PACRA			MCF_REG32(0xFC000020) -#define MCF_SCM_PACRB			MCF_REG32(0xFC000024) -#define MCF_SCM_PACRC			MCF_REG32(0xFC000028) -#define MCF_SCM_PACRD			MCF_REG32(0xFC00002C) -#define MCF_SCM_PACRE			MCF_REG32(0xFC000040) -#define MCF_SCM_PACRF			MCF_REG32(0xFC000044) - -#define MCF_SCM_BCR			MCF_REG32(0xFC040024) - -/********************************************************************* - * - * SDRAM Controller (SDRAMC) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCF_SDRAMC_SDMR			MCF_REG32(0xFC0B8000) -#define MCF_SDRAMC_SDCR			MCF_REG32(0xFC0B8004) -#define MCF_SDRAMC_SDCFG1		MCF_REG32(0xFC0B8008) -#define MCF_SDRAMC_SDCFG2		MCF_REG32(0xFC0B800C) -#define MCF_SDRAMC_LIMP_FIX		MCF_REG32(0xFC0B8080) -#define MCF_SDRAMC_SDDS			MCF_REG32(0xFC0B8100) -#define MCF_SDRAMC_SDCS0		MCF_REG32(0xFC0B8110) -#define MCF_SDRAMC_SDCS1		MCF_REG32(0xFC0B8114) -#define MCF_SDRAMC_SDCS2		MCF_REG32(0xFC0B8118) -#define MCF_SDRAMC_SDCS3		MCF_REG32(0xFC0B811C) -#define MCF_SDRAMC_SDCS(x)		MCF_REG32(0xFC0B8110+((x)*0x004)) - -/* Bit definitions and macros for MCF_SDRAMC_SDMR */ -#define MCF_SDRAMC_SDMR_CMD		(0x00010000) -#define MCF_SDRAMC_SDMR_AD(x)		(((x)&0x00000FFF)<<18) -#define MCF_SDRAMC_SDMR_BNKAD(x)	(((x)&0x00000003)<<30) -#define MCF_SDRAMC_SDMR_BNKAD_LMR	(0x00000000) -#define MCF_SDRAMC_SDMR_BNKAD_LEMR	(0x40000000) - -/* Bit definitions and macros for MCF_SDRAMC_SDCR */ -#define MCF_SDRAMC_SDCR_IPALL		(0x00000002) -#define MCF_SDRAMC_SDCR_IREF		(0x00000004) -#define MCF_SDRAMC_SDCR_DQS_OE(x)	(((x)&0x0000000F)<<8) -#define MCF_SDRAMC_SDCR_PS(x)		(((x)&0x00000003)<<12) -#define MCF_SDRAMC_SDCR_RCNT(x)		(((x)&0x0000003F)<<16) -#define MCF_SDRAMC_SDCR_OE_RULE		(0x00400000) -#define MCF_SDRAMC_SDCR_MUX(x)		(((x)&0x00000003)<<24) -#define MCF_SDRAMC_SDCR_REF		(0x10000000) -#define MCF_SDRAMC_SDCR_DDR		(0x20000000) -#define MCF_SDRAMC_SDCR_CKE		(0x40000000) -#define MCF_SDRAMC_SDCR_MODE_EN		(0x80000000) -#define MCF_SDRAMC_SDCR_PS_16		(0x00002000) -#define MCF_SDRAMC_SDCR_PS_32		(0x00000000) - -/* Bit definitions and macros for MCF_SDRAMC_SDCFG1 */ -#define MCF_SDRAMC_SDCFG1_WTLAT(x)	(((x)&0x00000007)<<4) -#define MCF_SDRAMC_SDCFG1_REF2ACT(x)	(((x)&0x0000000F)<<8) -#define MCF_SDRAMC_SDCFG1_PRE2ACT(x)	(((x)&0x00000007)<<12) -#define MCF_SDRAMC_SDCFG1_ACT2RW(x)	(((x)&0x00000007)<<16) -#define MCF_SDRAMC_SDCFG1_RDLAT(x)	(((x)&0x0000000F)<<20) -#define MCF_SDRAMC_SDCFG1_SWT2RD(x)	(((x)&0x00000007)<<24) -#define MCF_SDRAMC_SDCFG1_SRD2RW(x)	(((x)&0x0000000F)<<28) - -/* Bit definitions and macros for MCF_SDRAMC_SDCFG2 */ -#define MCF_SDRAMC_SDCFG2_BL(x)		(((x)&0x0000000F)<<16) -#define MCF_SDRAMC_SDCFG2_BRD2WT(x)	(((x)&0x0000000F)<<20) -#define MCF_SDRAMC_SDCFG2_BWT2RW(x)	(((x)&0x0000000F)<<24) -#define MCF_SDRAMC_SDCFG2_BRD2PRE(x)	(((x)&0x0000000F)<<28) - -/* Device Errata - LIMP mode work around */ -#define MCF_SDRAMC_REFRESH		(0x40000000) - -/* Bit definitions and macros for MCF_SDRAMC_SDDS */ -#define MCF_SDRAMC_SDDS_SB_D(x)		(((x)&0x00000003)<<0) -#define MCF_SDRAMC_SDDS_SB_S(x)		(((x)&0x00000003)<<2) -#define MCF_SDRAMC_SDDS_SB_A(x)		(((x)&0x00000003)<<4) -#define MCF_SDRAMC_SDDS_SB_C(x)		(((x)&0x00000003)<<6) -#define MCF_SDRAMC_SDDS_SB_E(x)		(((x)&0x00000003)<<8) - -/* Bit definitions and macros for MCF_SDRAMC_SDCS */ -#define MCF_SDRAMC_SDCS_CSSZ(x)		(((x)&0x0000001F)<<0) -#define MCF_SDRAMC_SDCS_BASE(x)		(((x)&0x00000FFF)<<20) -#define MCF_SDRAMC_SDCS_BA(x)		((x)&0xFFF00000) -#define MCF_SDRAMC_SDCS_CSSZ_DIABLE	(0x00000000) -#define MCF_SDRAMC_SDCS_CSSZ_1MBYTE	(0x00000013) -#define MCF_SDRAMC_SDCS_CSSZ_2MBYTE	(0x00000014) -#define MCF_SDRAMC_SDCS_CSSZ_4MBYTE	(0x00000015) -#define MCF_SDRAMC_SDCS_CSSZ_8MBYTE	(0x00000016) -#define MCF_SDRAMC_SDCS_CSSZ_16MBYTE	(0x00000017) -#define MCF_SDRAMC_SDCS_CSSZ_32MBYTE	(0x00000018) -#define MCF_SDRAMC_SDCS_CSSZ_64MBYTE	(0x00000019) -#define MCF_SDRAMC_SDCS_CSSZ_128MBYTE	(0x0000001A) -#define MCF_SDRAMC_SDCS_CSSZ_256MBYTE	(0x0000001B) -#define MCF_SDRAMC_SDCS_CSSZ_512MBYTE	(0x0000001C) -#define MCF_SDRAMC_SDCS_CSSZ_1GBYTE	(0x0000001D) -#define MCF_SDRAMC_SDCS_CSSZ_2GBYTE	(0x0000001E) -#define MCF_SDRAMC_SDCS_CSSZ_4GBYTE	(0x0000001F) - -/********************************************************************* - * - *      FlexCAN module registers - * - *********************************************************************/ -#define MCF_FLEXCAN_BASEADDR(x)		(0xFC020000+(x)*0x0800) -#define MCF_FLEXCAN_CANMCR(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x00) -#define MCF_FLEXCAN_CANCTRL(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x04) -#define MCF_FLEXCAN_TIMER(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x08) -#define MCF_FLEXCAN_RXGMASK(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x10) -#define MCF_FLEXCAN_RX14MASK(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x14) -#define MCF_FLEXCAN_RX15MASK(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x18) -#define MCF_FLEXCAN_ERRCNT(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x1C) -#define MCF_FLEXCAN_ERRSTAT(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x20) -#define MCF_FLEXCAN_IMASK(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x28) -#define MCF_FLEXCAN_IFLAG(x)		MCF_REG32(0xFC020000+(x)*0x0800+0x30) - -#define MCF_FLEXCAN_MB_CNT(x,y)		MCF_REG32(0xFC020080+(x)*0x0800+(y)*0x10+0x0) -#define MCF_FLEXCAN_MB_ID(x,y)		MCF_REG32(0xFC020080+(x)*0x0800+(y)*0x10+0x4) -#define MCF_FLEXCAN_MB_DB(x,y,z)	MCF_REG08(0xFC020080+(x)*0x0800+(y)*0x10+0x8+(z)*0x1) - -/* - *      FlexCAN Module Configuration Register - */ -#define CANMCR_MDIS		(0x80000000) -#define CANMCR_FRZ		(0x40000000) -#define CANMCR_HALT		(0x10000000) -#define CANMCR_SOFTRST		(0x02000000) -#define CANMCR_FRZACK		(0x01000000) -#define CANMCR_SUPV		(0x00800000) -#define CANMCR_MAXMB(x)         ((x)&0x0F) - -/* - *      FlexCAN Control Register - */ -#define CANCTRL_PRESDIV(x)      (((x)&0xFF)<<24) -#define CANCTRL_RJW(x)          (((x)&0x03)<<22) -#define CANCTRL_PSEG1(x)        (((x)&0x07)<<19) -#define CANCTRL_PSEG2(x)        (((x)&0x07)<<16) -#define CANCTRL_BOFFMSK         (0x00008000) -#define CANCTRL_ERRMSK	        (0x00004000) -#define CANCTRL_CLKSRC		(0x00002000) -#define CANCTRL_LPB	        (0x00001000) -#define CANCTRL_SAMP	        (0x00000080) -#define CANCTRL_BOFFREC         (0x00000040) -#define CANCTRL_TSYNC           (0x00000020) -#define CANCTRL_LBUF            (0x00000010) -#define CANCTRL_LOM             (0x00000008) -#define CANCTRL_PROPSEG(x)      ((x)&0x07) - -/* - *      FlexCAN Error Counter Register - */ -#define ERRCNT_RXECTR(x)        (((x)&0xFF)<<8) -#define ERRCNT_TXECTR(x)        ((x)&0xFF) - -/* - *      FlexCAN Error and Status Register - */ -#define ERRSTAT_BITERR(x)       (((x)&0x03)<<14) -#define ERRSTAT_ACKERR           (0x00002000) -#define ERRSTAT_CRCERR           (0x00001000) -#define ERRSTAT_FRMERR           (0x00000800) -#define ERRSTAT_STFERR           (0x00000400) -#define ERRSTAT_TXWRN            (0x00000200) -#define ERRSTAT_RXWRN            (0x00000100) -#define ERRSTAT_IDLE             (0x00000080) -#define ERRSTAT_TXRX             (0x00000040) -#define ERRSTAT_FLTCONF(x)       (((x)&0x03)<<4) -#define ERRSTAT_BOFFINT          (0x00000004) -#define ERRSTAT_ERRINT           (0x00000002) - -/* - *      Interrupt Mask Register - */ -#define IMASK_BUF15M		(0x8000) -#define IMASK_BUF14M		(0x4000) -#define IMASK_BUF13M		(0x2000) -#define IMASK_BUF12M		(0x1000) -#define IMASK_BUF11M		(0x0800) -#define IMASK_BUF10M		(0x0400) -#define IMASK_BUF9M		(0x0200) -#define IMASK_BUF8M		(0x0100) -#define IMASK_BUF7M		(0x0080) -#define IMASK_BUF6M		(0x0040) -#define IMASK_BUF5M		(0x0020) -#define IMASK_BUF4M		(0x0010) -#define IMASK_BUF3M		(0x0008) -#define IMASK_BUF2M		(0x0004) -#define IMASK_BUF1M		(0x0002) -#define IMASK_BUF0M		(0x0001) -#define IMASK_BUFnM(x)		(0x1<<(x)) -#define IMASK_BUFF_ENABLE_ALL	(0x1111) -#define IMASK_BUFF_DISABLE_ALL	(0x0000) - -/* - *      Interrupt Flag Register - */ -#define IFLAG_BUF15M		(0x8000) -#define IFLAG_BUF14M		(0x4000) -#define IFLAG_BUF13M		(0x2000) -#define IFLAG_BUF12M		(0x1000) -#define IFLAG_BUF11M		(0x0800) -#define IFLAG_BUF10M		(0x0400) -#define IFLAG_BUF9M		(0x0200) -#define IFLAG_BUF8M		(0x0100) -#define IFLAG_BUF7M		(0x0080) -#define IFLAG_BUF6M		(0x0040) -#define IFLAG_BUF5M		(0x0020) -#define IFLAG_BUF4M		(0x0010) -#define IFLAG_BUF3M		(0x0008) -#define IFLAG_BUF2M		(0x0004) -#define IFLAG_BUF1M		(0x0002) -#define IFLAG_BUF0M		(0x0001) -#define IFLAG_BUFF_SET_ALL	(0xFFFF) -#define IFLAG_BUFF_CLEAR_ALL	(0x0000) -#define IFLAG_BUFnM(x)		(0x1<<(x)) - -/* - *      Message Buffers - */ -#define MB_CNT_CODE(x)		(((x)&0x0F)<<24) -#define MB_CNT_SRR		(0x00400000) -#define MB_CNT_IDE		(0x00200000) -#define MB_CNT_RTR		(0x00100000) -#define MB_CNT_LENGTH(x)	(((x)&0x0F)<<16) -#define MB_CNT_TIMESTAMP(x)	((x)&0xFFFF) -#define MB_ID_STD(x)		(((x)&0x07FF)<<18) -#define MB_ID_EXT(x)		((x)&0x3FFFF) - -/********************************************************************* - * - * Edge Port Module (EPORT) - * - *********************************************************************/ - -/* Register read/write macros */ -#define MCFEPORT_EPPAR                (0xFC094000) -#define MCFEPORT_EPDDR                (0xFC094002) -#define MCFEPORT_EPIER                (0xFC094003) -#define MCFEPORT_EPDR                 (0xFC094004) -#define MCFEPORT_EPPDR                (0xFC094005) -#define MCFEPORT_EPFR                 (0xFC094006) - -/* Bit definitions and macros for MCF_EPORT_EPPAR */ -#define MCF_EPORT_EPPAR_EPPA1(x)       (((x)&0x0003)<<2) -#define MCF_EPORT_EPPAR_EPPA2(x)       (((x)&0x0003)<<4) -#define MCF_EPORT_EPPAR_EPPA3(x)       (((x)&0x0003)<<6) -#define MCF_EPORT_EPPAR_EPPA4(x)       (((x)&0x0003)<<8) -#define MCF_EPORT_EPPAR_EPPA5(x)       (((x)&0x0003)<<10) -#define MCF_EPORT_EPPAR_EPPA6(x)       (((x)&0x0003)<<12) -#define MCF_EPORT_EPPAR_EPPA7(x)       (((x)&0x0003)<<14) -#define MCF_EPORT_EPPAR_LEVEL          (0) -#define MCF_EPORT_EPPAR_RISING         (1) -#define MCF_EPORT_EPPAR_FALLING        (2) -#define MCF_EPORT_EPPAR_BOTH           (3) -#define MCF_EPORT_EPPAR_EPPA7_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA7_RISING   (0x4000) -#define MCF_EPORT_EPPAR_EPPA7_FALLING  (0x8000) -#define MCF_EPORT_EPPAR_EPPA7_BOTH     (0xC000) -#define MCF_EPORT_EPPAR_EPPA6_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA6_RISING   (0x1000) -#define MCF_EPORT_EPPAR_EPPA6_FALLING  (0x2000) -#define MCF_EPORT_EPPAR_EPPA6_BOTH     (0x3000) -#define MCF_EPORT_EPPAR_EPPA5_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA5_RISING   (0x0400) -#define MCF_EPORT_EPPAR_EPPA5_FALLING  (0x0800) -#define MCF_EPORT_EPPAR_EPPA5_BOTH     (0x0C00) -#define MCF_EPORT_EPPAR_EPPA4_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA4_RISING   (0x0100) -#define MCF_EPORT_EPPAR_EPPA4_FALLING  (0x0200) -#define MCF_EPORT_EPPAR_EPPA4_BOTH     (0x0300) -#define MCF_EPORT_EPPAR_EPPA3_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA3_RISING   (0x0040) -#define MCF_EPORT_EPPAR_EPPA3_FALLING  (0x0080) -#define MCF_EPORT_EPPAR_EPPA3_BOTH     (0x00C0) -#define MCF_EPORT_EPPAR_EPPA2_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA2_RISING   (0x0010) -#define MCF_EPORT_EPPAR_EPPA2_FALLING  (0x0020) -#define MCF_EPORT_EPPAR_EPPA2_BOTH     (0x0030) -#define MCF_EPORT_EPPAR_EPPA1_LEVEL    (0x0000) -#define MCF_EPORT_EPPAR_EPPA1_RISING   (0x0004) -#define MCF_EPORT_EPPAR_EPPA1_FALLING  (0x0008) -#define MCF_EPORT_EPPAR_EPPA1_BOTH     (0x000C) - -/* Bit definitions and macros for MCF_EPORT_EPDDR */ -#define MCF_EPORT_EPDDR_EPDD1          (0x02) -#define MCF_EPORT_EPDDR_EPDD2          (0x04) -#define MCF_EPORT_EPDDR_EPDD3          (0x08) -#define MCF_EPORT_EPDDR_EPDD4          (0x10) -#define MCF_EPORT_EPDDR_EPDD5          (0x20) -#define MCF_EPORT_EPDDR_EPDD6          (0x40) -#define MCF_EPORT_EPDDR_EPDD7          (0x80) - -/* Bit definitions and macros for MCF_EPORT_EPIER */ -#define MCF_EPORT_EPIER_EPIE1          (0x02) -#define MCF_EPORT_EPIER_EPIE2          (0x04) -#define MCF_EPORT_EPIER_EPIE3          (0x08) -#define MCF_EPORT_EPIER_EPIE4          (0x10) -#define MCF_EPORT_EPIER_EPIE5          (0x20) -#define MCF_EPORT_EPIER_EPIE6          (0x40) -#define MCF_EPORT_EPIER_EPIE7          (0x80) - -/* Bit definitions and macros for MCF_EPORT_EPDR */ -#define MCF_EPORT_EPDR_EPD1            (0x02) -#define MCF_EPORT_EPDR_EPD2            (0x04) -#define MCF_EPORT_EPDR_EPD3            (0x08) -#define MCF_EPORT_EPDR_EPD4            (0x10) -#define MCF_EPORT_EPDR_EPD5            (0x20) -#define MCF_EPORT_EPDR_EPD6            (0x40) -#define MCF_EPORT_EPDR_EPD7            (0x80) - -/* Bit definitions and macros for MCF_EPORT_EPPDR */ -#define MCF_EPORT_EPPDR_EPPD1          (0x02) -#define MCF_EPORT_EPPDR_EPPD2          (0x04) -#define MCF_EPORT_EPPDR_EPPD3          (0x08) -#define MCF_EPORT_EPPDR_EPPD4          (0x10) -#define MCF_EPORT_EPPDR_EPPD5          (0x20) -#define MCF_EPORT_EPPDR_EPPD6          (0x40) -#define MCF_EPORT_EPPDR_EPPD7          (0x80) - -/* Bit definitions and macros for MCF_EPORT_EPFR */ -#define MCF_EPORT_EPFR_EPF1            (0x02) -#define MCF_EPORT_EPFR_EPF2            (0x04) -#define MCF_EPORT_EPFR_EPF3            (0x08) -#define MCF_EPORT_EPFR_EPF4            (0x10) -#define MCF_EPORT_EPFR_EPF5            (0x20) -#define MCF_EPORT_EPFR_EPF6            (0x40) -#define MCF_EPORT_EPFR_EPF7            (0x80) - -/********************************************************************/ -#endif	/* m532xsim_h */ diff --git a/arch/m68k/include/asm/m53xxacr.h b/arch/m68k/include/asm/m53xxacr.h new file mode 100644 index 00000000000..3177ce8331d --- /dev/null +++ b/arch/m68k/include/asm/m53xxacr.h @@ -0,0 +1,101 @@ +/****************************************************************************/ + +/* + * m53xxacr.h -- ColdFire version 3 core cache support + * + * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com> + */ + +/****************************************************************************/ +#ifndef m53xxacr_h +#define m53xxacr_h +/****************************************************************************/ + +/* + * All varients of the ColdFire using version 3 cores have a similar + * cache setup. They have a unified instruction and data cache, with + * configurable write-through or copy-back operation. + */ + +/* + * Define the Cache Control register flags. + */ +#define CACR_EC		0x80000000	/* Enable cache */ +#define CACR_ESB	0x20000000	/* Enable store buffer */ +#define CACR_DPI	0x10000000	/* Disable invalidation by CPUSHL */ +#define CACR_HLCK	0x08000000	/* Half cache lock mode */ +#define CACR_CINVA	0x01000000	/* Invalidate cache */ +#define CACR_DNFB	0x00000400	/* Inhibited fill buffer */ +#define CACR_DCM_WT	0x00000000	/* Cacheable write-through */ +#define CACR_DCM_CB	0x00000100	/* Cacheable copy-back */ +#define CACR_DCM_PRE	0x00000200	/* Cache inhibited, precise */ +#define CACR_DCM_IMPRE	0x00000300	/* Cache inhibited, imprecise */ +#define CACR_WPROTECT	0x00000020	/* Write protect*/ +#define CACR_EUSP	0x00000010	/* Eanble separate user a7 */ + +/* + * Define the Access Control register flags. + */ +#define ACR_BASE_POS	24		/* Address Base (upper 8 bits) */ +#define ACR_MASK_POS	16		/* Address Mask (next 8 bits) */ +#define ACR_ENABLE	0x00008000	/* Enable this ACR */ +#define ACR_USER	0x00000000	/* Allow only user accesses */ +#define ACR_SUPER	0x00002000	/* Allow supervisor access only */ +#define ACR_ANY		0x00004000	/* Allow any access type */ +#define ACR_CM_WT	0x00000000	/* Cacheable, write-through */ +#define ACR_CM_CB	0x00000020	/* Cacheable, copy-back */ +#define ACR_CM_PRE	0x00000040	/* Cache inhibited, precise */ +#define ACR_CM_IMPRE	0x00000060	/* Cache inhibited, imprecise */ +#define ACR_WPROTECT	0x00000004	/* Write protect region */ + +/* + * Define the cache type and arrangement (needed for pushes). + */ +#if defined(CONFIG_M5307) +#define	CACHE_SIZE	0x2000		/* 8k of unified cache */ +#define	ICACHE_SIZE	CACHE_SIZE +#define	DCACHE_SIZE	CACHE_SIZE +#elif defined(CONFIG_M53xx) +#define	CACHE_SIZE	0x4000		/* 16k of unified cache */ +#define	ICACHE_SIZE	CACHE_SIZE +#define	DCACHE_SIZE	CACHE_SIZE +#endif + +#define	CACHE_LINE_SIZE	16		/* 16 byte line size */ +#define	CACHE_WAYS	4		/* 4 ways - set associative */ + +/* + * Set the cache controller settings we will use. This default in the + * CACR is cache inhibited, we use the ACR register to set cacheing + * enabled on the regions we want (eg RAM). + */ +#if defined(CONFIG_CACHE_COPYBACK) +#define CACHE_TYPE	ACR_CM_CB +#define CACHE_PUSH +#else +#define CACHE_TYPE	ACR_CM_WT +#endif + +#ifdef CONFIG_COLDFIRE_SW_A7 +#define CACHE_MODE	(CACR_EC + CACR_ESB + CACR_DCM_PRE) +#else +#define CACHE_MODE	(CACR_EC + CACR_ESB + CACR_DCM_PRE + CACR_EUSP) +#endif + +/* + * Unified cache means we will never need to flush for coherency of + * instruction fetch. We will need to flush to maintain memory/DMA + * coherency though in all cases. And for copyback caches we will need + * to push cached data as well. + */ +#define CACHE_INIT	  CACR_CINVA +#define CACHE_INVALIDATE  CACR_CINVA +#define CACHE_INVALIDATED CACR_CINVA + +#define ACR0_MODE	((CONFIG_RAMBASE & 0xff000000) + \ +			 (0x000f0000) + \ +			 (ACR_ENABLE + ACR_ANY + CACHE_TYPE)) +#define ACR1_MODE	0 + +/****************************************************************************/ +#endif  /* m53xxsim_h */ diff --git a/arch/m68k/include/asm/m53xxsim.h b/arch/m68k/include/asm/m53xxsim.h new file mode 100644 index 00000000000..faa1a2133bf --- /dev/null +++ b/arch/m68k/include/asm/m53xxsim.h @@ -0,0 +1,1241 @@ +/****************************************************************************/ + +/* + *	m53xxsim.h -- ColdFire 5329 registers + */ + +/****************************************************************************/ +#ifndef	m53xxsim_h +#define	m53xxsim_h +/****************************************************************************/ + +#define	CPU_NAME		"COLDFIRE(m53xx)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		(MCF_CLK / 3) + +#include <asm/m53xxacr.h> + +#define MCFINT_VECBASE      64 +#define MCFINT_UART0        26          /* Interrupt number for UART0 */ +#define MCFINT_UART1        27          /* Interrupt number for UART1 */ +#define MCFINT_UART2        28          /* Interrupt number for UART2 */ +#define MCFINT_QSPI         31          /* Interrupt number for QSPI */ +#define MCFINT_FECRX0	    36		/* Interrupt number for FEC */ +#define MCFINT_FECTX0	    40		/* Interrupt number for FEC */ +#define MCFINT_FECENTC0	    42		/* Interrupt number for FEC */ + +#define MCF_IRQ_UART0       (MCFINT_VECBASE + MCFINT_UART0) +#define MCF_IRQ_UART1       (MCFINT_VECBASE + MCFINT_UART1) +#define MCF_IRQ_UART2       (MCFINT_VECBASE + MCFINT_UART2) + +#define MCF_IRQ_FECRX0	    (MCFINT_VECBASE + MCFINT_FECRX0) +#define MCF_IRQ_FECTX0	    (MCFINT_VECBASE + MCFINT_FECTX0) +#define MCF_IRQ_FECENTC0    (MCFINT_VECBASE + MCFINT_FECENTC0) + +#define	MCF_IRQ_QSPI	    (MCFINT_VECBASE + MCFINT_QSPI) + +#define MCF_WTM_WCR		0xFC098000 + +/* + *	Define the 532x SIM register set addresses. + */ +#define	MCFSIM_IPRL		0xFC048004 +#define	MCFSIM_IPRH		0xFC048000 +#define	MCFSIM_IPR		MCFSIM_IPRL +#define	MCFSIM_IMRL		0xFC04800C +#define	MCFSIM_IMRH		0xFC048008 +#define	MCFSIM_IMR		MCFSIM_IMRL +#define	MCFSIM_ICR0		0xFC048040	 +#define	MCFSIM_ICR1		0xFC048041	 +#define	MCFSIM_ICR2		0xFC048042	 +#define	MCFSIM_ICR3		0xFC048043	 +#define	MCFSIM_ICR4		0xFC048044	 +#define	MCFSIM_ICR5		0xFC048045	 +#define	MCFSIM_ICR6		0xFC048046	 +#define	MCFSIM_ICR7		0xFC048047	 +#define	MCFSIM_ICR8		0xFC048048	 +#define	MCFSIM_ICR9		0xFC048049	 +#define	MCFSIM_ICR10		0xFC04804A +#define	MCFSIM_ICR11		0xFC04804B + +/* + *	Some symbol defines for the above... + */ +#define	MCFSIM_SWDICR		MCFSIM_ICR0	/* Watchdog timer ICR */ +#define	MCFSIM_TIMER1ICR	MCFSIM_ICR1	/* Timer 1 ICR */ +#define	MCFSIM_TIMER2ICR	MCFSIM_ICR2	/* Timer 2 ICR */ +#define	MCFSIM_UART1ICR		MCFSIM_ICR4	/* UART 1 ICR */ +#define	MCFSIM_UART2ICR		MCFSIM_ICR5	/* UART 2 ICR */ +#define	MCFSIM_DMA0ICR		MCFSIM_ICR6	/* DMA 0 ICR */ +#define	MCFSIM_DMA1ICR		MCFSIM_ICR7	/* DMA 1 ICR */ +#define	MCFSIM_DMA2ICR		MCFSIM_ICR8	/* DMA 2 ICR */ +#define	MCFSIM_DMA3ICR		MCFSIM_ICR9	/* DMA 3 ICR */ + + +#define	MCFINTC0_SIMR		0xFC04801C +#define	MCFINTC0_CIMR		0xFC04801D +#define	MCFINTC0_ICR0		0xFC048040 +#define	MCFINTC1_SIMR		0xFC04C01C +#define	MCFINTC1_CIMR		0xFC04C01D +#define	MCFINTC1_ICR0		0xFC04C040 +#define MCFINTC2_SIMR		(0) +#define MCFINTC2_CIMR		(0) +#define MCFINTC2_ICR0		(0) + +#define MCFSIM_ICR_TIMER1	(0xFC048040+32) +#define MCFSIM_ICR_TIMER2	(0xFC048040+33) + +/* + *	Define system peripheral IRQ usage. + */ +#define	MCF_IRQ_TIMER		(64 + 32)	/* Timer0 */ +#define	MCF_IRQ_PROFILER	(64 + 33)	/* Timer1 */ + +/* + *  UART module. + */ +#define MCFUART_BASE0		0xFC060000	/* Base address of UART1 */ +#define MCFUART_BASE1		0xFC064000	/* Base address of UART2 */ +#define MCFUART_BASE2		0xFC068000	/* Base address of UART3 */ + +/* + *  FEC module. + */ +#define	MCFFEC_BASE0		0xFC030000	/* Base address of FEC0 */ +#define	MCFFEC_SIZE0		0x800		/* Size of FEC0 region */ + +/* + *  QSPI module. + */ +#define	MCFQSPI_BASE		0xFC05C000	/* Base address of QSPI */ +#define	MCFQSPI_SIZE		0x40		/* Size of QSPI region */ + +#define	MCFQSPI_CS0		84 +#define	MCFQSPI_CS1		85 +#define	MCFQSPI_CS2		86 + +/* + *  Timer module. + */ +#define MCFTIMER_BASE1		0xFC070000	/* Base address of TIMER1 */ +#define MCFTIMER_BASE2		0xFC074000	/* Base address of TIMER2 */ +#define MCFTIMER_BASE3		0xFC078000	/* Base address of TIMER3 */ +#define MCFTIMER_BASE4		0xFC07C000	/* Base address of TIMER4 */ + +/********************************************************************* + * + * Reset Controller Module + * + *********************************************************************/ + +#define	MCF_RCR			0xFC0A0000 +#define	MCF_RSR			0xFC0A0001 + +#define	MCF_RCR_SWRESET		0x80		/* Software reset bit */ +#define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ + + +/* + * Power Management + */ +#define MCFPM_WCR		0xfc040013 +#define MCFPM_PPMSR0		0xfc04002c +#define MCFPM_PPMCR0		0xfc04002d +#define MCFPM_PPMSR1		0xfc04002e +#define MCFPM_PPMCR1		0xfc04002f +#define MCFPM_PPMHR0		0xfc040030 +#define MCFPM_PPMLR0		0xfc040034 +#define MCFPM_PPMHR1		0xfc040038 +#define MCFPM_LPCR		0xec090007 + +/* + *	The M5329EVB board needs a help getting its devices initialized  + *	at kernel start time if dBUG doesn't set it up (for example  + *	it is not used), so we need to do it manually. + */ +#ifdef __ASSEMBLER__ +.macro m5329EVB_setup +	movel	#0xFC098000, %a7 +	movel	#0x0, (%a7) +#define CORE_SRAM	0x80000000	 +#define CORE_SRAM_SIZE	0x8000 +	movel	#CORE_SRAM, %d0 +	addl	#0x221, %d0 +	movec	%d0,%RAMBAR1 +	movel	#CORE_SRAM, %sp +	addl	#CORE_SRAM_SIZE, %sp +	jsr	sysinit +.endm +#define	PLATFORM_SETUP	m5329EVB_setup + +#endif /* __ASSEMBLER__ */ + +/********************************************************************* + * + * Chip Configuration Module (CCM) + * + *********************************************************************/ + +/* Register read/write macros */ +#define MCF_CCM_CCR               0xFC0A0004 +#define MCF_CCM_RCON              0xFC0A0008 +#define MCF_CCM_CIR               0xFC0A000A +#define MCF_CCM_MISCCR            0xFC0A0010 +#define MCF_CCM_CDR               0xFC0A0012 +#define MCF_CCM_UHCSR             0xFC0A0014 +#define MCF_CCM_UOCSR             0xFC0A0016 + +/* Bit definitions and macros for MCF_CCM_CCR */ +#define MCF_CCM_CCR_RESERVED      (0x0001) +#define MCF_CCM_CCR_PLL_MODE      (0x0003) +#define MCF_CCM_CCR_OSC_MODE      (0x0005) +#define MCF_CCM_CCR_BOOTPS(x)     (((x)&0x0003)<<3|0x0001) +#define MCF_CCM_CCR_LOAD          (0x0021) +#define MCF_CCM_CCR_LIMP          (0x0041) +#define MCF_CCM_CCR_CSC(x)        (((x)&0x0003)<<8|0x0001) + +/* Bit definitions and macros for MCF_CCM_RCON */ +#define MCF_CCM_RCON_RESERVED     (0x0001) +#define MCF_CCM_RCON_PLL_MODE     (0x0003) +#define MCF_CCM_RCON_OSC_MODE     (0x0005) +#define MCF_CCM_RCON_BOOTPS(x)    (((x)&0x0003)<<3|0x0001) +#define MCF_CCM_RCON_LOAD         (0x0021) +#define MCF_CCM_RCON_LIMP         (0x0041) +#define MCF_CCM_RCON_CSC(x)       (((x)&0x0003)<<8|0x0001) + +/* Bit definitions and macros for MCF_CCM_CIR */ +#define MCF_CCM_CIR_PRN(x)        (((x)&0x003F)<<0) +#define MCF_CCM_CIR_PIN(x)        (((x)&0x03FF)<<6) + +/* Bit definitions and macros for MCF_CCM_MISCCR */ +#define MCF_CCM_MISCCR_USBSRC     (0x0001) +#define MCF_CCM_MISCCR_USBDIV     (0x0002) +#define MCF_CCM_MISCCR_SSI_SRC    (0x0010) +#define MCF_CCM_MISCCR_TIM_DMA   (0x0020) +#define MCF_CCM_MISCCR_SSI_PUS    (0x0040) +#define MCF_CCM_MISCCR_SSI_PUE    (0x0080) +#define MCF_CCM_MISCCR_LCD_CHEN   (0x0100) +#define MCF_CCM_MISCCR_LIMP       (0x1000) +#define MCF_CCM_MISCCR_PLL_LOCK   (0x2000) + +/* Bit definitions and macros for MCF_CCM_CDR */ +#define MCF_CCM_CDR_SSIDIV(x)     (((x)&0x000F)<<0) +#define MCF_CCM_CDR_LPDIV(x)      (((x)&0x000F)<<8) + +/* Bit definitions and macros for MCF_CCM_UHCSR */ +#define MCF_CCM_UHCSR_XPDE        (0x0001) +#define MCF_CCM_UHCSR_UHMIE       (0x0002) +#define MCF_CCM_UHCSR_WKUP        (0x0004) +#define MCF_CCM_UHCSR_PORTIND(x)  (((x)&0x0003)<<14) + +/* Bit definitions and macros for MCF_CCM_UOCSR */ +#define MCF_CCM_UOCSR_XPDE        (0x0001) +#define MCF_CCM_UOCSR_UOMIE       (0x0002) +#define MCF_CCM_UOCSR_WKUP        (0x0004) +#define MCF_CCM_UOCSR_PWRFLT      (0x0008) +#define MCF_CCM_UOCSR_SEND        (0x0010) +#define MCF_CCM_UOCSR_VVLD        (0x0020) +#define MCF_CCM_UOCSR_BVLD        (0x0040) +#define MCF_CCM_UOCSR_AVLD        (0x0080) +#define MCF_CCM_UOCSR_DPPU        (0x0100) +#define MCF_CCM_UOCSR_DCR_VBUS    (0x0200) +#define MCF_CCM_UOCSR_CRG_VBUS    (0x0400) +#define MCF_CCM_UOCSR_DRV_VBUS    (0x0800) +#define MCF_CCM_UOCSR_DMPD        (0x1000) +#define MCF_CCM_UOCSR_DPPD        (0x2000) +#define MCF_CCM_UOCSR_PORTIND(x)  (((x)&0x0003)<<14) + +/********************************************************************* + * + * FlexBus Chip Selects (FBCS) + * + *********************************************************************/ + +/* Register read/write macros */ +#define MCF_FBCS0_CSAR		0xFC008000 +#define MCF_FBCS0_CSMR		0xFC008004 +#define MCF_FBCS0_CSCR		0xFC008008 +#define MCF_FBCS1_CSAR		0xFC00800C +#define MCF_FBCS1_CSMR		0xFC008010 +#define MCF_FBCS1_CSCR		0xFC008014 +#define MCF_FBCS2_CSAR		0xFC008018 +#define MCF_FBCS2_CSMR		0xFC00801C +#define MCF_FBCS2_CSCR		0xFC008020 +#define MCF_FBCS3_CSAR		0xFC008024 +#define MCF_FBCS3_CSMR		0xFC008028 +#define MCF_FBCS3_CSCR		0xFC00802C +#define MCF_FBCS4_CSAR		0xFC008030 +#define MCF_FBCS4_CSMR		0xFC008034 +#define MCF_FBCS4_CSCR		0xFC008038 +#define MCF_FBCS5_CSAR		0xFC00803C +#define MCF_FBCS5_CSMR		0xFC008040 +#define MCF_FBCS5_CSCR		0xFC008044 + +/* Bit definitions and macros for MCF_FBCS_CSAR */ +#define MCF_FBCS_CSAR_BA(x)	((x)&0xFFFF0000) + +/* Bit definitions and macros for MCF_FBCS_CSMR */ +#define MCF_FBCS_CSMR_V		(0x00000001) +#define MCF_FBCS_CSMR_WP	(0x00000100) +#define MCF_FBCS_CSMR_BAM(x)	(((x)&0x0000FFFF)<<16) +#define MCF_FBCS_CSMR_BAM_4G	(0xFFFF0000) +#define MCF_FBCS_CSMR_BAM_2G	(0x7FFF0000) +#define MCF_FBCS_CSMR_BAM_1G	(0x3FFF0000) +#define MCF_FBCS_CSMR_BAM_1024M	(0x3FFF0000) +#define MCF_FBCS_CSMR_BAM_512M	(0x1FFF0000) +#define MCF_FBCS_CSMR_BAM_256M	(0x0FFF0000) +#define MCF_FBCS_CSMR_BAM_128M	(0x07FF0000) +#define MCF_FBCS_CSMR_BAM_64M	(0x03FF0000) +#define MCF_FBCS_CSMR_BAM_32M	(0x01FF0000) +#define MCF_FBCS_CSMR_BAM_16M	(0x00FF0000) +#define MCF_FBCS_CSMR_BAM_8M	(0x007F0000) +#define MCF_FBCS_CSMR_BAM_4M	(0x003F0000) +#define MCF_FBCS_CSMR_BAM_2M	(0x001F0000) +#define MCF_FBCS_CSMR_BAM_1M	(0x000F0000) +#define MCF_FBCS_CSMR_BAM_1024K	(0x000F0000) +#define MCF_FBCS_CSMR_BAM_512K	(0x00070000) +#define MCF_FBCS_CSMR_BAM_256K	(0x00030000) +#define MCF_FBCS_CSMR_BAM_128K	(0x00010000) +#define MCF_FBCS_CSMR_BAM_64K	(0x00000000) + +/* Bit definitions and macros for MCF_FBCS_CSCR */ +#define MCF_FBCS_CSCR_BSTW	(0x00000008) +#define MCF_FBCS_CSCR_BSTR	(0x00000010) +#define MCF_FBCS_CSCR_BEM	(0x00000020) +#define MCF_FBCS_CSCR_PS(x)	(((x)&0x00000003)<<6) +#define MCF_FBCS_CSCR_AA	(0x00000100) +#define MCF_FBCS_CSCR_SBM	(0x00000200) +#define MCF_FBCS_CSCR_WS(x)	(((x)&0x0000003F)<<10) +#define MCF_FBCS_CSCR_WRAH(x)	(((x)&0x00000003)<<16) +#define MCF_FBCS_CSCR_RDAH(x)	(((x)&0x00000003)<<18) +#define MCF_FBCS_CSCR_ASET(x)	(((x)&0x00000003)<<20) +#define MCF_FBCS_CSCR_SWSEN	(0x00800000) +#define MCF_FBCS_CSCR_SWS(x)	(((x)&0x0000003F)<<26) +#define MCF_FBCS_CSCR_PS_8	(0x0040) +#define MCF_FBCS_CSCR_PS_16	(0x0080) +#define MCF_FBCS_CSCR_PS_32	(0x0000) + +/********************************************************************* + * + * General Purpose I/O (GPIO) + * + *********************************************************************/ + +/* Register read/write macros */ +#define MCFGPIO_PODR_FECH		(0xFC0A4000) +#define MCFGPIO_PODR_FECL		(0xFC0A4001) +#define MCFGPIO_PODR_SSI		(0xFC0A4002) +#define MCFGPIO_PODR_BUSCTL		(0xFC0A4003) +#define MCFGPIO_PODR_BE			(0xFC0A4004) +#define MCFGPIO_PODR_CS			(0xFC0A4005) +#define MCFGPIO_PODR_PWM		(0xFC0A4006) +#define MCFGPIO_PODR_FECI2C		(0xFC0A4007) +#define MCFGPIO_PODR_UART		(0xFC0A4009) +#define MCFGPIO_PODR_QSPI		(0xFC0A400A) +#define MCFGPIO_PODR_TIMER		(0xFC0A400B) +#define MCFGPIO_PODR_LCDDATAH		(0xFC0A400D) +#define MCFGPIO_PODR_LCDDATAM		(0xFC0A400E) +#define MCFGPIO_PODR_LCDDATAL		(0xFC0A400F) +#define MCFGPIO_PODR_LCDCTLH		(0xFC0A4010) +#define MCFGPIO_PODR_LCDCTLL		(0xFC0A4011) +#define MCFGPIO_PDDR_FECH		(0xFC0A4014) +#define MCFGPIO_PDDR_FECL		(0xFC0A4015) +#define MCFGPIO_PDDR_SSI		(0xFC0A4016) +#define MCFGPIO_PDDR_BUSCTL		(0xFC0A4017) +#define MCFGPIO_PDDR_BE			(0xFC0A4018) +#define MCFGPIO_PDDR_CS			(0xFC0A4019) +#define MCFGPIO_PDDR_PWM		(0xFC0A401A) +#define MCFGPIO_PDDR_FECI2C		(0xFC0A401B) +#define MCFGPIO_PDDR_UART		(0xFC0A401C) +#define MCFGPIO_PDDR_QSPI		(0xFC0A401E) +#define MCFGPIO_PDDR_TIMER		(0xFC0A401F) +#define MCFGPIO_PDDR_LCDDATAH		(0xFC0A4021) +#define MCFGPIO_PDDR_LCDDATAM		(0xFC0A4022) +#define MCFGPIO_PDDR_LCDDATAL		(0xFC0A4023) +#define MCFGPIO_PDDR_LCDCTLH		(0xFC0A4024) +#define MCFGPIO_PDDR_LCDCTLL		(0xFC0A4025) +#define MCFGPIO_PPDSDR_FECH		(0xFC0A4028) +#define MCFGPIO_PPDSDR_FECL		(0xFC0A4029) +#define MCFGPIO_PPDSDR_SSI		(0xFC0A402A) +#define MCFGPIO_PPDSDR_BUSCTL		(0xFC0A402B) +#define MCFGPIO_PPDSDR_BE		(0xFC0A402C) +#define MCFGPIO_PPDSDR_CS		(0xFC0A402D) +#define MCFGPIO_PPDSDR_PWM		(0xFC0A402E) +#define MCFGPIO_PPDSDR_FECI2C		(0xFC0A402F) +#define MCFGPIO_PPDSDR_UART		(0xFC0A4031) +#define MCFGPIO_PPDSDR_QSPI		(0xFC0A4032) +#define MCFGPIO_PPDSDR_TIMER		(0xFC0A4033) +#define MCFGPIO_PPDSDR_LCDDATAH		(0xFC0A4035) +#define MCFGPIO_PPDSDR_LCDDATAM		(0xFC0A4036) +#define MCFGPIO_PPDSDR_LCDDATAL		(0xFC0A4037) +#define MCFGPIO_PPDSDR_LCDCTLH		(0xFC0A4038) +#define MCFGPIO_PPDSDR_LCDCTLL		(0xFC0A4039) +#define MCFGPIO_PCLRR_FECH		(0xFC0A403C) +#define MCFGPIO_PCLRR_FECL		(0xFC0A403D) +#define MCFGPIO_PCLRR_SSI		(0xFC0A403E) +#define MCFGPIO_PCLRR_BUSCTL		(0xFC0A403F) +#define MCFGPIO_PCLRR_BE		(0xFC0A4040) +#define MCFGPIO_PCLRR_CS		(0xFC0A4041) +#define MCFGPIO_PCLRR_PWM		(0xFC0A4042) +#define MCFGPIO_PCLRR_FECI2C		(0xFC0A4043) +#define MCFGPIO_PCLRR_UART		(0xFC0A4045) +#define MCFGPIO_PCLRR_QSPI		(0xFC0A4046) +#define MCFGPIO_PCLRR_TIMER		(0xFC0A4047) +#define MCFGPIO_PCLRR_LCDDATAH		(0xFC0A4049) +#define MCFGPIO_PCLRR_LCDDATAM		(0xFC0A404A) +#define MCFGPIO_PCLRR_LCDDATAL		(0xFC0A404B) +#define MCFGPIO_PCLRR_LCDCTLH		(0xFC0A404C) +#define MCFGPIO_PCLRR_LCDCTLL		(0xFC0A404D) +#define MCFGPIO_PAR_FEC			(0xFC0A4050) +#define MCFGPIO_PAR_PWM			(0xFC0A4051) +#define MCFGPIO_PAR_BUSCTL		(0xFC0A4052) +#define MCFGPIO_PAR_FECI2C		(0xFC0A4053) +#define MCFGPIO_PAR_BE			(0xFC0A4054) +#define MCFGPIO_PAR_CS			(0xFC0A4055) +#define MCFGPIO_PAR_SSI			(0xFC0A4056) +#define MCFGPIO_PAR_UART		(0xFC0A4058) +#define MCFGPIO_PAR_QSPI		(0xFC0A405A) +#define MCFGPIO_PAR_TIMER		(0xFC0A405C) +#define MCFGPIO_PAR_LCDDATA		(0xFC0A405D) +#define MCFGPIO_PAR_LCDCTL		(0xFC0A405E) +#define MCFGPIO_PAR_IRQ			(0xFC0A4060) +#define MCFGPIO_MSCR_FLEXBUS		(0xFC0A4064) +#define MCFGPIO_MSCR_SDRAM		(0xFC0A4065) +#define MCFGPIO_DSCR_I2C		(0xFC0A4068) +#define MCFGPIO_DSCR_PWM		(0xFC0A4069) +#define MCFGPIO_DSCR_FEC		(0xFC0A406A) +#define MCFGPIO_DSCR_UART		(0xFC0A406B) +#define MCFGPIO_DSCR_QSPI		(0xFC0A406C) +#define MCFGPIO_DSCR_TIMER		(0xFC0A406D) +#define MCFGPIO_DSCR_SSI		(0xFC0A406E) +#define MCFGPIO_DSCR_LCD		(0xFC0A406F) +#define MCFGPIO_DSCR_DEBUG		(0xFC0A4070) +#define MCFGPIO_DSCR_CLKRST		(0xFC0A4071) +#define MCFGPIO_DSCR_IRQ		(0xFC0A4072) + +/* Bit definitions and macros for MCF_GPIO_PODR_FECH */ +#define MCF_GPIO_PODR_FECH_PODR_FECH0              (0x01) +#define MCF_GPIO_PODR_FECH_PODR_FECH1              (0x02) +#define MCF_GPIO_PODR_FECH_PODR_FECH2              (0x04) +#define MCF_GPIO_PODR_FECH_PODR_FECH3              (0x08) +#define MCF_GPIO_PODR_FECH_PODR_FECH4              (0x10) +#define MCF_GPIO_PODR_FECH_PODR_FECH5              (0x20) +#define MCF_GPIO_PODR_FECH_PODR_FECH6              (0x40) +#define MCF_GPIO_PODR_FECH_PODR_FECH7              (0x80) + +/* Bit definitions and macros for MCF_GPIO_PODR_FECL */ +#define MCF_GPIO_PODR_FECL_PODR_FECL0              (0x01) +#define MCF_GPIO_PODR_FECL_PODR_FECL1              (0x02) +#define MCF_GPIO_PODR_FECL_PODR_FECL2              (0x04) +#define MCF_GPIO_PODR_FECL_PODR_FECL3              (0x08) +#define MCF_GPIO_PODR_FECL_PODR_FECL4              (0x10) +#define MCF_GPIO_PODR_FECL_PODR_FECL5              (0x20) +#define MCF_GPIO_PODR_FECL_PODR_FECL6              (0x40) +#define MCF_GPIO_PODR_FECL_PODR_FECL7              (0x80) + +/* Bit definitions and macros for MCF_GPIO_PODR_SSI */ +#define MCF_GPIO_PODR_SSI_PODR_SSI0                (0x01) +#define MCF_GPIO_PODR_SSI_PODR_SSI1                (0x02) +#define MCF_GPIO_PODR_SSI_PODR_SSI2                (0x04) +#define MCF_GPIO_PODR_SSI_PODR_SSI3                (0x08) +#define MCF_GPIO_PODR_SSI_PODR_SSI4                (0x10) + +/* Bit definitions and macros for MCF_GPIO_PODR_BUSCTL */ +#define MCF_GPIO_PODR_BUSCTL_POSDR_BUSCTL0         (0x01) +#define MCF_GPIO_PODR_BUSCTL_PODR_BUSCTL1          (0x02) +#define MCF_GPIO_PODR_BUSCTL_PODR_BUSCTL2          (0x04) +#define MCF_GPIO_PODR_BUSCTL_PODR_BUSCTL3          (0x08) + +/* Bit definitions and macros for MCF_GPIO_PODR_BE */ +#define MCF_GPIO_PODR_BE_PODR_BE0                  (0x01) +#define MCF_GPIO_PODR_BE_PODR_BE1                  (0x02) +#define MCF_GPIO_PODR_BE_PODR_BE2                  (0x04) +#define MCF_GPIO_PODR_BE_PODR_BE3                  (0x08) + +/* Bit definitions and macros for MCF_GPIO_PODR_CS */ +#define MCF_GPIO_PODR_CS_PODR_CS1                  (0x02) +#define MCF_GPIO_PODR_CS_PODR_CS2                  (0x04) +#define MCF_GPIO_PODR_CS_PODR_CS3                  (0x08) +#define MCF_GPIO_PODR_CS_PODR_CS4                  (0x10) +#define MCF_GPIO_PODR_CS_PODR_CS5                  (0x20) + +/* Bit definitions and macros for MCF_GPIO_PODR_PWM */ +#define MCF_GPIO_PODR_PWM_PODR_PWM2                (0x04) +#define MCF_GPIO_PODR_PWM_PODR_PWM3                (0x08) +#define MCF_GPIO_PODR_PWM_PODR_PWM4                (0x10) +#define MCF_GPIO_PODR_PWM_PODR_PWM5                (0x20) + +/* Bit definitions and macros for MCF_GPIO_PODR_FECI2C */ +#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C0          (0x01) +#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C1          (0x02) +#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C2          (0x04) +#define MCF_GPIO_PODR_FECI2C_PODR_FECI2C3          (0x08) + +/* Bit definitions and macros for MCF_GPIO_PODR_UART */ +#define MCF_GPIO_PODR_UART_PODR_UART0              (0x01) +#define MCF_GPIO_PODR_UART_PODR_UART1              (0x02) +#define MCF_GPIO_PODR_UART_PODR_UART2              (0x04) +#define MCF_GPIO_PODR_UART_PODR_UART3              (0x08) +#define MCF_GPIO_PODR_UART_PODR_UART4              (0x10) +#define MCF_GPIO_PODR_UART_PODR_UART5              (0x20) +#define MCF_GPIO_PODR_UART_PODR_UART6              (0x40) +#define MCF_GPIO_PODR_UART_PODR_UART7              (0x80) + +/* Bit definitions and macros for MCF_GPIO_PODR_QSPI */ +#define MCF_GPIO_PODR_QSPI_PODR_QSPI0              (0x01) +#define MCF_GPIO_PODR_QSPI_PODR_QSPI1              (0x02) +#define MCF_GPIO_PODR_QSPI_PODR_QSPI2              (0x04) +#define MCF_GPIO_PODR_QSPI_PODR_QSPI3              (0x08) +#define MCF_GPIO_PODR_QSPI_PODR_QSPI4              (0x10) +#define MCF_GPIO_PODR_QSPI_PODR_QSPI5              (0x20) + +/* Bit definitions and macros for MCF_GPIO_PODR_TIMER */ +#define MCF_GPIO_PODR_TIMER_PODR_TIMER0            (0x01) +#define MCF_GPIO_PODR_TIMER_PODR_TIMER1            (0x02) +#define MCF_GPIO_PODR_TIMER_PODR_TIMER2            (0x04) +#define MCF_GPIO_PODR_TIMER_PODR_TIMER3            (0x08) + +/* Bit definitions and macros for MCF_GPIO_PODR_LCDDATAH */ +#define MCF_GPIO_PODR_LCDDATAH_PODR_LCDDATAH0      (0x01) +#define MCF_GPIO_PODR_LCDDATAH_PODR_LCDDATAH1      (0x02) + +/* Bit definitions and macros for MCF_GPIO_PODR_LCDDATAM */ +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM0      (0x01) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM1      (0x02) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM2      (0x04) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM3      (0x08) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM4      (0x10) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM5      (0x20) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM6      (0x40) +#define MCF_GPIO_PODR_LCDDATAM_PODR_LCDDATAM7      (0x80) + +/* Bit definitions and macros for MCF_GPIO_PODR_LCDDATAL */ +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL0      (0x01) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL1      (0x02) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL2      (0x04) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL3      (0x08) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL4      (0x10) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL5      (0x20) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL6      (0x40) +#define MCF_GPIO_PODR_LCDDATAL_PODR_LCDDATAL7      (0x80) + +/* Bit definitions and macros for MCF_GPIO_PODR_LCDCTLH */ +#define MCF_GPIO_PODR_LCDCTLH_PODR_LCDCTLH0        (0x01) + +/* Bit definitions and macros for MCF_GPIO_PODR_LCDCTLL */ +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL0        (0x01) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL1        (0x02) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL2        (0x04) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL3        (0x08) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL4        (0x10) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL5        (0x20) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL6        (0x40) +#define MCF_GPIO_PODR_LCDCTLL_PODR_LCDCTLL7        (0x80) + +/* Bit definitions and macros for MCF_GPIO_PDDR_FECH */ +#define MCF_GPIO_PDDR_FECH_PDDR_FECH0              (0x01) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH1              (0x02) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH2              (0x04) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH3              (0x08) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH4              (0x10) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH5              (0x20) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH6              (0x40) +#define MCF_GPIO_PDDR_FECH_PDDR_FECH7              (0x80) + +/* Bit definitions and macros for MCF_GPIO_PDDR_FECL */ +#define MCF_GPIO_PDDR_FECL_PDDR_FECL0              (0x01) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL1              (0x02) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL2              (0x04) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL3              (0x08) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL4              (0x10) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL5              (0x20) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL6              (0x40) +#define MCF_GPIO_PDDR_FECL_PDDR_FECL7              (0x80) + +/* Bit definitions and macros for MCF_GPIO_PDDR_SSI */ +#define MCF_GPIO_PDDR_SSI_PDDR_SSI0                (0x01) +#define MCF_GPIO_PDDR_SSI_PDDR_SSI1                (0x02) +#define MCF_GPIO_PDDR_SSI_PDDR_SSI2                (0x04) +#define MCF_GPIO_PDDR_SSI_PDDR_SSI3                (0x08) +#define MCF_GPIO_PDDR_SSI_PDDR_SSI4                (0x10) + +/* Bit definitions and macros for MCF_GPIO_PDDR_BUSCTL */ +#define MCF_GPIO_PDDR_BUSCTL_POSDR_BUSCTL0         (0x01) +#define MCF_GPIO_PDDR_BUSCTL_PDDR_BUSCTL1          (0x02) +#define MCF_GPIO_PDDR_BUSCTL_PDDR_BUSCTL2          (0x04) +#define MCF_GPIO_PDDR_BUSCTL_PDDR_BUSCTL3          (0x08) + +/* Bit definitions and macros for MCF_GPIO_PDDR_BE */ +#define MCF_GPIO_PDDR_BE_PDDR_BE0                  (0x01) +#define MCF_GPIO_PDDR_BE_PDDR_BE1                  (0x02) +#define MCF_GPIO_PDDR_BE_PDDR_BE2                  (0x04) +#define MCF_GPIO_PDDR_BE_PDDR_BE3                  (0x08) + +/* Bit definitions and macros for MCF_GPIO_PDDR_CS */ +#define MCF_GPIO_PDDR_CS_PDDR_CS1                  (0x02) +#define MCF_GPIO_PDDR_CS_PDDR_CS2                  (0x04) +#define MCF_GPIO_PDDR_CS_PDDR_CS3                  (0x08) +#define MCF_GPIO_PDDR_CS_PDDR_CS4                  (0x10) +#define MCF_GPIO_PDDR_CS_PDDR_CS5                  (0x20) + +/* Bit definitions and macros for MCF_GPIO_PDDR_PWM */ +#define MCF_GPIO_PDDR_PWM_PDDR_PWM2                (0x04) +#define MCF_GPIO_PDDR_PWM_PDDR_PWM3                (0x08) +#define MCF_GPIO_PDDR_PWM_PDDR_PWM4                (0x10) +#define MCF_GPIO_PDDR_PWM_PDDR_PWM5                (0x20) + +/* Bit definitions and macros for MCF_GPIO_PDDR_FECI2C */ +#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C0          (0x01) +#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C1          (0x02) +#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C2          (0x04) +#define MCF_GPIO_PDDR_FECI2C_PDDR_FECI2C3          (0x08) + +/* Bit definitions and macros for MCF_GPIO_PDDR_UART */ +#define MCF_GPIO_PDDR_UART_PDDR_UART0              (0x01) +#define MCF_GPIO_PDDR_UART_PDDR_UART1              (0x02) +#define MCF_GPIO_PDDR_UART_PDDR_UART2              (0x04) +#define MCF_GPIO_PDDR_UART_PDDR_UART3              (0x08) +#define MCF_GPIO_PDDR_UART_PDDR_UART4              (0x10) +#define MCF_GPIO_PDDR_UART_PDDR_UART5              (0x20) +#define MCF_GPIO_PDDR_UART_PDDR_UART6              (0x40) +#define MCF_GPIO_PDDR_UART_PDDR_UART7              (0x80) + +/* Bit definitions and macros for MCF_GPIO_PDDR_QSPI */ +#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI0              (0x01) +#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI1              (0x02) +#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI2              (0x04) +#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI3              (0x08) +#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI4              (0x10) +#define MCF_GPIO_PDDR_QSPI_PDDR_QSPI5              (0x20) + +/* Bit definitions and macros for MCF_GPIO_PDDR_TIMER */ +#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER0            (0x01) +#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER1            (0x02) +#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER2            (0x04) +#define MCF_GPIO_PDDR_TIMER_PDDR_TIMER3            (0x08) + +/* Bit definitions and macros for MCF_GPIO_PDDR_LCDDATAH */ +#define MCF_GPIO_PDDR_LCDDATAH_PDDR_LCDDATAH0      (0x01) +#define MCF_GPIO_PDDR_LCDDATAH_PDDR_LCDDATAH1      (0x02) + +/* Bit definitions and macros for MCF_GPIO_PDDR_LCDDATAM */ +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM0      (0x01) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM1      (0x02) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM2      (0x04) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM3      (0x08) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM4      (0x10) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM5      (0x20) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM6      (0x40) +#define MCF_GPIO_PDDR_LCDDATAM_PDDR_LCDDATAM7      (0x80) + +/* Bit definitions and macros for MCF_GPIO_PDDR_LCDDATAL */ +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL0      (0x01) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL1      (0x02) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL2      (0x04) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL3      (0x08) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL4      (0x10) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL5      (0x20) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL6      (0x40) +#define MCF_GPIO_PDDR_LCDDATAL_PDDR_LCDDATAL7      (0x80) + +/* Bit definitions and macros for MCF_GPIO_PDDR_LCDCTLH */ +#define MCF_GPIO_PDDR_LCDCTLH_PDDR_LCDCTLH0        (0x01) + +/* Bit definitions and macros for MCF_GPIO_PDDR_LCDCTLL */ +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL0        (0x01) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL1        (0x02) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL2        (0x04) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL3        (0x08) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL4        (0x10) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL5        (0x20) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL6        (0x40) +#define MCF_GPIO_PDDR_LCDCTLL_PDDR_LCDCTLL7        (0x80) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECH */ +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH0          (0x01) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH1          (0x02) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH2          (0x04) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH3          (0x08) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH4          (0x10) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH5          (0x20) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH6          (0x40) +#define MCF_GPIO_PPDSDR_FECH_PPDSDR_FECH7          (0x80) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECL */ +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL0          (0x01) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL1          (0x02) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL2          (0x04) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL3          (0x08) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL4          (0x10) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL5          (0x20) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL6          (0x40) +#define MCF_GPIO_PPDSDR_FECL_PPDSDR_FECL7          (0x80) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_SSI */ +#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI0            (0x01) +#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI1            (0x02) +#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI2            (0x04) +#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI3            (0x08) +#define MCF_GPIO_PPDSDR_SSI_PPDSDR_SSI4            (0x10) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_BUSCTL */ +#define MCF_GPIO_PPDSDR_BUSCTL_POSDR_BUSCTL0       (0x01) +#define MCF_GPIO_PPDSDR_BUSCTL_PPDSDR_BUSCTL1      (0x02) +#define MCF_GPIO_PPDSDR_BUSCTL_PPDSDR_BUSCTL2      (0x04) +#define MCF_GPIO_PPDSDR_BUSCTL_PPDSDR_BUSCTL3      (0x08) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_BE */ +#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE0              (0x01) +#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE1              (0x02) +#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE2              (0x04) +#define MCF_GPIO_PPDSDR_BE_PPDSDR_BE3              (0x08) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_CS */ +#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS1              (0x02) +#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS2              (0x04) +#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS3              (0x08) +#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS4              (0x10) +#define MCF_GPIO_PPDSDR_CS_PPDSDR_CS5              (0x20) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_PWM */ +#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM2            (0x04) +#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM3            (0x08) +#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM4            (0x10) +#define MCF_GPIO_PPDSDR_PWM_PPDSDR_PWM5            (0x20) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_FECI2C */ +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C0      (0x01) +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C1      (0x02) +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C2      (0x04) +#define MCF_GPIO_PPDSDR_FECI2C_PPDSDR_FECI2C3      (0x08) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_UART */ +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART0          (0x01) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART1          (0x02) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART2          (0x04) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART3          (0x08) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART4          (0x10) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART5          (0x20) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART6          (0x40) +#define MCF_GPIO_PPDSDR_UART_PPDSDR_UART7          (0x80) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_QSPI */ +#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI0          (0x01) +#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI1          (0x02) +#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI2          (0x04) +#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI3          (0x08) +#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI4          (0x10) +#define MCF_GPIO_PPDSDR_QSPI_PPDSDR_QSPI5          (0x20) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_TIMER */ +#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER0        (0x01) +#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER1        (0x02) +#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER2        (0x04) +#define MCF_GPIO_PPDSDR_TIMER_PPDSDR_TIMER3        (0x08) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDDATAH */ +#define MCF_GPIO_PPDSDR_LCDDATAH_PPDSDR_LCDDATAH0  (0x01) +#define MCF_GPIO_PPDSDR_LCDDATAH_PPDSDR_LCDDATAH1  (0x02) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDDATAM */ +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM0  (0x01) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM1  (0x02) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM2  (0x04) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM3  (0x08) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM4  (0x10) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM5  (0x20) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM6  (0x40) +#define MCF_GPIO_PPDSDR_LCDDATAM_PPDSDR_LCDDATAM7  (0x80) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDDATAL */ +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL0  (0x01) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL1  (0x02) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL2  (0x04) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL3  (0x08) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL4  (0x10) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL5  (0x20) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL6  (0x40) +#define MCF_GPIO_PPDSDR_LCDDATAL_PPDSDR_LCDDATAL7  (0x80) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDCTLH */ +#define MCF_GPIO_PPDSDR_LCDCTLH_PPDSDR_LCDCTLH0    (0x01) + +/* Bit definitions and macros for MCF_GPIO_PPDSDR_LCDCTLL */ +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL0    (0x01) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL1    (0x02) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL2    (0x04) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL3    (0x08) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL4    (0x10) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL5    (0x20) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL6    (0x40) +#define MCF_GPIO_PPDSDR_LCDCTLL_PPDSDR_LCDCTLL7    (0x80) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_FECH */ +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH0            (0x01) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH1            (0x02) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH2            (0x04) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH3            (0x08) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH4            (0x10) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH5            (0x20) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH6            (0x40) +#define MCF_GPIO_PCLRR_FECH_PCLRR_FECH7            (0x80) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_FECL */ +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL0            (0x01) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL1            (0x02) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL2            (0x04) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL3            (0x08) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL4            (0x10) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL5            (0x20) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL6            (0x40) +#define MCF_GPIO_PCLRR_FECL_PCLRR_FECL7            (0x80) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_SSI */ +#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI0              (0x01) +#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI1              (0x02) +#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI2              (0x04) +#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI3              (0x08) +#define MCF_GPIO_PCLRR_SSI_PCLRR_SSI4              (0x10) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_BUSCTL */ +#define MCF_GPIO_PCLRR_BUSCTL_POSDR_BUSCTL0        (0x01) +#define MCF_GPIO_PCLRR_BUSCTL_PCLRR_BUSCTL1        (0x02) +#define MCF_GPIO_PCLRR_BUSCTL_PCLRR_BUSCTL2        (0x04) +#define MCF_GPIO_PCLRR_BUSCTL_PCLRR_BUSCTL3        (0x08) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_BE */ +#define MCF_GPIO_PCLRR_BE_PCLRR_BE0                (0x01) +#define MCF_GPIO_PCLRR_BE_PCLRR_BE1                (0x02) +#define MCF_GPIO_PCLRR_BE_PCLRR_BE2                (0x04) +#define MCF_GPIO_PCLRR_BE_PCLRR_BE3                (0x08) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_CS */ +#define MCF_GPIO_PCLRR_CS_PCLRR_CS1                (0x02) +#define MCF_GPIO_PCLRR_CS_PCLRR_CS2                (0x04) +#define MCF_GPIO_PCLRR_CS_PCLRR_CS3                (0x08) +#define MCF_GPIO_PCLRR_CS_PCLRR_CS4                (0x10) +#define MCF_GPIO_PCLRR_CS_PCLRR_CS5                (0x20) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_PWM */ +#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM2              (0x04) +#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM3              (0x08) +#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM4              (0x10) +#define MCF_GPIO_PCLRR_PWM_PCLRR_PWM5              (0x20) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_FECI2C */ +#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C0        (0x01) +#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C1        (0x02) +#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C2        (0x04) +#define MCF_GPIO_PCLRR_FECI2C_PCLRR_FECI2C3        (0x08) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_UART */ +#define MCF_GPIO_PCLRR_UART_PCLRR_UART0            (0x01) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART1            (0x02) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART2            (0x04) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART3            (0x08) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART4            (0x10) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART5            (0x20) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART6            (0x40) +#define MCF_GPIO_PCLRR_UART_PCLRR_UART7            (0x80) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_QSPI */ +#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI0            (0x01) +#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI1            (0x02) +#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI2            (0x04) +#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI3            (0x08) +#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI4            (0x10) +#define MCF_GPIO_PCLRR_QSPI_PCLRR_QSPI5            (0x20) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_TIMER */ +#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER0          (0x01) +#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER1          (0x02) +#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER2          (0x04) +#define MCF_GPIO_PCLRR_TIMER_PCLRR_TIMER3          (0x08) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDDATAH */ +#define MCF_GPIO_PCLRR_LCDDATAH_PCLRR_LCDDATAH0    (0x01) +#define MCF_GPIO_PCLRR_LCDDATAH_PCLRR_LCDDATAH1    (0x02) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDDATAM */ +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM0    (0x01) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM1    (0x02) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM2    (0x04) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM3    (0x08) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM4    (0x10) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM5    (0x20) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM6    (0x40) +#define MCF_GPIO_PCLRR_LCDDATAM_PCLRR_LCDDATAM7    (0x80) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDDATAL */ +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL0    (0x01) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL1    (0x02) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL2    (0x04) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL3    (0x08) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL4    (0x10) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL5    (0x20) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL6    (0x40) +#define MCF_GPIO_PCLRR_LCDDATAL_PCLRR_LCDDATAL7    (0x80) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDCTLH */ +#define MCF_GPIO_PCLRR_LCDCTLH_PCLRR_LCDCTLH0      (0x01) + +/* Bit definitions and macros for MCF_GPIO_PCLRR_LCDCTLL */ +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL0      (0x01) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL1      (0x02) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL2      (0x04) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL3      (0x08) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL4      (0x10) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL5      (0x20) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL6      (0x40) +#define MCF_GPIO_PCLRR_LCDCTLL_PCLRR_LCDCTLL7      (0x80) + +/* Bit definitions and macros for MCF_GPIO_PAR_FEC */ +#define MCF_GPIO_PAR_FEC_PAR_FEC_MII(x)            (((x)&0x03)<<0) +#define MCF_GPIO_PAR_FEC_PAR_FEC_7W(x)             (((x)&0x03)<<2) +#define MCF_GPIO_PAR_FEC_PAR_FEC_7W_GPIO           (0x00) +#define MCF_GPIO_PAR_FEC_PAR_FEC_7W_URTS1          (0x04) +#define MCF_GPIO_PAR_FEC_PAR_FEC_7W_FEC            (0x0C) +#define MCF_GPIO_PAR_FEC_PAR_FEC_MII_GPIO          (0x00) +#define MCF_GPIO_PAR_FEC_PAR_FEC_MII_UART          (0x01) +#define MCF_GPIO_PAR_FEC_PAR_FEC_MII_FEC           (0x03) + +/* Bit definitions and macros for MCF_GPIO_PAR_PWM */ +#define MCF_GPIO_PAR_PWM_PAR_PWM1(x)               (((x)&0x03)<<0) +#define MCF_GPIO_PAR_PWM_PAR_PWM3(x)               (((x)&0x03)<<2) +#define MCF_GPIO_PAR_PWM_PAR_PWM5                  (0x10) +#define MCF_GPIO_PAR_PWM_PAR_PWM7                  (0x20) + +/* Bit definitions and macros for MCF_GPIO_PAR_BUSCTL */ +#define MCF_GPIO_PAR_BUSCTL_PAR_TS(x)              (((x)&0x03)<<3) +#define MCF_GPIO_PAR_BUSCTL_PAR_RWB                (0x20) +#define MCF_GPIO_PAR_BUSCTL_PAR_TA                 (0x40) +#define MCF_GPIO_PAR_BUSCTL_PAR_OE                 (0x80) +#define MCF_GPIO_PAR_BUSCTL_PAR_OE_GPIO            (0x00) +#define MCF_GPIO_PAR_BUSCTL_PAR_OE_OE              (0x80) +#define MCF_GPIO_PAR_BUSCTL_PAR_TA_GPIO            (0x00) +#define MCF_GPIO_PAR_BUSCTL_PAR_TA_TA              (0x40) +#define MCF_GPIO_PAR_BUSCTL_PAR_RWB_GPIO           (0x00) +#define MCF_GPIO_PAR_BUSCTL_PAR_RWB_RWB            (0x20) +#define MCF_GPIO_PAR_BUSCTL_PAR_TS_GPIO            (0x00) +#define MCF_GPIO_PAR_BUSCTL_PAR_TS_DACK0           (0x10) +#define MCF_GPIO_PAR_BUSCTL_PAR_TS_TS              (0x18) + +/* Bit definitions and macros for MCF_GPIO_PAR_FECI2C */ +#define MCF_GPIO_PAR_FECI2C_PAR_SDA(x)             (((x)&0x03)<<0) +#define MCF_GPIO_PAR_FECI2C_PAR_SCL(x)             (((x)&0x03)<<2) +#define MCF_GPIO_PAR_FECI2C_PAR_MDIO(x)            (((x)&0x03)<<4) +#define MCF_GPIO_PAR_FECI2C_PAR_MDC(x)             (((x)&0x03)<<6) +#define MCF_GPIO_PAR_FECI2C_PAR_MDC_GPIO           (0x00) +#define MCF_GPIO_PAR_FECI2C_PAR_MDC_UTXD2          (0x40) +#define MCF_GPIO_PAR_FECI2C_PAR_MDC_SCL            (0x80) +#define MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC           (0xC0) +#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_GPIO          (0x00) +#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_URXD2         (0x10) +#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_SDA           (0x20) +#define MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO         (0x30) +#define MCF_GPIO_PAR_FECI2C_PAR_SCL_GPIO           (0x00) +#define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2          (0x04) +#define MCF_GPIO_PAR_FECI2C_PAR_SCL_SCL            (0x0C) +#define MCF_GPIO_PAR_FECI2C_PAR_SDA_GPIO           (0x00) +#define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2          (0x02) +#define MCF_GPIO_PAR_FECI2C_PAR_SDA_SDA            (0x03) + +/* Bit definitions and macros for MCF_GPIO_PAR_BE */ +#define MCF_GPIO_PAR_BE_PAR_BE0                    (0x01) +#define MCF_GPIO_PAR_BE_PAR_BE1                    (0x02) +#define MCF_GPIO_PAR_BE_PAR_BE2                    (0x04) +#define MCF_GPIO_PAR_BE_PAR_BE3                    (0x08) + +/* Bit definitions and macros for MCF_GPIO_PAR_CS */ +#define MCF_GPIO_PAR_CS_PAR_CS1                    (0x02) +#define MCF_GPIO_PAR_CS_PAR_CS2                    (0x04) +#define MCF_GPIO_PAR_CS_PAR_CS3                    (0x08) +#define MCF_GPIO_PAR_CS_PAR_CS4                    (0x10) +#define MCF_GPIO_PAR_CS_PAR_CS5                    (0x20) +#define MCF_GPIO_PAR_CS_PAR_CS_CS1_GPIO            (0x00) +#define MCF_GPIO_PAR_CS_PAR_CS_CS1_SDCS1           (0x01) +#define MCF_GPIO_PAR_CS_PAR_CS_CS1_CS1             (0x03) + +/* Bit definitions and macros for MCF_GPIO_PAR_SSI */ +#define MCF_GPIO_PAR_SSI_PAR_MCLK                  (0x0080) +#define MCF_GPIO_PAR_SSI_PAR_TXD(x)                (((x)&0x0003)<<8) +#define MCF_GPIO_PAR_SSI_PAR_RXD(x)                (((x)&0x0003)<<10) +#define MCF_GPIO_PAR_SSI_PAR_FS(x)                 (((x)&0x0003)<<12) +#define MCF_GPIO_PAR_SSI_PAR_BCLK(x)               (((x)&0x0003)<<14) + +/* Bit definitions and macros for MCF_GPIO_PAR_UART */ +#define MCF_GPIO_PAR_UART_PAR_UTXD0                (0x0001) +#define MCF_GPIO_PAR_UART_PAR_URXD0                (0x0002) +#define MCF_GPIO_PAR_UART_PAR_URTS0                (0x0004) +#define MCF_GPIO_PAR_UART_PAR_UCTS0                (0x0008) +#define MCF_GPIO_PAR_UART_PAR_UTXD1(x)             (((x)&0x0003)<<4) +#define MCF_GPIO_PAR_UART_PAR_URXD1(x)             (((x)&0x0003)<<6) +#define MCF_GPIO_PAR_UART_PAR_URTS1(x)             (((x)&0x0003)<<8) +#define MCF_GPIO_PAR_UART_PAR_UCTS1(x)             (((x)&0x0003)<<10) +#define MCF_GPIO_PAR_UART_PAR_UCTS1_GPIO           (0x0000) +#define MCF_GPIO_PAR_UART_PAR_UCTS1_SSI_BCLK       (0x0800) +#define MCF_GPIO_PAR_UART_PAR_UCTS1_ULPI_D7        (0x0400) +#define MCF_GPIO_PAR_UART_PAR_UCTS1_UCTS1          (0x0C00) +#define MCF_GPIO_PAR_UART_PAR_URTS1_GPIO           (0x0000) +#define MCF_GPIO_PAR_UART_PAR_URTS1_SSI_FS         (0x0200) +#define MCF_GPIO_PAR_UART_PAR_URTS1_ULPI_D6        (0x0100) +#define MCF_GPIO_PAR_UART_PAR_URTS1_URTS1          (0x0300) +#define MCF_GPIO_PAR_UART_PAR_URXD1_GPIO           (0x0000) +#define MCF_GPIO_PAR_UART_PAR_URXD1_SSI_RXD        (0x0080) +#define MCF_GPIO_PAR_UART_PAR_URXD1_ULPI_D5        (0x0040) +#define MCF_GPIO_PAR_UART_PAR_URXD1_URXD1          (0x00C0) +#define MCF_GPIO_PAR_UART_PAR_UTXD1_GPIO           (0x0000) +#define MCF_GPIO_PAR_UART_PAR_UTXD1_SSI_TXD        (0x0020) +#define MCF_GPIO_PAR_UART_PAR_UTXD1_ULPI_D4        (0x0010) +#define MCF_GPIO_PAR_UART_PAR_UTXD1_UTXD1          (0x0030) + +/* Bit definitions and macros for MCF_GPIO_PAR_QSPI */ +#define MCF_GPIO_PAR_QSPI_PAR_SCK(x)               (((x)&0x0003)<<4) +#define MCF_GPIO_PAR_QSPI_PAR_DOUT(x)              (((x)&0x0003)<<6) +#define MCF_GPIO_PAR_QSPI_PAR_DIN(x)               (((x)&0x0003)<<8) +#define MCF_GPIO_PAR_QSPI_PAR_PCS0(x)              (((x)&0x0003)<<10) +#define MCF_GPIO_PAR_QSPI_PAR_PCS1(x)              (((x)&0x0003)<<12) +#define MCF_GPIO_PAR_QSPI_PAR_PCS2(x)              (((x)&0x0003)<<14) + +/* Bit definitions and macros for MCF_GPIO_PAR_TIMER */ +#define MCF_GPIO_PAR_TIMER_PAR_TIN0(x)             (((x)&0x03)<<0) +#define MCF_GPIO_PAR_TIMER_PAR_TIN1(x)             (((x)&0x03)<<2) +#define MCF_GPIO_PAR_TIMER_PAR_TIN2(x)             (((x)&0x03)<<4) +#define MCF_GPIO_PAR_TIMER_PAR_TIN3(x)             (((x)&0x03)<<6) +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_GPIO           (0x00) +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_TOUT3          (0x80) +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_URXD2          (0x40) +#define MCF_GPIO_PAR_TIMER_PAR_TIN3_TIN3           (0xC0) +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_GPIO           (0x00) +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_TOUT2          (0x20) +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_UTXD2          (0x10) +#define MCF_GPIO_PAR_TIMER_PAR_TIN2_TIN2           (0x30) +#define MCF_GPIO_PAR_TIMER_PAR_TIN1_GPIO           (0x00) +#define MCF_GPIO_PAR_TIMER_PAR_TIN1_TOUT1          (0x08) +#define MCF_GPIO_PAR_TIMER_PAR_TIN1_DACK1          (0x04) +#define MCF_GPIO_PAR_TIMER_PAR_TIN1_TIN1           (0x0C) +#define MCF_GPIO_PAR_TIMER_PAR_TIN0_GPIO           (0x00) +#define MCF_GPIO_PAR_TIMER_PAR_TIN0_TOUT0          (0x02) +#define MCF_GPIO_PAR_TIMER_PAR_TIN0_DREQ0          (0x01) +#define MCF_GPIO_PAR_TIMER_PAR_TIN0_TIN0           (0x03) + +/* Bit definitions and macros for MCF_GPIO_PAR_LCDDATA */ +#define MCF_GPIO_PAR_LCDDATA_PAR_LD7_0(x)          (((x)&0x03)<<0) +#define MCF_GPIO_PAR_LCDDATA_PAR_LD15_8(x)         (((x)&0x03)<<2) +#define MCF_GPIO_PAR_LCDDATA_PAR_LD16(x)           (((x)&0x03)<<4) +#define MCF_GPIO_PAR_LCDDATA_PAR_LD17(x)           (((x)&0x03)<<6) + +/* Bit definitions and macros for MCF_GPIO_PAR_LCDCTL */ +#define MCF_GPIO_PAR_LCDCTL_PAR_CLS                (0x0001) +#define MCF_GPIO_PAR_LCDCTL_PAR_PS                 (0x0002) +#define MCF_GPIO_PAR_LCDCTL_PAR_REV                (0x0004) +#define MCF_GPIO_PAR_LCDCTL_PAR_SPL_SPR            (0x0008) +#define MCF_GPIO_PAR_LCDCTL_PAR_CONTRAST           (0x0010) +#define MCF_GPIO_PAR_LCDCTL_PAR_LSCLK              (0x0020) +#define MCF_GPIO_PAR_LCDCTL_PAR_LP_HSYNC           (0x0040) +#define MCF_GPIO_PAR_LCDCTL_PAR_FLM_VSYNC          (0x0080) +#define MCF_GPIO_PAR_LCDCTL_PAR_ACD_OE             (0x0100) + +/* Bit definitions and macros for MCF_GPIO_PAR_IRQ */ +#define MCF_GPIO_PAR_IRQ_PAR_IRQ1(x)               (((x)&0x0003)<<4) +#define MCF_GPIO_PAR_IRQ_PAR_IRQ2(x)               (((x)&0x0003)<<6) +#define MCF_GPIO_PAR_IRQ_PAR_IRQ4(x)               (((x)&0x0003)<<8) +#define MCF_GPIO_PAR_IRQ_PAR_IRQ5(x)               (((x)&0x0003)<<10) +#define MCF_GPIO_PAR_IRQ_PAR_IRQ6(x)               (((x)&0x0003)<<12) + +/* Bit definitions and macros for MCF_GPIO_MSCR_FLEXBUS */ +#define MCF_GPIO_MSCR_FLEXBUS_MSCR_ADDRCTL(x)      (((x)&0x03)<<0) +#define MCF_GPIO_MSCR_FLEXBUS_MSCR_DLOWER(x)       (((x)&0x03)<<2) +#define MCF_GPIO_MSCR_FLEXBUS_MSCR_DUPPER(x)       (((x)&0x03)<<4) + +/* Bit definitions and macros for MCF_GPIO_MSCR_SDRAM */ +#define MCF_GPIO_MSCR_SDRAM_MSCR_SDRAM(x)          (((x)&0x03)<<0) +#define MCF_GPIO_MSCR_SDRAM_MSCR_SDCLK(x)          (((x)&0x03)<<2) +#define MCF_GPIO_MSCR_SDRAM_MSCR_SDCLKB(x)         (((x)&0x03)<<4) + +/* Bit definitions and macros for MCF_GPIO_DSCR_I2C */ +#define MCF_GPIO_DSCR_I2C_I2C_DSE(x)               (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_PWM */ +#define MCF_GPIO_DSCR_PWM_PWM_DSE(x)               (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_FEC */ +#define MCF_GPIO_DSCR_FEC_FEC_DSE(x)               (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_UART */ +#define MCF_GPIO_DSCR_UART_UART0_DSE(x)            (((x)&0x03)<<0) +#define MCF_GPIO_DSCR_UART_UART1_DSE(x)            (((x)&0x03)<<2) + +/* Bit definitions and macros for MCF_GPIO_DSCR_QSPI */ +#define MCF_GPIO_DSCR_QSPI_QSPI_DSE(x)             (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_TIMER */ +#define MCF_GPIO_DSCR_TIMER_TIMER_DSE(x)           (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_SSI */ +#define MCF_GPIO_DSCR_SSI_SSI_DSE(x)               (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_LCD */ +#define MCF_GPIO_DSCR_LCD_LCD_DSE(x)               (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_DEBUG */ +#define MCF_GPIO_DSCR_DEBUG_DEBUG_DSE(x)           (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_CLKRST */ +#define MCF_GPIO_DSCR_CLKRST_CLKRST_DSE(x)         (((x)&0x03)<<0) + +/* Bit definitions and macros for MCF_GPIO_DSCR_IRQ */ +#define MCF_GPIO_DSCR_IRQ_IRQ_DSE(x)               (((x)&0x03)<<0) + +/* + * Generic GPIO support + */ +#define MCFGPIO_PODR			MCFGPIO_PODR_FECH +#define MCFGPIO_PDDR			MCFGPIO_PDDR_FECH +#define MCFGPIO_PPDR			MCFGPIO_PPDSDR_FECH +#define MCFGPIO_SETR			MCFGPIO_PPDSDR_FECH +#define MCFGPIO_CLRR			MCFGPIO_PCLRR_FECH + +#define MCFGPIO_PIN_MAX			136 +#define MCFGPIO_IRQ_MAX			8 +#define MCFGPIO_IRQ_VECBASE		MCFINT_VECBASE + +/********************************************************************* + * + * Phase Locked Loop (PLL) + * + *********************************************************************/ + +/* Register read/write macros */ +#define MCF_PLL_PODR              0xFC0C0000 +#define MCF_PLL_PLLCR             0xFC0C0004 +#define MCF_PLL_PMDR              0xFC0C0008 +#define MCF_PLL_PFDR              0xFC0C000C + +/* Bit definitions and macros for MCF_PLL_PODR */ +#define MCF_PLL_PODR_BUSDIV(x)    (((x)&0x0F)<<0) +#define MCF_PLL_PODR_CPUDIV(x)    (((x)&0x0F)<<4) + +/* Bit definitions and macros for MCF_PLL_PLLCR */ +#define MCF_PLL_PLLCR_DITHDEV(x)  (((x)&0x07)<<0) +#define MCF_PLL_PLLCR_DITHEN      (0x80) + +/* Bit definitions and macros for MCF_PLL_PMDR */ +#define MCF_PLL_PMDR_MODDIV(x)    (((x)&0xFF)<<0) + +/* Bit definitions and macros for MCF_PLL_PFDR */ +#define MCF_PLL_PFDR_MFD(x)       (((x)&0xFF)<<0) + +/********************************************************************* + * + * System Control Module Registers (SCM) + * + *********************************************************************/ + +/* Register read/write macros */ +#define MCF_SCM_MPR			0xFC000000 +#define MCF_SCM_PACRA			0xFC000020 +#define MCF_SCM_PACRB			0xFC000024 +#define MCF_SCM_PACRC			0xFC000028 +#define MCF_SCM_PACRD			0xFC00002C +#define MCF_SCM_PACRE			0xFC000040 +#define MCF_SCM_PACRF			0xFC000044 + +#define MCF_SCM_BCR			0xFC040024 + +/********************************************************************* + * + * SDRAM Controller (SDRAMC) + * + *********************************************************************/ + +/* Register read/write macros */ +#define MCF_SDRAMC_SDMR			0xFC0B8000 +#define MCF_SDRAMC_SDCR			0xFC0B8004 +#define MCF_SDRAMC_SDCFG1		0xFC0B8008 +#define MCF_SDRAMC_SDCFG2		0xFC0B800C +#define MCF_SDRAMC_LIMP_FIX		0xFC0B8080 +#define MCF_SDRAMC_SDDS			0xFC0B8100 +#define MCF_SDRAMC_SDCS0		0xFC0B8110 +#define MCF_SDRAMC_SDCS1		0xFC0B8114 +#define MCF_SDRAMC_SDCS2		0xFC0B8118 +#define MCF_SDRAMC_SDCS3		0xFC0B811C + +/* Bit definitions and macros for MCF_SDRAMC_SDMR */ +#define MCF_SDRAMC_SDMR_CMD		(0x00010000) +#define MCF_SDRAMC_SDMR_AD(x)		(((x)&0x00000FFF)<<18) +#define MCF_SDRAMC_SDMR_BNKAD(x)	(((x)&0x00000003)<<30) +#define MCF_SDRAMC_SDMR_BNKAD_LMR	(0x00000000) +#define MCF_SDRAMC_SDMR_BNKAD_LEMR	(0x40000000) + +/* Bit definitions and macros for MCF_SDRAMC_SDCR */ +#define MCF_SDRAMC_SDCR_IPALL		(0x00000002) +#define MCF_SDRAMC_SDCR_IREF		(0x00000004) +#define MCF_SDRAMC_SDCR_DQS_OE(x)	(((x)&0x0000000F)<<8) +#define MCF_SDRAMC_SDCR_PS(x)		(((x)&0x00000003)<<12) +#define MCF_SDRAMC_SDCR_RCNT(x)		(((x)&0x0000003F)<<16) +#define MCF_SDRAMC_SDCR_OE_RULE		(0x00400000) +#define MCF_SDRAMC_SDCR_MUX(x)		(((x)&0x00000003)<<24) +#define MCF_SDRAMC_SDCR_REF		(0x10000000) +#define MCF_SDRAMC_SDCR_DDR		(0x20000000) +#define MCF_SDRAMC_SDCR_CKE		(0x40000000) +#define MCF_SDRAMC_SDCR_MODE_EN		(0x80000000) +#define MCF_SDRAMC_SDCR_PS_16		(0x00002000) +#define MCF_SDRAMC_SDCR_PS_32		(0x00000000) + +/* Bit definitions and macros for MCF_SDRAMC_SDCFG1 */ +#define MCF_SDRAMC_SDCFG1_WTLAT(x)	(((x)&0x00000007)<<4) +#define MCF_SDRAMC_SDCFG1_REF2ACT(x)	(((x)&0x0000000F)<<8) +#define MCF_SDRAMC_SDCFG1_PRE2ACT(x)	(((x)&0x00000007)<<12) +#define MCF_SDRAMC_SDCFG1_ACT2RW(x)	(((x)&0x00000007)<<16) +#define MCF_SDRAMC_SDCFG1_RDLAT(x)	(((x)&0x0000000F)<<20) +#define MCF_SDRAMC_SDCFG1_SWT2RD(x)	(((x)&0x00000007)<<24) +#define MCF_SDRAMC_SDCFG1_SRD2RW(x)	(((x)&0x0000000F)<<28) + +/* Bit definitions and macros for MCF_SDRAMC_SDCFG2 */ +#define MCF_SDRAMC_SDCFG2_BL(x)		(((x)&0x0000000F)<<16) +#define MCF_SDRAMC_SDCFG2_BRD2WT(x)	(((x)&0x0000000F)<<20) +#define MCF_SDRAMC_SDCFG2_BWT2RW(x)	(((x)&0x0000000F)<<24) +#define MCF_SDRAMC_SDCFG2_BRD2PRE(x)	(((x)&0x0000000F)<<28) + +/* Device Errata - LIMP mode work around */ +#define MCF_SDRAMC_REFRESH		(0x40000000) + +/* Bit definitions and macros for MCF_SDRAMC_SDDS */ +#define MCF_SDRAMC_SDDS_SB_D(x)		(((x)&0x00000003)<<0) +#define MCF_SDRAMC_SDDS_SB_S(x)		(((x)&0x00000003)<<2) +#define MCF_SDRAMC_SDDS_SB_A(x)		(((x)&0x00000003)<<4) +#define MCF_SDRAMC_SDDS_SB_C(x)		(((x)&0x00000003)<<6) +#define MCF_SDRAMC_SDDS_SB_E(x)		(((x)&0x00000003)<<8) + +/* Bit definitions and macros for MCF_SDRAMC_SDCS */ +#define MCF_SDRAMC_SDCS_CSSZ(x)		(((x)&0x0000001F)<<0) +#define MCF_SDRAMC_SDCS_BASE(x)		(((x)&0x00000FFF)<<20) +#define MCF_SDRAMC_SDCS_BA(x)		((x)&0xFFF00000) +#define MCF_SDRAMC_SDCS_CSSZ_DIABLE	(0x00000000) +#define MCF_SDRAMC_SDCS_CSSZ_1MBYTE	(0x00000013) +#define MCF_SDRAMC_SDCS_CSSZ_2MBYTE	(0x00000014) +#define MCF_SDRAMC_SDCS_CSSZ_4MBYTE	(0x00000015) +#define MCF_SDRAMC_SDCS_CSSZ_8MBYTE	(0x00000016) +#define MCF_SDRAMC_SDCS_CSSZ_16MBYTE	(0x00000017) +#define MCF_SDRAMC_SDCS_CSSZ_32MBYTE	(0x00000018) +#define MCF_SDRAMC_SDCS_CSSZ_64MBYTE	(0x00000019) +#define MCF_SDRAMC_SDCS_CSSZ_128MBYTE	(0x0000001A) +#define MCF_SDRAMC_SDCS_CSSZ_256MBYTE	(0x0000001B) +#define MCF_SDRAMC_SDCS_CSSZ_512MBYTE	(0x0000001C) +#define MCF_SDRAMC_SDCS_CSSZ_1GBYTE	(0x0000001D) +#define MCF_SDRAMC_SDCS_CSSZ_2GBYTE	(0x0000001E) +#define MCF_SDRAMC_SDCS_CSSZ_4GBYTE	(0x0000001F) + +/* + * Edge Port Module (EPORT) + */ +#define MCFEPORT_EPPAR                (0xFC094000) +#define MCFEPORT_EPDDR                (0xFC094002) +#define MCFEPORT_EPIER                (0xFC094003) +#define MCFEPORT_EPDR                 (0xFC094004) +#define MCFEPORT_EPPDR                (0xFC094005) +#define MCFEPORT_EPFR                 (0xFC094006) + +/********************************************************************/ +#endif	/* m53xxsim_h */ diff --git a/arch/m68k/include/asm/m5407sim.h b/arch/m68k/include/asm/m5407sim.h index c399abbf953..a7550bc5cd1 100644 --- a/arch/m68k/include/asm/m5407sim.h +++ b/arch/m68k/include/asm/m5407sim.h @@ -14,74 +14,97 @@  #define	m5407sim_h  /****************************************************************************/ +#define	CPU_NAME		"COLDFIRE(m5407)" +#define	CPU_INSTR_PER_JIFFY	3 +#define	MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m54xxacr.h> +  /*   *	Define the 5407 SIM register set addresses.   */ -#define	MCFSIM_RSR		0x00		/* Reset Status reg (r/w) */ -#define	MCFSIM_SYPCR		0x01		/* System Protection reg (r/w)*/ -#define	MCFSIM_SWIVR		0x02		/* SW Watchdog intr reg (r/w) */ -#define	MCFSIM_SWSR		0x03		/* SW Watchdog service (r/w) */ -#define	MCFSIM_PAR		0x04		/* Pin Assignment reg (r/w) */ -#define	MCFSIM_IRQPAR		0x06		/* Interrupt Assignment reg (r/w) */ -#define	MCFSIM_PLLCR		0x08		/* PLL Controll Reg*/ -#define	MCFSIM_MPARK		0x0C		/* BUS Master Control Reg*/ -#define	MCFSIM_IPR		0x40		/* Interrupt Pend reg (r/w) */ -#define	MCFSIM_IMR		0x44		/* Interrupt Mask reg (r/w) */ -#define	MCFSIM_AVR		0x4b		/* Autovector Ctrl reg (r/w) */ -#define	MCFSIM_ICR0		0x4c		/* Intr Ctrl reg 0 (r/w) */ -#define	MCFSIM_ICR1		0x4d		/* Intr Ctrl reg 1 (r/w) */ -#define	MCFSIM_ICR2		0x4e		/* Intr Ctrl reg 2 (r/w) */ -#define	MCFSIM_ICR3		0x4f		/* Intr Ctrl reg 3 (r/w) */ -#define	MCFSIM_ICR4		0x50		/* Intr Ctrl reg 4 (r/w) */ -#define	MCFSIM_ICR5		0x51		/* Intr Ctrl reg 5 (r/w) */ -#define	MCFSIM_ICR6		0x52		/* Intr Ctrl reg 6 (r/w) */ -#define	MCFSIM_ICR7		0x53		/* Intr Ctrl reg 7 (r/w) */ -#define	MCFSIM_ICR8		0x54		/* Intr Ctrl reg 8 (r/w) */ -#define	MCFSIM_ICR9		0x55		/* Intr Ctrl reg 9 (r/w) */ -#define	MCFSIM_ICR10		0x56		/* Intr Ctrl reg 10 (r/w) */ -#define	MCFSIM_ICR11		0x57		/* Intr Ctrl reg 11 (r/w) */ - -#define MCFSIM_CSAR0		0x80		/* CS 0 Address 0 reg (r/w) */ -#define MCFSIM_CSMR0		0x84		/* CS 0 Mask 0 reg (r/w) */ -#define MCFSIM_CSCR0		0x8a		/* CS 0 Control reg (r/w) */ -#define MCFSIM_CSAR1		0x8c		/* CS 1 Address reg (r/w) */ -#define MCFSIM_CSMR1		0x90		/* CS 1 Mask reg (r/w) */ -#define MCFSIM_CSCR1		0x96		/* CS 1 Control reg (r/w) */ - -#define MCFSIM_CSAR2		0x98		/* CS 2 Address reg (r/w) */ -#define MCFSIM_CSMR2		0x9c		/* CS 2 Mask reg (r/w) */ -#define MCFSIM_CSCR2		0xa2		/* CS 2 Control reg (r/w) */ -#define MCFSIM_CSAR3		0xa4		/* CS 3 Address reg (r/w) */ -#define MCFSIM_CSMR3		0xa8		/* CS 3 Mask reg (r/w) */ -#define MCFSIM_CSCR3		0xae		/* CS 3 Control reg (r/w) */ -#define MCFSIM_CSAR4		0xb0		/* CS 4 Address reg (r/w) */ -#define MCFSIM_CSMR4		0xb4		/* CS 4 Mask reg (r/w) */ -#define MCFSIM_CSCR4		0xba		/* CS 4 Control reg (r/w) */ -#define MCFSIM_CSAR5		0xbc		/* CS 5 Address reg (r/w) */ -#define MCFSIM_CSMR5		0xc0		/* CS 5 Mask reg (r/w) */ -#define MCFSIM_CSCR5		0xc6		/* CS 5 Control reg (r/w) */ -#define MCFSIM_CSAR6		0xc8		/* CS 6 Address reg (r/w) */ -#define MCFSIM_CSMR6		0xcc		/* CS 6 Mask reg (r/w) */ -#define MCFSIM_CSCR6		0xd2		/* CS 6 Control reg (r/w) */ -#define MCFSIM_CSAR7		0xd4		/* CS 7 Address reg (r/w) */ -#define MCFSIM_CSMR7		0xd8		/* CS 7 Mask reg (r/w) */ -#define MCFSIM_CSCR7		0xde		/* CS 7 Control reg (r/w) */ - -#define MCFSIM_DCR		0x100		/* DRAM Control reg (r/w) */ -#define MCFSIM_DACR0		0x108		/* DRAM 0 Addr and Ctrl (r/w) */ -#define MCFSIM_DMR0		0x10c		/* DRAM 0 Mask reg (r/w) */ -#define MCFSIM_DACR1		0x110		/* DRAM 1 Addr and Ctrl (r/w) */ -#define MCFSIM_DMR1		0x114		/* DRAM 1 Mask reg (r/w) */ +#define	MCFSIM_RSR		(MCF_MBAR + 0x00)	/* Reset Status */ +#define	MCFSIM_SYPCR		(MCF_MBAR + 0x01)	/* System Protection */ +#define	MCFSIM_SWIVR		(MCF_MBAR + 0x02)	/* SW Watchdog intr */ +#define	MCFSIM_SWSR		(MCF_MBAR + 0x03)	/* SW Watchdog service*/ +#define	MCFSIM_PAR		(MCF_MBAR + 0x04)	/* Pin Assignment */ +#define	MCFSIM_IRQPAR		(MCF_MBAR + 0x06)	/* Intr Assignment */ +#define	MCFSIM_PLLCR		(MCF_MBAR + 0x08)	/* PLL Ctrl */ +#define	MCFSIM_MPARK		(MCF_MBAR + 0x0C)	/* BUS Master Ctrl */ +#define	MCFSIM_IPR		(MCF_MBAR + 0x40)	/* Interrupt Pending */ +#define	MCFSIM_IMR		(MCF_MBAR + 0x44)	/* Interrupt Mask */ +#define	MCFSIM_AVR		(MCF_MBAR + 0x4b)	/* Autovector Ctrl */ +#define	MCFSIM_ICR0		(MCF_MBAR + 0x4c)	/* Intr Ctrl reg 0 */ +#define	MCFSIM_ICR1		(MCF_MBAR + 0x4d)	/* Intr Ctrl reg 1 */ +#define	MCFSIM_ICR2		(MCF_MBAR + 0x4e)	/* Intr Ctrl reg 2 */ +#define	MCFSIM_ICR3		(MCF_MBAR + 0x4f)	/* Intr Ctrl reg 3 */ +#define	MCFSIM_ICR4		(MCF_MBAR + 0x50)	/* Intr Ctrl reg 4 */ +#define	MCFSIM_ICR5		(MCF_MBAR + 0x51)	/* Intr Ctrl reg 5 */ +#define	MCFSIM_ICR6		(MCF_MBAR + 0x52)	/* Intr Ctrl reg 6 */ +#define	MCFSIM_ICR7		(MCF_MBAR + 0x53)	/* Intr Ctrl reg 7 */ +#define	MCFSIM_ICR8		(MCF_MBAR + 0x54)	/* Intr Ctrl reg 8 */ +#define	MCFSIM_ICR9		(MCF_MBAR + 0x55)	/* Intr Ctrl reg 9 */ +#define	MCFSIM_ICR10		(MCF_MBAR + 0x56)	/* Intr Ctrl reg 10 */ +#define	MCFSIM_ICR11		(MCF_MBAR + 0x57)	/* Intr Ctrl reg 11 */ + +#define MCFSIM_CSAR0		(MCF_MBAR + 0x80)	/* CS 0 Address reg */ +#define MCFSIM_CSMR0		(MCF_MBAR + 0x84)	/* CS 0 Mask reg */ +#define MCFSIM_CSCR0		(MCF_MBAR + 0x8a)	/* CS 0 Control reg */ +#define MCFSIM_CSAR1		(MCF_MBAR + 0x8c)	/* CS 1 Address reg */ +#define MCFSIM_CSMR1		(MCF_MBAR + 0x90)	/* CS 1 Mask reg */ +#define MCFSIM_CSCR1		(MCF_MBAR + 0x96)	/* CS 1 Control reg */ + +#define MCFSIM_CSAR2		(MCF_MBAR + 0x98)	/* CS 2 Address reg */ +#define MCFSIM_CSMR2		(MCF_MBAR + 0x9c)	/* CS 2 Mask reg */ +#define MCFSIM_CSCR2		(MCF_MBAR + 0xa2)	/* CS 2 Control reg */ +#define MCFSIM_CSAR3		(MCF_MBAR + 0xa4)	/* CS 3 Address reg */ +#define MCFSIM_CSMR3		(MCF_MBAR + 0xa8)	/* CS 3 Mask reg */ +#define MCFSIM_CSCR3		(MCF_MBAR + 0xae)	/* CS 3 Control reg */ +#define MCFSIM_CSAR4		(MCF_MBAR + 0xb0)	/* CS 4 Address reg */ +#define MCFSIM_CSMR4		(MCF_MBAR + 0xb4)	/* CS 4 Mask reg */ +#define MCFSIM_CSCR4		(MCF_MBAR + 0xba)	/* CS 4 Control reg */ +#define MCFSIM_CSAR5		(MCF_MBAR + 0xbc)	/* CS 5 Address reg */ +#define MCFSIM_CSMR5		(MCF_MBAR + 0xc0)	/* CS 5 Mask reg */ +#define MCFSIM_CSCR5		(MCF_MBAR + 0xc6)	/* CS 5 Control reg */ +#define MCFSIM_CSAR6		(MCF_MBAR + 0xc8)	/* CS 6 Address reg */ +#define MCFSIM_CSMR6		(MCF_MBAR + 0xcc)	/* CS 6 Mask reg */ +#define MCFSIM_CSCR6		(MCF_MBAR + 0xd2)	/* CS 6 Control reg */ +#define MCFSIM_CSAR7		(MCF_MBAR + 0xd4)	/* CS 7 Address reg */ +#define MCFSIM_CSMR7		(MCF_MBAR + 0xd8)	/* CS 7 Mask reg */ +#define MCFSIM_CSCR7		(MCF_MBAR + 0xde)	/* CS 7 Control reg */ + +#define MCFSIM_DCR		(MCF_MBAR + 0x100)	/* DRAM Control */ +#define MCFSIM_DACR0		(MCF_MBAR + 0x108)	/* DRAM 0 Addr/Ctrl */ +#define MCFSIM_DMR0		(MCF_MBAR + 0x10c)	/* DRAM 0 Mask */ +#define MCFSIM_DACR1		(MCF_MBAR + 0x110)	/* DRAM 1 Addr/Ctrl */ +#define MCFSIM_DMR1		(MCF_MBAR + 0x114)	/* DRAM 1 Mask */ + +/* + *	Timer module. + */ +#define MCFTIMER_BASE1		(MCF_MBAR + 0x140)	/* Base of TIMER1 */ +#define MCFTIMER_BASE2		(MCF_MBAR + 0x180)	/* Base of TIMER2 */ + +#define MCFUART_BASE0		(MCF_MBAR + 0x1c0)	/* Base address UART0 */ +#define MCFUART_BASE1		(MCF_MBAR + 0x200)	/* Base address UART1 */  #define	MCFSIM_PADDR		(MCF_MBAR + 0x244)  #define	MCFSIM_PADAT		(MCF_MBAR + 0x248)  /* + *	DMA unit base addresses. + */ +#define MCFDMA_BASE0		(MCF_MBAR + 0x300)	/* Base address DMA 0 */ +#define MCFDMA_BASE1		(MCF_MBAR + 0x340)	/* Base address DMA 1 */ +#define MCFDMA_BASE2		(MCF_MBAR + 0x380)	/* Base address DMA 2 */ +#define MCFDMA_BASE3		(MCF_MBAR + 0x3C0)	/* Base address DMA 3 */ + +/*   * Generic GPIO support   */ -#define MCFGPIO_PIN_MAX			16 -#define MCFGPIO_IRQ_MAX			-1 -#define MCFGPIO_IRQ_VECBASE		-1 +#define MCFGPIO_PIN_MAX		16 +#define MCFGPIO_IRQ_MAX		-1 +#define MCFGPIO_IRQ_VECBASE	-1  /*   *	Some symbol defines for the above... @@ -107,49 +130,17 @@  /*   *       Defines for the IRQPAR Register   */ -#define IRQ5_LEVEL4	0x80 -#define IRQ3_LEVEL6	0x40 -#define IRQ1_LEVEL2	0x20 +#define IRQ5_LEVEL4		0x80 +#define IRQ3_LEVEL6		0x40 +#define IRQ1_LEVEL2		0x20  /*   *	Define system peripheral IRQ usage.   */  #define	MCF_IRQ_TIMER		30		/* Timer0, Level 6 */  #define	MCF_IRQ_PROFILER	31		/* Timer1, Level 7 */ - -/* - *	Define the Cache register flags. - */ -#define	CACR_DEC		0x80000000	/* Enable data cache */ -#define	CACR_DWP		0x40000000	/* Data write protection */ -#define	CACR_DESB		0x20000000	/* Enable data store buffer */ -#define	CACR_DDPI		0x10000000	/* Disable CPUSHL */ -#define	CACR_DHCLK		0x08000000	/* Half data cache lock mode */ -#define	CACR_DDCM_WT		0x00000000	/* Write through cache*/ -#define	CACR_DDCM_CP		0x02000000	/* Copyback cache */ -#define	CACR_DDCM_P		0x04000000	/* No cache, precise */ -#define	CACR_DDCM_IMP		0x06000000	/* No cache, imprecise */ -#define	CACR_DCINVA		0x01000000	/* Invalidate data cache */ -#define	CACR_BEC		0x00080000	/* Enable branch cache */ -#define	CACR_BCINVA		0x00040000	/* Invalidate branch cache */ -#define	CACR_IEC		0x00008000	/* Enable instruction cache */ -#define	CACR_DNFB		0x00002000	/* Inhibited fill buffer */ -#define	CACR_IDPI		0x00001000	/* Disable CPUSHL */ -#define	CACR_IHLCK		0x00000800	/* Intruction cache half lock */ -#define	CACR_IDCM		0x00000400	/* Intruction cache inhibit */ -#define	CACR_ICINVA		0x00000100	/* Invalidate instr cache */ - -#define	ACR_BASE_POS		24		/* Address Base */ -#define	ACR_MASK_POS		16		/* Address Mask */ -#define	ACR_ENABLE		0x00008000	/* Enable address */ -#define	ACR_USER		0x00000000	/* User mode access only */ -#define	ACR_SUPER		0x00002000	/* Supervisor mode only */ -#define	ACR_ANY			0x00004000	/* Match any access mode */ -#define	ACR_CM_WT		0x00000000	/* Write through mode */ -#define	ACR_CM_CP		0x00000020	/* Copyback mode */ -#define	ACR_CM_OFF_PRE		0x00000040	/* No cache, precise */ -#define	ACR_CM_OFF_IMP		0x00000060	/* No cache, imprecise */ -#define	ACR_WPROTECT		0x00000004	/* Write protect */ +#define	MCF_IRQ_UART0		73		/* UART0 */ +#define	MCF_IRQ_UART1		74		/* UART1 */  /****************************************************************************/  #endif	/* m5407sim_h */ diff --git a/arch/m68k/include/asm/m5441xsim.h b/arch/m68k/include/asm/m5441xsim.h new file mode 100644 index 00000000000..cc798ab9524 --- /dev/null +++ b/arch/m68k/include/asm/m5441xsim.h @@ -0,0 +1,276 @@ +/* + *	m5441xsim.h -- Coldfire 5441x register definitions + * + *	(C) Copyright 2012, Steven King <sfking@fdwdc.com> +*/ + +#ifndef m5441xsim_h +#define m5441xsim_h + +#define CPU_NAME		"COLDFIRE(m5441x)" +#define CPU_INSTR_PER_JIFFY	2 +#define MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m54xxacr.h> + +/* + *  Reset Controller Module. + */ + +#define	MCF_RCR			0xec090000 +#define	MCF_RSR			0xec090001 + +#define	MCF_RCR_SWRESET		0x80		/* Software reset bit */ +#define	MCF_RCR_FRCSTOUT	0x40		/* Force external reset */ + +/* + *  Interrupt Controller Modules. + */ +/* the 5441x have 3 interrupt controllers, each control 64 interrupts */ +#define MCFINT_VECBASE		64 +#define MCFINT0_VECBASE		MCFINT_VECBASE +#define MCFINT1_VECBASE		(MCFINT0_VECBASE + 64) +#define MCFINT2_VECBASE		(MCFINT1_VECBASE + 64) + +/* interrupt controller 0 */ +#define MCFINTC0_SIMR		0xfc04801c +#define MCFINTC0_CIMR		0xfc04801d +#define	MCFINTC0_ICR0		0xfc048040 +/* interrupt controller 1 */ +#define MCFINTC1_SIMR		0xfc04c01c +#define MCFINTC1_CIMR		0xfc04c01d +#define	MCFINTC1_ICR0		0xfc04c040 +/* interrupt controller 2 */ +#define MCFINTC2_SIMR		0xfc05001c +#define MCFINTC2_CIMR		0xfc05001d +#define	MCFINTC2_ICR0		0xfc050040 + +/* on interrupt controller 0 */ +#define MCFINT0_EPORT0		1 +#define MCFINT0_UART0		26 +#define MCFINT0_UART1		27 +#define MCFINT0_UART2		28 +#define MCFINT0_UART3		29 +#define MCFINT0_I2C0		30 +#define MCFINT0_DSPI0		31 + +#define MCFINT0_TIMER0		32 +#define MCFINT0_TIMER1		33 +#define MCFINT0_TIMER2		34 +#define MCFINT0_TIMER3		35 + +#define MCFINT0_FECRX0		36 +#define MCFINT0_FECTX0		40 +#define MCFINT0_FECENTC0	42 + +#define MCFINT0_FECRX1		49 +#define MCFINT0_FECTX1		53 +#define MCFINT0_FECENTC1	55 + +/* on interrupt controller 1 */ +#define MCFINT1_UART4		48 +#define MCFINT1_UART5		49 +#define MCFINT1_UART6		50 +#define MCFINT1_UART7		51 +#define MCFINT1_UART8		52 +#define MCFINT1_UART9		53 +#define MCFINT1_DSPI1		54 +#define MCFINT1_DSPI2		55 +#define MCFINT1_DSPI3		56 +#define MCFINT1_I2C1		57 +#define MCFINT1_I2C2		58 +#define MCFINT1_I2C3		59 +#define MCFINT1_I2C4		60 +#define MCFINT1_I2C5		61 + +/* on interrupt controller 2 */ +#define MCFINT2_PIT0		13 +#define MCFINT2_PIT1		14 +#define MCFINT2_PIT2		15 +#define MCFINT2_PIT3		16 +#define MCFINT2_RTC		26 + +/* + *  PIT timer module. + */ +#define	MCFPIT_BASE0		0xFC080000	/* Base address of TIMER0 */ +#define	MCFPIT_BASE1		0xFC084000	/* Base address of TIMER1 */ +#define	MCFPIT_BASE2		0xFC088000	/* Base address of TIMER2 */ +#define	MCFPIT_BASE3		0xFC08C000	/* Base address of TIMER3 */ + + +#define MCF_IRQ_PIT1		(MCFINT2_VECBASE + MCFINT2_PIT1) + +/* + * Power Management + */ +#define MCFPM_WCR		0xfc040013 +#define MCFPM_PPMSR0		0xfc04002c +#define MCFPM_PPMCR0		0xfc04002d +#define MCFPM_PPMSR1		0xfc04002e +#define MCFPM_PPMCR1		0xfc04002f +#define MCFPM_PPMHR0		0xfc040030 +#define MCFPM_PPMLR0		0xfc040034 +#define MCFPM_PPMHR1		0xfc040038 +#define MCFPM_PPMLR1		0xfc04003c +#define MCFPM_LPCR		0xec090007 +/* + *  UART module. + */ +#define MCFUART_BASE0		0xfc060000	/* Base address of UART0 */ +#define MCFUART_BASE1		0xfc064000	/* Base address of UART1 */ +#define MCFUART_BASE2		0xfc068000	/* Base address of UART2 */ +#define MCFUART_BASE3		0xfc06c000	/* Base address of UART3 */ +#define MCFUART_BASE4		0xec060000	/* Base address of UART4 */ +#define MCFUART_BASE5		0xec064000	/* Base address of UART5 */ +#define MCFUART_BASE6		0xec068000	/* Base address of UART6 */ +#define MCFUART_BASE7		0xec06c000	/* Base address of UART7 */ +#define MCFUART_BASE8		0xec070000	/* Base address of UART8 */ +#define MCFUART_BASE9		0xec074000	/* Base address of UART9 */ + +#define MCF_IRQ_UART0		(MCFINT0_VECBASE + MCFINT0_UART0) +#define MCF_IRQ_UART1		(MCFINT0_VECBASE + MCFINT0_UART1) +#define MCF_IRQ_UART2		(MCFINT0_VECBASE + MCFINT0_UART2) +#define MCF_IRQ_UART3		(MCFINT0_VECBASE + MCFINT0_UART3) +#define MCF_IRQ_UART4		(MCFINT1_VECBASE + MCFINT1_UART4) +#define MCF_IRQ_UART5		(MCFINT1_VECBASE + MCFINT1_UART5) +#define MCF_IRQ_UART6		(MCFINT1_VECBASE + MCFINT1_UART6) +#define MCF_IRQ_UART7		(MCFINT1_VECBASE + MCFINT1_UART7) +#define MCF_IRQ_UART8		(MCFINT1_VECBASE + MCFINT1_UART8) +#define MCF_IRQ_UART9		(MCFINT1_VECBASE + MCFINT1_UART9) +/* + *  FEC modules. + */ +#define MCFFEC_BASE0		0xfc0d4000 +#define MCFFEC_SIZE0		0x800 +#define MCF_IRQ_FECRX0		(MCFINT0_VECBASE + MCFINT0_FECRX0) +#define MCF_IRQ_FECTX0		(MCFINT0_VECBASE + MCFINT0_FECTX0) +#define MCF_IRQ_FECENTC0	(MCFINT0_VECBASE + MCFINT0_FECENTC0) + +#define MCFFEC_BASE1		0xfc0d8000 +#define MCFFEC_SIZE1		0x800 +#define MCF_IRQ_FECRX1		(MCFINT0_VECBASE + MCFINT0_FECRX1) +#define MCF_IRQ_FECTX1		(MCFINT0_VECBASE + MCFINT0_FECTX1) +#define MCF_IRQ_FECENTC1	(MCFINT0_VECBASE + MCFINT0_FECENTC1) +/* + *  I2C modules. + */ +#define MCFI2C_BASE0		0xfc058000 +#define MCFI2C_SIZE0		0x20 +#define MCFI2C_BASE1		0xfc038000 +#define MCFI2C_SIZE1		0x20 +#define MCFI2C_BASE2		0xec010000 +#define MCFI2C_SIZE2		0x20 +#define MCFI2C_BASE3		0xec014000 +#define MCFI2C_SIZE3		0x20 +#define MCFI2C_BASE4		0xec018000 +#define MCFI2C_SIZE4		0x20 +#define MCFI2C_BASE5		0xec01c000 +#define MCFI2C_SIZE5		0x20 + +#define MCF_IRQ_I2C0		(MCFINT0_VECBASE + MCFINT0_I2C0) +#define MCF_IRQ_I2C1		(MCFINT1_VECBASE + MCFINT1_I2C1) +#define MCF_IRQ_I2C2		(MCFINT1_VECBASE + MCFINT1_I2C2) +#define MCF_IRQ_I2C3		(MCFINT1_VECBASE + MCFINT1_I2C3) +#define MCF_IRQ_I2C4		(MCFINT1_VECBASE + MCFINT1_I2C4) +#define MCF_IRQ_I2C5		(MCFINT1_VECBASE + MCFINT1_I2C5) +/* + *  EPORT Module. + */ +#define MCFEPORT_EPPAR		0xfc090000 +#define MCFEPORT_EPIER		0xfc090003 +#define MCFEPORT_EPFR		0xfc090006 +/* + *  RTC Module. + */ +#define MCFRTC_BASE		0xfc0a8000 +#define MCFRTC_SIZE		(0xfc0a8840 - 0xfc0a8000) +#define MCF_IRQ_RTC		(MCFINT2_VECBASE + MCFINT2_RTC) + +/* + *  GPIO Module. + */ +#define MCFGPIO_PODR_A		0xec094000 +#define MCFGPIO_PODR_B		0xec094001 +#define MCFGPIO_PODR_C		0xec094002 +#define MCFGPIO_PODR_D		0xec094003 +#define MCFGPIO_PODR_E		0xec094004 +#define MCFGPIO_PODR_F		0xec094005 +#define MCFGPIO_PODR_G		0xec094006 +#define MCFGPIO_PODR_H		0xec094007 +#define MCFGPIO_PODR_I		0xec094008 +#define MCFGPIO_PODR_J		0xec094009 +#define MCFGPIO_PODR_K		0xec09400a + +#define MCFGPIO_PDDR_A		0xec09400c +#define MCFGPIO_PDDR_B		0xec09400d +#define MCFGPIO_PDDR_C		0xec09400e +#define MCFGPIO_PDDR_D		0xec09400f +#define MCFGPIO_PDDR_E		0xec094010 +#define MCFGPIO_PDDR_F		0xec094011 +#define MCFGPIO_PDDR_G		0xec094012 +#define MCFGPIO_PDDR_H		0xec094013 +#define MCFGPIO_PDDR_I		0xec094014 +#define MCFGPIO_PDDR_J		0xec094015 +#define MCFGPIO_PDDR_K		0xec094016 + +#define MCFGPIO_PPDSDR_A	0xec094018 +#define MCFGPIO_PPDSDR_B	0xec094019 +#define MCFGPIO_PPDSDR_C	0xec09401a +#define MCFGPIO_PPDSDR_D	0xec09401b +#define MCFGPIO_PPDSDR_E	0xec09401c +#define MCFGPIO_PPDSDR_F	0xec09401d +#define MCFGPIO_PPDSDR_G	0xec09401e +#define MCFGPIO_PPDSDR_H	0xec09401f +#define MCFGPIO_PPDSDR_I	0xec094020 +#define MCFGPIO_PPDSDR_J	0xec094021 +#define MCFGPIO_PPDSDR_K	0xec094022 + +#define MCFGPIO_PCLRR_A		0xec094024 +#define MCFGPIO_PCLRR_B		0xec094025 +#define MCFGPIO_PCLRR_C		0xec094026 +#define MCFGPIO_PCLRR_D		0xec094027 +#define MCFGPIO_PCLRR_E		0xec094028 +#define MCFGPIO_PCLRR_F		0xec094029 +#define MCFGPIO_PCLRR_G		0xec09402a +#define MCFGPIO_PCLRR_H		0xec09402b +#define MCFGPIO_PCLRR_I		0xec09402c +#define MCFGPIO_PCLRR_J		0xec09402d +#define MCFGPIO_PCLRR_K		0xec09402e + +#define MCFGPIO_PAR_FBCTL	0xec094048 +#define MCFGPIO_PAR_BE		0xec094049 +#define MCFGPIO_PAR_CS		0xec09404a +#define MCFGPIO_PAR_CANI2C	0xec09404b +#define MCFGPIO_PAR_IRQ0H	0xec09404c +#define MCFGPIO_PAR_IRQ0L	0xec09404d +#define MCFGPIO_PAR_DSPIOWH	0xec09404e +#define MCFGPIO_PAR_DSPIOWL	0xec09404f +#define MCFGPIO_PAR_TIMER	0xec094050 +#define MCFGPIO_PAR_UART2	0xec094051 +#define MCFGPIO_PAR_UART1	0xec094052 +#define MCFGPIO_PAR_UART0	0xec094053 +#define MCFGPIO_PAR_SDHCH	0xec094054 +#define MCFGPIO_PAR_SDHCL	0xec094055 +#define MCFGPIO_PAR_SIMP0H	0xec094056 +#define MCFGPIO_PAR_SIMP0L	0xec094057 +#define MCFGPIO_PAR_SSI0H	0xec094058 +#define MCFGPIO_PAR_SSI0L	0xec094059 +#define MCFGPIO_PAR_DEBUGH1	0xec09405a +#define MCFGPIO_PAR_DEBUGH0	0xec09405b +#define MCFGPIO_PAR_DEBUGl	0xec09405c +#define MCFGPIO_PAR_FEC		0xec09405e + +/* generalization for generic gpio support */ +#define MCFGPIO_PODR		MCFGPIO_PODR_A +#define MCFGPIO_PDDR		MCFGPIO_PDDR_A +#define MCFGPIO_PPDR		MCFGPIO_PPDSDR_A +#define MCFGPIO_SETR		MCFGPIO_PPDSDR_A +#define MCFGPIO_CLRR		MCFGPIO_PCLRR_A + +#define MCFGPIO_IRQ_MIN		17 +#define MCFGPIO_IRQ_MAX		24 +#define MCFGPIO_IRQ_VECBASE	(MCFINT_VECBASE - MCFGPIO_IRQ_MIN) +#define MCFGPIO_PIN_MAX		87 + +#endif /* m5441xsim_h */ diff --git a/arch/m68k/include/asm/m548xsim.h b/arch/m68k/include/asm/m548xsim.h deleted file mode 100644 index 149135ef30d..00000000000 --- a/arch/m68k/include/asm/m548xsim.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - *	m548xsim.h -- ColdFire 547x/548x System Integration Unit support. - */ - -#ifndef	m548xsim_h -#define m548xsim_h - -#define MCFINT_VECBASE      64 - -/* - *      Interrupt Controller Registers - */ -#define MCFICM_INTC0		0x0700		/* Base for Interrupt Ctrl 0 */ -#define MCFINTC_IPRH		0x00		/* Interrupt pending 32-63 */ -#define MCFINTC_IPRL		0x04		/* Interrupt pending 1-31 */ -#define MCFINTC_IMRH		0x08		/* Interrupt mask 32-63 */ -#define MCFINTC_IMRL		0x0c		/* Interrupt mask 1-31 */ -#define MCFINTC_INTFRCH		0x10		/* Interrupt force 32-63 */ -#define MCFINTC_INTFRCL		0x14		/* Interrupt force 1-31 */ -#define MCFINTC_IRLR		0x18		/* */ -#define MCFINTC_IACKL		0x19		/* */ -#define MCFINTC_ICR0		0x40		/* Base ICR register */ - -/* - *	Define system peripheral IRQ usage. - */ -#define MCF_IRQ_TIMER		(64 + 54)	/* Slice Timer 0 */ -#define MCF_IRQ_PROFILER	(64 + 53)	/* Slice Timer 1 */ - -/* - *	Generic GPIO support - */ -#define MCFGPIO_PIN_MAX		0	/* I am too lazy to count */ -#define MCFGPIO_IRQ_MAX		-1 -#define MCFGPIO_IRQ_VECBASE	-1 - -/* - *	Some PSC related definitions - */ -#define MCF_PAR_PSC(x)		(0x000A4F-((x)&0x3)) -#define MCF_PAR_SDA		(0x0008) -#define MCF_PAR_SCL		(0x0004) -#define MCF_PAR_PSC_TXD		(0x04) -#define MCF_PAR_PSC_RXD		(0x08) -#define MCF_PAR_PSC_RTS(x)	(((x)&0x03)<<4) -#define MCF_PAR_PSC_CTS(x)	(((x)&0x03)<<6) -#define MCF_PAR_PSC_CTS_GPIO	(0x00) -#define MCF_PAR_PSC_CTS_BCLK	(0x80) -#define MCF_PAR_PSC_CTS_CTS	(0xC0) -#define MCF_PAR_PSC_RTS_GPIO    (0x00) -#define MCF_PAR_PSC_RTS_FSYNC	(0x20) -#define MCF_PAR_PSC_RTS_RTS	(0x30) -#define MCF_PAR_PSC_CANRX	(0x40) - -#endif	/* m548xsim_h */ diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h new file mode 100644 index 00000000000..6d13cae44af --- /dev/null +++ b/arch/m68k/include/asm/m54xxacr.h @@ -0,0 +1,136 @@ +/* + * Bit definitions for the MCF54xx ACR and CACR registers. + */ + +#ifndef	m54xxacr_h +#define m54xxacr_h + +/* + *	Define the Cache register flags. + */ +#define CACR_DEC	0x80000000	/* Enable data cache */ +#define CACR_DWP	0x40000000	/* Data write protection */ +#define CACR_DESB	0x20000000	/* Enable data store buffer */ +#define CACR_DDPI	0x10000000	/* Disable invalidation by CPUSHL */ +#define CACR_DHCLK	0x08000000	/* Half data cache lock mode */ +#define CACR_DDCM_WT	0x00000000	/* Write through cache*/ +#define CACR_DDCM_CP	0x02000000	/* Copyback cache */ +#define CACR_DDCM_P	0x04000000	/* No cache, precise */ +#define CACR_DDCM_IMP	0x06000000	/* No cache, imprecise */ +#define CACR_DCINVA	0x01000000	/* Invalidate data cache */ +#define CACR_BEC	0x00080000	/* Enable branch cache */ +#define CACR_BCINVA	0x00040000	/* Invalidate branch cache */ +#define CACR_IEC	0x00008000	/* Enable instruction cache */ +#define CACR_DNFB	0x00002000	/* Inhibited fill buffer */ +#define CACR_IDPI	0x00001000	/* Disable CPUSHL */ +#define CACR_IHLCK	0x00000800	/* Intruction cache half lock */ +#define CACR_IDCM	0x00000400	/* Intruction cache inhibit */ +#define CACR_ICINVA	0x00000100	/* Invalidate instr cache */ +#define CACR_EUSP	0x00000020	/* Enable separate user a7 */ + +#define ACR_BASE_POS	24		/* Address Base */ +#define ACR_MASK_POS	16		/* Address Mask */ +#define ACR_ENABLE	0x00008000	/* Enable address */ +#define ACR_USER	0x00000000	/* User mode access only */ +#define ACR_SUPER	0x00002000	/* Supervisor mode only */ +#define ACR_ANY		0x00004000	/* Match any access mode */ +#define ACR_CM_WT	0x00000000	/* Write through mode */ +#define ACR_CM_CP	0x00000020	/* Copyback mode */ +#define ACR_CM_OFF_PRE	0x00000040	/* No cache, precise */ +#define ACR_CM_OFF_IMP	0x00000060	/* No cache, imprecise */ +#define ACR_CM		0x00000060	/* Cache mode mask */ +#define ACR_SP		0x00000008	/* Supervisor protect */ +#define ACR_WPROTECT	0x00000004	/* Write protect */ + +#define ACR_BA(x)	((x) & 0xff000000) +#define ACR_ADMSK(x)	((((x) - 1) & 0xff000000) >> 8) + +#if defined(CONFIG_M5407) + +#define ICACHE_SIZE 0x4000	/* instruction - 16k */ +#define DCACHE_SIZE 0x2000	/* data - 8k */ + +#elif defined(CONFIG_M54xx) + +#define ICACHE_SIZE 0x8000	/* instruction - 32k */ +#define DCACHE_SIZE 0x8000	/* data - 32k */ + +#elif defined(CONFIG_M5441x) + +#define ICACHE_SIZE 0x2000	/* instruction - 8k */ +#define DCACHE_SIZE 0x2000	/* data - 8k */ +#endif + +#define CACHE_LINE_SIZE 0x0010	/* 16 bytes */ +#define CACHE_WAYS 4		/* 4 ways */ + +#define ICACHE_SET_MASK	((ICACHE_SIZE / 64 - 1) << CACHE_WAYS) +#define DCACHE_SET_MASK	((DCACHE_SIZE / 64 - 1) << CACHE_WAYS) +#define ICACHE_MAX_ADDR	ICACHE_SET_MASK +#define DCACHE_MAX_ADDR	DCACHE_SET_MASK + +/* + *	Version 4 cores have a true harvard style separate instruction + *	and data cache. Enable data and instruction caches, also enable write + *	buffers and branch accelerator. + */ +/* attention : enabling CACR_DESB requires a "nop" to flush the store buffer */ +/* use '+' instead of '|' for assembler's sake */ + +	/* Enable data cache */ +	/* Enable data store buffer */ +	/* outside ACRs : No cache, precise */ +	/* Enable instruction+branch caches */ +#if defined(CONFIG_M5407) +#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC) +#else +#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC+CACR_EUSP) +#endif +#define CACHE_INIT (CACR_DCINVA+CACR_BCINVA+CACR_ICINVA) + +#if defined(CONFIG_MMU) +/* + *	If running with the MMU enabled then we need to map the internal + *	register region as non-cacheable. And then we map all our RAM as + *	cacheable and supervisor access only. + */ +#define ACR0_MODE	(ACR_BA(CONFIG_MBAR)+ACR_ADMSK(0x1000000)+ \ +			 ACR_ENABLE+ACR_SUPER+ACR_CM_OFF_PRE+ACR_SP) +#if defined(CONFIG_CACHE_COPYBACK) +#define ACR1_MODE	(ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \ +			 ACR_ENABLE+ACR_SUPER+ACR_SP+ACR_CM_CP) +#else +#define ACR1_MODE	(ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \ +			 ACR_ENABLE+ACR_SUPER+ACR_SP+ACR_CM_WT) +#endif +#define ACR2_MODE	0 +#define ACR3_MODE	(ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \ +			 ACR_ENABLE+ACR_SUPER+ACR_SP) + +#else + +/* + *	For the non-MMU enabled case we map all of RAM as cacheable. + */ +#if defined(CONFIG_CACHE_COPYBACK) +#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_CP) +#else +#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_WT) +#endif +#define INSN_CACHE_MODE (ACR_ENABLE+ACR_ANY) + +#define CACHE_INVALIDATE  (CACHE_MODE+CACR_DCINVA+CACR_BCINVA+CACR_ICINVA) +#define CACHE_INVALIDATEI (CACHE_MODE+CACR_BCINVA+CACR_ICINVA) +#define CACHE_INVALIDATED (CACHE_MODE+CACR_DCINVA) +#define ACR0_MODE	(0x000f0000+DATA_CACHE_MODE) +#define ACR1_MODE	0 +#define ACR2_MODE	(0x000f0000+INSN_CACHE_MODE) +#define ACR3_MODE	0 + +#if ((DATA_CACHE_MODE & ACR_CM) == ACR_CM_CP) +/* Copyback cache mode must push dirty cache lines first */ +#define	CACHE_PUSH +#endif + +#endif /* CONFIG_MMU */ +#endif	/* m54xxacr_h */ diff --git a/arch/m68k/include/asm/m548xgpt.h b/arch/m68k/include/asm/m54xxgpt.h index c8ef158a1c4..0b69cd1ed0e 100644 --- a/arch/m68k/include/asm/m548xgpt.h +++ b/arch/m68k/include/asm/m54xxgpt.h @@ -1,13 +1,13 @@  /* - * File:	m548xgpt.h - * Purpose:	Register and bit definitions for the MCF548X + * File:	m54xxgpt.h + * Purpose:	Register and bit definitions for the MCF54XX   *   * Notes:   *   */ -#ifndef m548xgpt_h -#define m548xgpt_h +#ifndef m54xxgpt_h +#define m54xxgpt_h  /*********************************************************************  * @@ -16,26 +16,26 @@  *********************************************************************/  /* Register read/write macros */ -#define MCF_GPT_GMS0       0x000800 -#define MCF_GPT_GCIR0      0x000804 -#define MCF_GPT_GPWM0      0x000808 -#define MCF_GPT_GSR0       0x00080C -#define MCF_GPT_GMS1       0x000810 -#define MCF_GPT_GCIR1      0x000814 -#define MCF_GPT_GPWM1      0x000818 -#define MCF_GPT_GSR1       0x00081C -#define MCF_GPT_GMS2       0x000820 -#define MCF_GPT_GCIR2      0x000824 -#define MCF_GPT_GPWM2      0x000828 -#define MCF_GPT_GSR2       0x00082C -#define MCF_GPT_GMS3       0x000830 -#define MCF_GPT_GCIR3      0x000834 -#define MCF_GPT_GPWM3      0x000838 -#define MCF_GPT_GSR3       0x00083C -#define MCF_GPT_GMS(x)     (0x000800+((x)*0x010)) -#define MCF_GPT_GCIR(x)    (0x000804+((x)*0x010)) -#define MCF_GPT_GPWM(x)    (0x000808+((x)*0x010)) -#define MCF_GPT_GSR(x)     (0x00080C+((x)*0x010)) +#define MCF_GPT_GMS0       (MCF_MBAR + 0x000800) +#define MCF_GPT_GCIR0      (MCF_MBAR + 0x000804) +#define MCF_GPT_GPWM0      (MCF_MBAR + 0x000808) +#define MCF_GPT_GSR0       (MCF_MBAR + 0x00080C) +#define MCF_GPT_GMS1       (MCF_MBAR + 0x000810) +#define MCF_GPT_GCIR1      (MCF_MBAR + 0x000814) +#define MCF_GPT_GPWM1      (MCF_MBAR + 0x000818) +#define MCF_GPT_GSR1       (MCF_MBAR + 0x00081C) +#define MCF_GPT_GMS2       (MCF_MBAR + 0x000820) +#define MCF_GPT_GCIR2      (MCF_MBAR + 0x000824) +#define MCF_GPT_GPWM2      (MCF_MBAR + 0x000828) +#define MCF_GPT_GSR2       (MCF_MBAR + 0x00082C) +#define MCF_GPT_GMS3       (MCF_MBAR + 0x000830) +#define MCF_GPT_GCIR3      (MCF_MBAR + 0x000834) +#define MCF_GPT_GPWM3      (MCF_MBAR + 0x000838) +#define MCF_GPT_GSR3       (MCF_MBAR + 0x00083C) +#define MCF_GPT_GMS(x)     (MCF_MBAR + 0x000800 + ((x) * 0x010)) +#define MCF_GPT_GCIR(x)    (MCF_MBAR + 0x000804 + ((x) * 0x010)) +#define MCF_GPT_GPWM(x)    (MCF_MBAR + 0x000808 + ((x) * 0x010)) +#define MCF_GPT_GSR(x)     (MCF_MBAR + 0x00080C + ((x) * 0x010))  /* Bit definitions and macros for MCF_GPT_GMS */  #define MCF_GPT_GMS_TMS(x)         (((x)&0x00000007)<<0) @@ -59,11 +59,13 @@  #define MCF_GPT_GMS_GPIO_INPUT     (0x00000000)  #define MCF_GPT_GMS_GPIO_OUTLO     (0x00000020)  #define MCF_GPT_GMS_GPIO_OUTHI     (0x00000030) +#define MCF_GPT_GMS_GPIO_MASK      (0x00000030)  #define MCF_GPT_GMS_TMS_DISABLE    (0x00000000)  #define MCF_GPT_GMS_TMS_INCAPT     (0x00000001)  #define MCF_GPT_GMS_TMS_OUTCAPT    (0x00000002)  #define MCF_GPT_GMS_TMS_PWM        (0x00000003)  #define MCF_GPT_GMS_TMS_GPIO       (0x00000004) +#define MCF_GPT_GMS_TMS_MASK       (0x00000007)  /* Bit definitions and macros for MCF_GPT_GCIR */  #define MCF_GPT_GCIR_CNT(x)        (((x)&0x0000FFFF)<<0) @@ -85,4 +87,4 @@  /********************************************************************/ -#endif /* m548xgpt_h */ +#endif /* m54xxgpt_h */ diff --git a/arch/m68k/include/asm/m54xxpci.h b/arch/m68k/include/asm/m54xxpci.h new file mode 100644 index 00000000000..6fbf54f72f2 --- /dev/null +++ b/arch/m68k/include/asm/m54xxpci.h @@ -0,0 +1,138 @@ +/****************************************************************************/ + +/* + *	m54xxpci.h -- ColdFire 547x and 548x PCI bus support + * + *	(C) Copyright 2011,  Greg Ungerer <gerg@uclinux.org> + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file COPYING in the main directory of this archive + * for more details. + */ + +/****************************************************************************/ +#ifndef	M54XXPCI_H +#define	M54XXPCI_H +/****************************************************************************/ + +/* + *	The core set of PCI support registers are mapped into the MBAR region. + */ +#define	PCIIDR		(CONFIG_MBAR + 0xb00)	/* PCI device/vendor ID */ +#define	PCISCR		(CONFIG_MBAR + 0xb04)	/* PCI status/command */ +#define	PCICCRIR	(CONFIG_MBAR + 0xb08)	/* PCI class/revision */ +#define	PCICR1		(CONFIG_MBAR + 0xb0c)	/* PCI configuration 1 */ +#define	PCIBAR0		(CONFIG_MBAR + 0xb10)	/* PCI base address 0 */ +#define	PCIBAR1		(CONFIG_MBAR + 0xb14)	/* PCI base address 1 */ +#define	PCICCPR		(CONFIG_MBAR + 0xb28)	/* PCI cardbus CIS pointer */ +#define	PCISID		(CONFIG_MBAR + 0xb2c)	/* PCI subsystem IDs */ +#define	PCIERBAR	(CONFIG_MBAR + 0xb30)	/* PCI expansion ROM */ +#define	PCICPR		(CONFIG_MBAR + 0xb34)	/* PCI capabilities pointer */ +#define	PCICR2		(CONFIG_MBAR + 0xb3c)	/* PCI configuration 2 */ + +#define	PCIGSCR		(CONFIG_MBAR + 0xb60)	/* Global status/control */ +#define	PCITBATR0	(CONFIG_MBAR + 0xb64)	/* Target base translation 0 */ +#define	PCITBATR1	(CONFIG_MBAR + 0xb68)	/* Target base translation 1 */ +#define	PCITCR		(CONFIG_MBAR + 0xb6c)	/* Target control */ +#define	PCIIW0BTAR	(CONFIG_MBAR + 0xb70)	/* Initiator window 0 */ +#define	PCIIW1BTAR	(CONFIG_MBAR + 0xb74)	/* Initiator window 1 */ +#define	PCIIW2BTAR	(CONFIG_MBAR + 0xb78)	/* Initiator window 2 */ +#define	PCIIWCR		(CONFIG_MBAR + 0xb80)	/* Initiator window config */ +#define	PCIICR		(CONFIG_MBAR + 0xb84)	/* Initiator control */ +#define	PCIISR		(CONFIG_MBAR + 0xb88)	/* Initiator status */ +#define	PCICAR		(CONFIG_MBAR + 0xbf8)	/* Configuration address */ + +#define	PCITPSR		(CONFIG_MBAR + 0x8400)	/* TX packet size */ +#define	PCITSAR		(CONFIG_MBAR + 0x8404)	/* TX start address */ +#define	PCITTCR		(CONFIG_MBAR + 0x8408)	/* TX transaction control */ +#define	PCITER		(CONFIG_MBAR + 0x840c)	/* TX enables */ +#define	PCITNAR		(CONFIG_MBAR + 0x8410)	/* TX next address */ +#define	PCITLWR		(CONFIG_MBAR + 0x8414)	/* TX last word */ +#define	PCITDCR		(CONFIG_MBAR + 0x8418)	/* TX done counts */ +#define	PCITSR		(CONFIG_MBAR + 0x841c)	/* TX status */ +#define	PCITFDR		(CONFIG_MBAR + 0x8440)	/* TX FIFO data */ +#define	PCITFSR		(CONFIG_MBAR + 0x8444)	/* TX FIFO status */ +#define	PCITFCR		(CONFIG_MBAR + 0x8448)	/* TX FIFO control */ +#define	PCITFAR		(CONFIG_MBAR + 0x844c)	/* TX FIFO alarm */ +#define	PCITFRPR	(CONFIG_MBAR + 0x8450)	/* TX FIFO read pointer */ +#define	PCITFWPR	(CONFIG_MBAR + 0x8454)	/* TX FIFO write pointer */ + +#define	PCIRPSR		(CONFIG_MBAR + 0x8480)	/* RX packet size */ +#define	PCIRSAR		(CONFIG_MBAR + 0x8484)	/* RX start address */ +#define	PCIRTCR		(CONFIG_MBAR + 0x8488)	/* RX transaction control */ +#define	PCIRER		(CONFIG_MBAR + 0x848c)	/* RX enables */ +#define	PCIRNAR		(CONFIG_MBAR + 0x8490)	/* RX next address */ +#define	PCIRDCR		(CONFIG_MBAR + 0x8498)	/* RX done counts */ +#define	PCIRSR		(CONFIG_MBAR + 0x849c)	/* RX status */ +#define	PCIRFDR		(CONFIG_MBAR + 0x84c0)	/* RX FIFO data */ +#define	PCIRFSR		(CONFIG_MBAR + 0x84c4)	/* RX FIFO status */ +#define	PCIRFCR		(CONFIG_MBAR + 0x84c8)	/* RX FIFO control */ +#define	PCIRFAR		(CONFIG_MBAR + 0x84cc)	/* RX FIFO alarm */ +#define	PCIRFRPR	(CONFIG_MBAR + 0x84d0)	/* RX FIFO read pointer */ +#define	PCIRFWPR	(CONFIG_MBAR + 0x84d4)	/* RX FIFO write pointer */ + +#define	PACR		(CONFIG_MBAR + 0xc00)	/* PCI arbiter control */ +#define	PASR		(COFNIG_MBAR + 0xc04)	/* PCI arbiter status */ + +/* + *	Definitions for the Global status and control register. + */ +#define	PCIGSCR_PE	0x20000000		/* Parity error detected */ +#define	PCIGSCR_SE	0x10000000		/* System error detected */ +#define	PCIGSCR_XCLKBIN	0x07000000		/* XLB2CLKIN mask */ +#define	PCIGSCR_PEE	0x00002000		/* Parity error intr enable */ +#define	PCIGSCR_SEE	0x00001000		/* System error intr enable */ +#define	PCIGSCR_RESET	0x00000001		/* Reset bit */ + +/* + *	Bit definitions for the PCICAR configuration address register. + */ +#define	PCICAR_E	0x80000000		/* Enable config space */ +#define	PCICAR_BUSN	16			/* Move bus bits */ +#define	PCICAR_DEVFNN	8			/* Move devfn bits */ +#define	PCICAR_DWORDN	0			/* Move dword bits */ + +/* + *	The initiator windows hold the memory and IO mapping information. + *	This macro creates the register values from the desired addresses. + */ +#define	WXBTAR(hostaddr, pciaddr, size)	\ +			(((hostaddr) & 0xff000000) | \ +			((((size) - 1) & 0xff000000) >> 8) | \ +			(((pciaddr) & 0xff000000) >> 16)) + +#define	PCIIWCR_W0_MEM	0x00000000		/* Window 0 is memory */ +#define	PCIIWCR_W0_IO	0x08000000		/* Window 0 is IO */ +#define	PCIIWCR_W0_MRD	0x00000000		/* Window 0 memory read */ +#define	PCIIWCR_W0_MRDL	0x02000000		/* Window 0 memory read line */ +#define	PCIIWCR_W0_MRDM	0x04000000		/* Window 0 memory read mult */ +#define	PCIIWCR_W0_E	0x01000000		/* Window 0 enable */ + +#define	PCIIWCR_W1_MEM	0x00000000		/* Window 0 is memory */ +#define	PCIIWCR_W1_IO	0x00080000		/* Window 0 is IO */ +#define	PCIIWCR_W1_MRD	0x00000000		/* Window 0 memory read */ +#define	PCIIWCR_W1_MRDL	0x00020000		/* Window 0 memory read line */ +#define	PCIIWCR_W1_MRDM	0x00040000		/* Window 0 memory read mult */ +#define	PCIIWCR_W1_E	0x00010000		/* Window 0 enable */ + +/* + *	Bit definitions for the PCIBATR registers. + */ +#define	PCITBATR0_E	0x00000001		/* Enable window 0 */ +#define	PCITBATR1_E	0x00000001		/* Enable window 1 */ + +/* + *	PCI arbiter support definitions and macros. + */ +#define	PACR_INTMPRI	0x00000001 +#define	PACR_EXTMPRI(x)	(((x) & 0x1f) << 1) +#define	PACR_INTMINTE	0x00010000 +#define	PACR_EXTMINTE(x) (((x) & 0x1f) << 17) +#define	PACR_PKMD	0x40000000 +#define	PACR_DS		0x80000000 + +#define	PCICR1_CL(x)	((x) & 0xf)		/* Cacheline size field */ +#define	PCICR1_LT(x)	(((x) & 0xff) << 8)	/* Latency timer field */ + +/****************************************************************************/ +#endif	/* M54XXPCI_H */ diff --git a/arch/m68k/include/asm/m54xxsim.h b/arch/m68k/include/asm/m54xxsim.h new file mode 100644 index 00000000000..a5fbd17ab0a --- /dev/null +++ b/arch/m68k/include/asm/m54xxsim.h @@ -0,0 +1,106 @@ +/* + *	m54xxsim.h -- ColdFire 547x/548x System Integration Unit support. + */ + +#ifndef	m54xxsim_h +#define m54xxsim_h + +#define	CPU_NAME		"COLDFIRE(m54xx)" +#define	CPU_INSTR_PER_JIFFY	2 +#define	MCF_BUSCLK		(MCF_CLK / 2) + +#include <asm/m54xxacr.h> + +#define MCFINT_VECBASE		64 + +/* + *      Interrupt Controller Registers + */ +#define MCFICM_INTC0		(MCF_MBAR + 0x700) 	/* Base for Interrupt Ctrl 0 */ + +#define MCFINTC_IPRH		0x00		/* Interrupt pending 32-63 */ +#define MCFINTC_IPRL		0x04		/* Interrupt pending 1-31 */ +#define MCFINTC_IMRH		0x08		/* Interrupt mask 32-63 */ +#define MCFINTC_IMRL		0x0c		/* Interrupt mask 1-31 */ +#define MCFINTC_INTFRCH		0x10		/* Interrupt force 32-63 */ +#define MCFINTC_INTFRCL		0x14		/* Interrupt force 1-31 */ +#define MCFINTC_IRLR		0x18		/* */ +#define MCFINTC_IACKL		0x19		/* */ +#define MCFINTC_ICR0		0x40		/* Base ICR register */ + +/* + *	UART module. + */ +#define MCFUART_BASE0		(MCF_MBAR + 0x8600)	/* Base address UART0 */ +#define MCFUART_BASE1		(MCF_MBAR + 0x8700)	/* Base address UART1 */ +#define MCFUART_BASE2		(MCF_MBAR + 0x8800)	/* Base address UART2 */ +#define MCFUART_BASE3		(MCF_MBAR + 0x8900)	/* Base address UART3 */ + +/* + *	Define system peripheral IRQ usage. + */ +#define MCF_IRQ_TIMER		(MCFINT_VECBASE + 54)	/* Slice Timer 0 */ +#define MCF_IRQ_PROFILER	(MCFINT_VECBASE + 53)	/* Slice Timer 1 */ +#define MCF_IRQ_UART0		(MCFINT_VECBASE + 35) +#define MCF_IRQ_UART1		(MCFINT_VECBASE + 34) +#define MCF_IRQ_UART2		(MCFINT_VECBASE + 33) +#define MCF_IRQ_UART3		(MCFINT_VECBASE + 32) + +/* + *	Slice Timer support. + */ +#define MCFSLT_TIMER0		(MCF_MBAR + 0x900)	/* Base addr TIMER0 */ +#define MCFSLT_TIMER1		(MCF_MBAR + 0x910)	/* Base addr TIMER1 */ + +/* + *	Generic GPIO support + */ +#define MCFGPIO_PODR		(MCF_MBAR + 0xA00) +#define MCFGPIO_PDDR		(MCF_MBAR + 0xA10) +#define MCFGPIO_PPDR		(MCF_MBAR + 0xA20) +#define MCFGPIO_SETR		(MCF_MBAR + 0xA20) +#define MCFGPIO_CLRR		(MCF_MBAR + 0xA30) + +#define MCFGPIO_PIN_MAX		136	/* 128 gpio + 8 eport */ +#define MCFGPIO_IRQ_MAX		8 +#define MCFGPIO_IRQ_VECBASE	MCFINT_VECBASE + +/* + *	EDGE Port support. + */ +#define	MCFEPORT_EPPAR		(MCF_MBAR + 0xf00)	/* Pin assignment */ +#define	MCFEPORT_EPDDR		(MCF_MBAR + 0xf04)	/* Data direction */ +#define	MCFEPORT_EPIER		(MCF_MBAR + 0xf05)	/* Interrupt enable */ +#define	MCFEPORT_EPDR		(MCF_MBAR + 0xf08)	/* Port data (w) */ +#define	MCFEPORT_EPPDR		(MCF_MBAR + 0xf09)	/* Port data (r) */ +#define	MCFEPORT_EPFR		(MCF_MBAR + 0xf0c)	/* Flags */ + +/* + *	Pin Assignment register definitions + */ +#define MCFGPIO_PAR_FBCTL	(MCF_MBAR + 0xA40) +#define MCFGPIO_PAR_FBCS	(MCF_MBAR + 0xA42) +#define MCFGPIO_PAR_DMA		(MCF_MBAR + 0xA43) +#define MCFGPIO_PAR_FECI2CIRQ	(MCF_MBAR + 0xA44) +#define MCFGPIO_PAR_PCIBG	(MCF_MBAR + 0xA48)	/* PCI bus grant */ +#define MCFGPIO_PAR_PCIBR	(MCF_MBAR + 0xA4A)	/* PCI */ +#define MCFGPIO_PAR_PSC0	(MCF_MBAR + 0xA4F) +#define MCFGPIO_PAR_PSC1	(MCF_MBAR + 0xA4E) +#define MCFGPIO_PAR_PSC2	(MCF_MBAR + 0xA4D) +#define MCFGPIO_PAR_PSC3	(MCF_MBAR + 0xA4C) +#define MCFGPIO_PAR_DSPI	(MCF_MBAR + 0xA50) +#define MCFGPIO_PAR_TIMER	(MCF_MBAR + 0xA52) + +#define MCF_PAR_SDA		(0x0008) +#define MCF_PAR_SCL		(0x0004) +#define MCF_PAR_PSC_TXD		(0x04) +#define MCF_PAR_PSC_RXD		(0x08) +#define MCF_PAR_PSC_CTS_GPIO	(0x00) +#define MCF_PAR_PSC_CTS_BCLK	(0x80) +#define MCF_PAR_PSC_CTS_CTS	(0xC0) +#define MCF_PAR_PSC_RTS_GPIO    (0x00) +#define MCF_PAR_PSC_RTS_FSYNC	(0x20) +#define MCF_PAR_PSC_RTS_RTS	(0x30) +#define MCF_PAR_PSC_CANRX	(0x40) + +#endif	/* m54xxsim_h */ diff --git a/arch/m68k/include/asm/m68360.h b/arch/m68k/include/asm/m68360.h index eb7d39ef285..4664180a3ab 100644 --- a/arch/m68k/include/asm/m68360.h +++ b/arch/m68k/include/asm/m68360.h @@ -1,7 +1,7 @@ -#include "m68360_regs.h" -#include "m68360_pram.h" -#include "m68360_quicc.h" -#include "m68360_enet.h" +#include <asm/m68360_regs.h> +#include <asm/m68360_pram.h> +#include <asm/m68360_quicc.h> +#include <asm/m68360_enet.h>  #ifdef CONFIG_M68360 diff --git a/arch/m68k/include/asm/m68360_enet.h b/arch/m68k/include/asm/m68360_enet.h index c36f4d05920..4d04037c78a 100644 --- a/arch/m68k/include/asm/m68360_enet.h +++ b/arch/m68k/include/asm/m68360_enet.h @@ -10,7 +10,7 @@  #ifndef __ETHER_H  #define __ETHER_H -#include "quicc_simple.h" +#include <asm/quicc_simple.h>  /*   * transmit BD's diff --git a/arch/m68k/include/asm/m68360_quicc.h b/arch/m68k/include/asm/m68360_quicc.h index 6d40f4d18e1..59414cc108d 100644 --- a/arch/m68k/include/asm/m68360_quicc.h +++ b/arch/m68k/include/asm/m68360_quicc.h @@ -32,7 +32,7 @@ struct user_data {      /* BASE + 0x000: user data memory */      volatile unsigned char      udata_bd_ucode[0x400]; /*user data bd's Ucode*/      volatile unsigned char      udata_bd[0x200];       /*user data Ucode     */ -    volatile unsigned char      ucode_ext[0x100];      /*Ucode Extention ram */ +    volatile unsigned char      ucode_ext[0x100];      /*Ucode Extension ram */      volatile unsigned char      RESERVED1[0x500];      /* Reserved area      */  };  #else diff --git a/arch/m68k/include/asm/mac_baboon.h b/arch/m68k/include/asm/mac_baboon.h index c2a042b8c34..a2d32f6589f 100644 --- a/arch/m68k/include/asm/mac_baboon.h +++ b/arch/m68k/include/asm/mac_baboon.h @@ -29,4 +29,10 @@ struct baboon {  				 */  }; +extern int baboon_present; + +extern void baboon_register_interrupts(void); +extern void baboon_irq_enable(int); +extern void baboon_irq_disable(int); +  #endif /* __ASSEMBLY **/ diff --git a/arch/m68k/include/asm/mac_iop.h b/arch/m68k/include/asm/mac_iop.h index a2c7e6fcca3..fde874a01e2 100644 --- a/arch/m68k/include/asm/mac_iop.h +++ b/arch/m68k/include/asm/mac_iop.h @@ -159,4 +159,6 @@ extern void iop_upload_code(uint, __u8 *, uint, __u16);  extern void iop_download_code(uint, __u8 *, uint, __u16);  extern __u8 *iop_compare_code(uint, __u8 *, uint, __u16); +extern void iop_register_interrupts(void); +  #endif /* __ASSEMBLY__ */ diff --git a/arch/m68k/include/asm/mac_mouse.h b/arch/m68k/include/asm/mac_mouse.h deleted file mode 100644 index 39a5c292eae..00000000000 --- a/arch/m68k/include/asm/mac_mouse.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _ASM_MAC_MOUSE_H -#define _ASM_MAC_MOUSE_H - -/* - * linux/include/asm-m68k/mac_mouse.h - * header file for Macintosh ADB mouse driver - * 27-10-97 Michael Schmitz - * copied from: - * header file for Atari Mouse driver - * by Robert de Vries (robert@and.nl) on 19Jul93 - */ - -struct mouse_status { -	char		buttons; -	short		dx; -	short		dy; -	int		ready; -	int		active; -	wait_queue_head_t wait; -	struct fasync_struct *fasyncptr; -}; - -#endif diff --git a/arch/m68k/include/asm/mac_oss.h b/arch/m68k/include/asm/mac_oss.h index 7221f725193..425fbff4f4d 100644 --- a/arch/m68k/include/asm/mac_oss.h +++ b/arch/m68k/include/asm/mac_oss.h @@ -58,25 +58,6 @@  #define OSS_POWEROFF	0x80 -/* - * OSS Interrupt levels for various sub-systems - * - * This mapping is layed out with two things in mind: first, we try to keep - * things on their own levels to avoid having to do double-dispatches. Second, - * the levels match as closely as possible the alternate IRQ mapping mode (aka - * "A/UX mode") available on some VIA machines. - */ - -#define OSS_IRQLEV_DISABLED	0 -#define OSS_IRQLEV_IOPISM	1	/* ADB? */ -#define OSS_IRQLEV_SCSI		IRQ_AUTO_2 -#define OSS_IRQLEV_NUBUS	IRQ_AUTO_3	/* keep this on its own level */ -#define OSS_IRQLEV_IOPSCC	IRQ_AUTO_4	/* matches VIA alternate mapping */ -#define OSS_IRQLEV_SOUND	IRQ_AUTO_5	/* matches VIA alternate mapping */ -#define OSS_IRQLEV_60HZ		6	/* matches VIA alternate mapping */ -#define OSS_IRQLEV_VIA1		IRQ_AUTO_6	/* matches VIA alternate mapping */ -#define OSS_IRQLEV_PARITY	7	/* matches VIA alternate mapping */ -  #ifndef __ASSEMBLY__  struct mac_oss { @@ -91,4 +72,8 @@ struct mac_oss {  extern volatile struct mac_oss *oss;  extern int oss_present; +extern void oss_register_interrupts(void); +extern void oss_irq_enable(int); +extern void oss_irq_disable(int); +  #endif /* __ASSEMBLY__ */ diff --git a/arch/m68k/include/asm/mac_psc.h b/arch/m68k/include/asm/mac_psc.h index 7808bb0b232..e5c0d71d154 100644 --- a/arch/m68k/include/asm/mac_psc.h +++ b/arch/m68k/include/asm/mac_psc.h @@ -211,6 +211,10 @@  extern volatile __u8 *psc;  extern int psc_present; +extern void psc_register_interrupts(void); +extern void psc_irq_enable(int); +extern void psc_irq_disable(int); +  /*   *	Access functions   */ diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h index 39afb438b65..fe3fc9ae1b6 100644 --- a/arch/m68k/include/asm/mac_via.h +++ b/arch/m68k/include/asm/mac_via.h @@ -204,7 +204,7 @@  #define vT2CL	0x1000  /* [VIA only] Timer two counter low. */  #define vT2CH	0x1200  /* [VIA only] Timer two counter high. */  #define vSR	0x1400  /* [VIA only] Shift register. */ -#define vACR	0x1600  /* [VIA only] Auxilary control register. */ +#define vACR	0x1600  /* [VIA only] Auxiliary control register. */  #define vPCR	0x1800  /* [VIA only] Peripheral control register. */                          /*            CHRP sez never ever to *write* this.  			 *            Mac family says never to *change* this. @@ -254,6 +254,17 @@  extern volatile __u8 *via1,*via2;  extern int rbv_present,via_alt_mapping; +struct irq_desc; + +extern void via_register_interrupts(void); +extern void via_irq_enable(int); +extern void via_irq_disable(int); +extern void via_nubus_irq_startup(int irq); +extern void via_nubus_irq_shutdown(int irq); +extern void via1_irq(unsigned int irq, struct irq_desc *desc); +extern void via1_set_head(int); +extern int via2_scsi_drq_pending(void); +  static inline int rbv_set_video_bpp(int bpp)  {  	char val = (bpp==1)?0:(bpp==2)?1:(bpp==4)?2:(bpp==8)?3:-1; diff --git a/arch/m68k/include/asm/machdep.h b/arch/m68k/include/asm/machdep.h index 415d5484916..953ca21da8e 100644 --- a/arch/m68k/include/asm/machdep.h +++ b/arch/m68k/include/asm/machdep.h @@ -3,6 +3,7 @@  #include <linux/seq_file.h>  #include <linux/interrupt.h> +#include <linux/time.h>  struct pt_regs;  struct mktime; @@ -16,14 +17,11 @@ extern void (*mach_init_IRQ) (void);  extern void (*mach_get_model) (char *model);  extern void (*mach_get_hardware_list) (struct seq_file *m);  /* machine dependent timer functions */ -extern unsigned long (*mach_gettimeoffset)(void);  extern int (*mach_hwclk)(int, struct rtc_time*);  extern unsigned int (*mach_get_ss)(void);  extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);  extern int (*mach_set_rtc_pll)(struct rtc_pll_info *);  extern int (*mach_set_clock_mmss)(unsigned long); -extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour, -			    int *min, int *sec);  extern void (*mach_reset)( void );  extern void (*mach_halt)( void );  extern void (*mach_power_off)( void ); @@ -35,11 +33,9 @@ extern void (*mach_l2_flush) (int);  extern void (*mach_beep) (unsigned int, unsigned int);  /* Hardware clock functions */ -extern void hw_timer_init(void); +extern void hw_timer_init(irq_handler_t handler);  extern unsigned long hw_timer_offset(void); -extern irqreturn_t arch_timer_interrupt(int irq, void *dummy);  extern void config_BSP(char *command, int len); -extern void do_IRQ(int irq, struct pt_regs *fp);  #endif /* _M68K_MACHDEP_H */ diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h index 50db3591ca1..d323b2c2d07 100644 --- a/arch/m68k/include/asm/macintosh.h +++ b/arch/m68k/include/asm/macintosh.h @@ -4,6 +4,9 @@  #include <linux/seq_file.h>  #include <linux/interrupt.h> +#include <asm/bootinfo-mac.h> + +  /*   *	Apple Macintoshisms   */ @@ -11,13 +14,9 @@  extern void mac_reset(void);  extern void mac_poweroff(void);  extern void mac_init_IRQ(void); -extern int mac_irq_pending(unsigned int); -/* - *	Floppy driver magic hook - probably shouldnt be here - */ - -extern void via1_set_head(int); +extern void mac_irq_enable(struct irq_data *data); +extern void mac_irq_disable(struct irq_data *data);  /*   *	Macintosh Table @@ -46,7 +45,7 @@ struct mac_model  #define MAC_ADB_IOP		6  #define MAC_VIA_II		1 -#define MAC_VIA_IIci		2 +#define MAC_VIA_IICI		2  #define MAC_VIA_QUADRA		3  #define MAC_SCSI_NONE		0 @@ -78,65 +77,29 @@ struct mac_model  #define MAC_FLOPPY_SWIM_IOP	3  #define MAC_FLOPPY_AV		4 -/* - *	Gestalt numbers - */ +extern struct mac_model *macintosh_config; -#define MAC_MODEL_II		6 -#define MAC_MODEL_IIX		7 -#define MAC_MODEL_IICX		8 -#define MAC_MODEL_SE30		9 -#define MAC_MODEL_IICI		11 -#define MAC_MODEL_IIFX		13	/* And well numbered it is too */ -#define MAC_MODEL_IISI		18 -#define MAC_MODEL_LC		19 -#define MAC_MODEL_Q900		20 -#define MAC_MODEL_PB170		21 -#define MAC_MODEL_Q700		22 -#define MAC_MODEL_CLII		23	/* aka: P200 */ -#define MAC_MODEL_PB140		25 -#define MAC_MODEL_Q950		26	/* aka: WGS95 */ -#define MAC_MODEL_LCIII		27	/* aka: P450 */ -#define MAC_MODEL_PB210		29 -#define MAC_MODEL_C650		30 -#define MAC_MODEL_PB230		32 -#define MAC_MODEL_PB180		33 -#define MAC_MODEL_PB160		34 -#define MAC_MODEL_Q800		35	/* aka: WGS80 */ -#define MAC_MODEL_Q650		36 -#define MAC_MODEL_LCII		37	/* aka: P400/405/410/430 */ -#define MAC_MODEL_PB250		38 -#define MAC_MODEL_IIVI		44 -#define MAC_MODEL_P600		45	/* aka: P600CD */ -#define MAC_MODEL_IIVX		48 -#define MAC_MODEL_CCL		49	/* aka: P250 */ -#define MAC_MODEL_PB165C	50 -#define MAC_MODEL_C610		52	/* aka: WGS60 */ -#define MAC_MODEL_Q610		53 -#define MAC_MODEL_PB145		54	/* aka: PB145B */ -#define MAC_MODEL_P520		56	/* aka: LC520 */ -#define MAC_MODEL_C660		60 -#define MAC_MODEL_P460		62	/* aka: LCIII+, P466/P467 */ -#define MAC_MODEL_PB180C	71 -#define MAC_MODEL_PB520		72	/* aka: PB520C, PB540, PB540C, PB550C */ -#define MAC_MODEL_PB270C	77 -#define MAC_MODEL_Q840		78 -#define MAC_MODEL_P550		80	/* aka: LC550, P560 */ -#define MAC_MODEL_CCLII		83	/* aka: P275 */ -#define MAC_MODEL_PB165		84 -#define MAC_MODEL_PB190		85	/* aka: PB190CS */ -#define MAC_MODEL_TV		88 -#define MAC_MODEL_P475		89	/* aka: LC475, P476 */ -#define MAC_MODEL_P475F		90	/* aka: P475 w/ FPU (no LC040) */ -#define MAC_MODEL_P575		92	/* aka: LC575, P577/P578 */ -#define MAC_MODEL_Q605		94 -#define MAC_MODEL_Q605_ACC	95	/* Q605 accelerated to 33 MHz */ -#define MAC_MODEL_Q630		98	/* aka: LC630, P630/631/635/636/637/638/640 */ -#define MAC_MODEL_P588		99	/* aka: LC580, P580 */ -#define MAC_MODEL_PB280		102 -#define MAC_MODEL_PB280C	103 -#define MAC_MODEL_PB150		115 -extern struct mac_model *macintosh_config; +    /* +     * Internal representation of the Mac hardware, filled in from bootinfo +     */ + +struct mac_booter_data +{ +	unsigned long videoaddr; +	unsigned long videorow; +	unsigned long videodepth; +	unsigned long dimensions; +	unsigned long boottime; +	unsigned long gmtbias; +	unsigned long videological; +	unsigned long sccbase; +	unsigned long id; +	unsigned long memsize; +	unsigned long cpuid; +	unsigned long rombase; +}; + +extern struct mac_booter_data mac_bi_data;  #endif diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h index ebe1b70fe90..92aa8a4c2d0 100644 --- a/arch/m68k/include/asm/macints.h +++ b/arch/m68k/include/asm/macints.h @@ -104,6 +104,9 @@  #define IRQ_PSC4_3	  (35)  #define IRQ_MAC_MACE_DMA  IRQ_PSC4_3 +/* OSS Level 4 interrupts */ +#define IRQ_MAC_SCC	  (33) +  /* Level 5 (PSC, AV Macs only) interrupts */  #define IRQ_PSC5_0	  (40)  #define IRQ_PSC5_1	  (41) @@ -131,9 +134,6 @@  #define IRQ_BABOON_2	  (66)  #define IRQ_BABOON_3	  (67) -/* On non-PSC machines, the serial ports share an IRQ */ -#define IRQ_MAC_SCC	  IRQ_AUTO_4 -  #define SLOT2IRQ(x)	  (x + 47)  #define IRQ2SLOT(x)	  (x - 47) diff --git a/arch/m68k/include/asm/mc146818rtc.h b/arch/m68k/include/asm/mc146818rtc.h index 9f70a01f73d..05b43bf5cdf 100644 --- a/arch/m68k/include/asm/mc146818rtc.h +++ b/arch/m68k/include/asm/mc146818rtc.h @@ -10,16 +10,16 @@  #include <asm/atarihw.h> -#define RTC_PORT(x)	(TT_RTC_BAS + 2*(x)) +#define ATARI_RTC_PORT(x)	(TT_RTC_BAS + 2*(x))  #define RTC_ALWAYS_BCD	0  #define CMOS_READ(addr) ({ \ -atari_outb_p((addr),RTC_PORT(0)); \ -atari_inb_p(RTC_PORT(1)); \ +atari_outb_p((addr), ATARI_RTC_PORT(0)); \ +atari_inb_p(ATARI_RTC_PORT(1)); \  })  #define CMOS_WRITE(val, addr) ({ \ -atari_outb_p((addr),RTC_PORT(0)); \ -atari_outb_p((val),RTC_PORT(1)); \ +atari_outb_p((addr), ATARI_RTC_PORT(0)); \ +atari_outb_p((val), ATARI_RTC_PORT(1)); \  })  #endif /* CONFIG_ATARI */ diff --git a/arch/m68k/include/asm/mcfne.h b/arch/m68k/include/asm/mcf8390.h index bf638be0958..a72a20819a5 100644 --- a/arch/m68k/include/asm/mcfne.h +++ b/arch/m68k/include/asm/mcf8390.h @@ -1,7 +1,7 @@  /****************************************************************************/  /* - *	mcfne.h -- NE2000 in ColdFire eval boards. + *	mcf8390.h -- NS8390 support for ColdFire eval boards.   *   *	(C) Copyright 1999-2000, Greg Ungerer (gerg@snapgear.com)   *	(C) Copyright 2000,      Lineo (www.lineo.com) @@ -14,8 +14,8 @@   */  /****************************************************************************/ -#ifndef	mcfne_h -#define	mcfne_h +#ifndef	mcf8390_h +#define	mcf8390_h  /****************************************************************************/ @@ -37,6 +37,7 @@  #if defined(CONFIG_ARN5206)  #define NE2000_ADDR		0x40000300  #define NE2000_ODDOFFSET	0x00010000 +#define NE2000_ADDRSIZE		0x00020000  #define	NE2000_IRQ_VECTOR	0xf0  #define	NE2000_IRQ_PRIORITY	2  #define	NE2000_IRQ_LEVEL	4 @@ -46,6 +47,7 @@  #if defined(CONFIG_M5206eC3)  #define	NE2000_ADDR		0x40000300  #define	NE2000_ODDOFFSET	0x00010000 +#define	NE2000_ADDRSIZE		0x00020000  #define	NE2000_IRQ_VECTOR	0x1c  #define	NE2000_IRQ_PRIORITY	2  #define	NE2000_IRQ_LEVEL	4 @@ -54,6 +56,7 @@  #if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)  #define NE2000_ADDR		0x30000300 +#define NE2000_ADDRSIZE		0x00001000  #define NE2000_IRQ_VECTOR	25  #define NE2000_IRQ_PRIORITY	1  #define NE2000_IRQ_LEVEL	3 @@ -63,6 +66,7 @@  #if defined(CONFIG_M5307C3)  #define NE2000_ADDR		0x40000300  #define NE2000_ODDOFFSET	0x00010000 +#define NE2000_ADDRSIZE		0x00020000  #define NE2000_IRQ_VECTOR	0x1b  #define	NE2000_BYTE		volatile unsigned short  #endif @@ -70,6 +74,7 @@  #if defined(CONFIG_M5272) && defined(CONFIG_NETtel)  #define NE2000_ADDR		0x30600300  #define NE2000_ODDOFFSET	0x00008000 +#define NE2000_ADDRSIZE		0x00010000  #define NE2000_IRQ_VECTOR	67  #undef	BSWAP  #define	BSWAP(w)		(w) @@ -82,6 +87,7 @@  #define NE2000_ADDR0		0x30600300  #define NE2000_ADDR1		0x30800300  #define NE2000_ODDOFFSET	0x00008000 +#define NE2000_ADDRSIZE		0x00010000  #define NE2000_IRQ_VECTOR0	27  #define NE2000_IRQ_VECTOR1	29  #undef	BSWAP @@ -94,6 +100,7 @@  #if defined(CONFIG_M5307) && defined(CONFIG_SECUREEDGEMP3)  #define NE2000_ADDR		0x30600300  #define NE2000_ODDOFFSET	0x00008000 +#define NE2000_ADDRSIZE		0x00010000  #define NE2000_IRQ_VECTOR	27  #undef	BSWAP  #define	BSWAP(w)		(w) @@ -105,6 +112,7 @@  #if defined(CONFIG_ARN5307)  #define NE2000_ADDR		0xfe600300  #define NE2000_ODDOFFSET	0x00010000 +#define NE2000_ADDRSIZE		0x00020000  #define NE2000_IRQ_VECTOR	0x1b  #define NE2000_IRQ_PRIORITY	2  #define NE2000_IRQ_LEVEL	3 @@ -114,129 +122,10 @@  #if defined(CONFIG_M5407C3)  #define NE2000_ADDR		0x40000300  #define NE2000_ODDOFFSET	0x00010000 +#define NE2000_ADDRSIZE		0x00020000  #define NE2000_IRQ_VECTOR	0x1b  #define	NE2000_BYTE		volatile unsigned short  #endif  /****************************************************************************/ - -/* - *	Side-band address space for odd address requires re-mapping - *	many of the standard ISA access functions. - */ -#ifdef NE2000_ODDOFFSET - -#undef outb -#undef outb_p -#undef inb -#undef inb_p -#undef outsb -#undef outsw -#undef insb -#undef insw - -#define	outb	ne2000_outb -#define	inb	ne2000_inb -#define	outb_p	ne2000_outb -#define	inb_p	ne2000_inb -#define	outsb	ne2000_outsb -#define	outsw	ne2000_outsw -#define	insb	ne2000_insb -#define	insw	ne2000_insw - - -#ifndef COLDFIRE_NE2000_FUNCS - -void ne2000_outb(unsigned int val, unsigned int addr); -int  ne2000_inb(unsigned int addr); -void ne2000_insb(unsigned int addr, void *vbuf, int unsigned long len); -void ne2000_insw(unsigned int addr, void *vbuf, unsigned long len); -void ne2000_outsb(unsigned int addr, void *vbuf, unsigned long len); -void ne2000_outsw(unsigned int addr, void *vbuf, unsigned long len); - -#else - -/* - *	This macro converts a conventional register address into the - *	real memory pointer of the mapped NE2000 device. - *	On most NE2000 implementations on ColdFire boards the chip is - *	mapped in kinda funny, due to its ISA heritage. - */ -#define	NE2000_PTR(addr)	((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr)) -#define	NE2000_DATA_PTR(addr)	(addr) - - -void ne2000_outb(unsigned int val, unsigned int addr) -{ -	NE2000_BYTE	*rp; - -	rp = (NE2000_BYTE *) NE2000_PTR(addr); -	*rp = RSWAP(val); -} - -int ne2000_inb(unsigned int addr) -{ -	NE2000_BYTE	*rp, val; - -	rp = (NE2000_BYTE *) NE2000_PTR(addr); -	val = *rp; -	return((int) ((NE2000_BYTE) RSWAP(val))); -} - -void ne2000_insb(unsigned int addr, void *vbuf, int unsigned long len) -{ -	NE2000_BYTE	*rp, val; -	unsigned char	*buf; - -	buf = (unsigned char *) vbuf; -	rp = (NE2000_BYTE *) NE2000_DATA_PTR(addr); -	for (; (len > 0); len--) { -		val = *rp; -		*buf++ = RSWAP(val); -	} -} - -void ne2000_insw(unsigned int addr, void *vbuf, unsigned long len) -{ -	volatile unsigned short	*rp; -	unsigned short		w, *buf; - -	buf = (unsigned short *) vbuf; -	rp = (volatile unsigned short *) NE2000_DATA_PTR(addr); -	for (; (len > 0); len--) { -		w = *rp; -		*buf++ = BSWAP(w); -	} -} - -void ne2000_outsb(unsigned int addr, const void *vbuf, unsigned long len) -{ -	NE2000_BYTE	*rp, val; -	unsigned char	*buf; - -	buf = (unsigned char *) vbuf; -	rp = (NE2000_BYTE *) NE2000_DATA_PTR(addr); -	for (; (len > 0); len--) { -		val = *buf++; -		*rp = RSWAP(val); -	} -} - -void ne2000_outsw(unsigned int addr, const void *vbuf, unsigned long len) -{ -	volatile unsigned short	*rp; -	unsigned short		w, *buf; - -	buf = (unsigned short *) vbuf; -	rp = (volatile unsigned short *) NE2000_DATA_PTR(addr); -	for (; (len > 0); len--) { -		w = *buf++; -		*rp = BSWAP(w); -	} -} - -#endif /* COLDFIRE_NE2000_FUNCS */ -#endif /* NE2000_OFFOFFSET */ - -/****************************************************************************/ -#endif	/* mcfne_h */ +#endif	/* mcf8390_h */ diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h new file mode 100644 index 00000000000..f9924fbcfe4 --- /dev/null +++ b/arch/m68k/include/asm/mcf_pgalloc.h @@ -0,0 +1,106 @@ +#ifndef M68K_MCF_PGALLOC_H +#define M68K_MCF_PGALLOC_H + +#include <asm/tlb.h> +#include <asm/tlbflush.h> + +extern inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) +{ +	free_page((unsigned long) pte); +} + +extern const char bad_pmd_string[]; + +extern inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, +	unsigned long address) +{ +	unsigned long page = __get_free_page(GFP_DMA|__GFP_REPEAT); + +	if (!page) +		return NULL; + +	memset((void *)page, 0, PAGE_SIZE); +	return (pte_t *) (page); +} + +extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address) +{ +	return (pmd_t *) pgd; +} + +#define pmd_alloc_one_fast(mm, address) ({ BUG(); ((pmd_t *)1); }) +#define pmd_alloc_one(mm, address)      ({ BUG(); ((pmd_t *)2); }) + +#define pte_alloc_one_fast(mm, addr) pte_alloc_one(mm, addr) + +#define pmd_populate(mm, pmd, page) (pmd_val(*pmd) = \ +	(unsigned long)(page_address(page))) + +#define pmd_populate_kernel(mm, pmd, pte) (pmd_val(*pmd) = (unsigned long)(pte)) + +#define pmd_pgtable(pmd) pmd_page(pmd) + +static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page, +				  unsigned long address) +{ +	__free_page(page); +} + +#define __pmd_free_tlb(tlb, pmd, address) do { } while (0) + +static inline struct page *pte_alloc_one(struct mm_struct *mm, +	unsigned long address) +{ +	struct page *page = alloc_pages(GFP_DMA|__GFP_REPEAT, 0); +	pte_t *pte; + +	if (!page) +		return NULL; +	if (!pgtable_page_ctor(page)) { +		__free_page(page); +		return NULL; +	} + +	pte = kmap(page); +	if (pte) { +		clear_page(pte); +		__flush_page_to_ram(pte); +		flush_tlb_kernel_page(pte); +		nocache_page(pte); +	} +	kunmap(page); + +	return page; +} + +extern inline void pte_free(struct mm_struct *mm, struct page *page) +{ +	__free_page(page); +} + +/* + * In our implementation, each pgd entry contains 1 pmd that is never allocated + * or freed.  pgd_present is always 1, so this should never be called. -NL + */ +#define pmd_free(mm, pmd) BUG() + +static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) +{ +	free_page((unsigned long) pgd); +} + +static inline pgd_t *pgd_alloc(struct mm_struct *mm) +{ +	pgd_t *new_pgd; + +	new_pgd = (pgd_t *)__get_free_page(GFP_DMA | __GFP_NOWARN); +	if (!new_pgd) +		return NULL; +	memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); +	memset(new_pgd, 0, PAGE_OFFSET >> PGDIR_SHIFT); +	return new_pgd; +} + +#define pgd_populate(mm, pmd, pte) BUG() + +#endif /* M68K_MCF_PGALLOC_H */ diff --git a/arch/m68k/include/asm/mcf_pgtable.h b/arch/m68k/include/asm/mcf_pgtable.h new file mode 100644 index 00000000000..3c793682e5d --- /dev/null +++ b/arch/m68k/include/asm/mcf_pgtable.h @@ -0,0 +1,426 @@ +#ifndef _MCF_PGTABLE_H +#define _MCF_PGTABLE_H + +#include <asm/mcfmmu.h> +#include <asm/page.h> + +/* + * MMUDR bits, in proper place. We write these directly into the MMUDR + * after masking from the pte. + */ +#define CF_PAGE_LOCKED		MMUDR_LK	/* 0x00000002 */ +#define CF_PAGE_EXEC		MMUDR_X		/* 0x00000004 */ +#define CF_PAGE_WRITABLE	MMUDR_W		/* 0x00000008 */ +#define CF_PAGE_READABLE	MMUDR_R		/* 0x00000010 */ +#define CF_PAGE_SYSTEM		MMUDR_SP	/* 0x00000020 */ +#define CF_PAGE_COPYBACK	MMUDR_CM_CCB	/* 0x00000040 */ +#define CF_PAGE_NOCACHE		MMUDR_CM_NCP	/* 0x00000080 */ + +#define CF_CACHEMASK		(~MMUDR_CM_CCB) +#define CF_PAGE_MMUDR_MASK	0x000000fe + +#define _PAGE_NOCACHE030	CF_PAGE_NOCACHE + +/* + * MMUTR bits, need shifting down. + */ +#define CF_PAGE_MMUTR_MASK	0x00000c00 +#define CF_PAGE_MMUTR_SHIFT	10 + +#define CF_PAGE_VALID		(MMUTR_V << CF_PAGE_MMUTR_SHIFT) +#define CF_PAGE_SHARED		(MMUTR_SG << CF_PAGE_MMUTR_SHIFT) + +/* + * Fake bits, not implemented in CF, will get masked out before + * hitting hardware. + */ +#define CF_PAGE_DIRTY		0x00000001 +#define CF_PAGE_FILE		0x00000200 +#define CF_PAGE_ACCESSED	0x00001000 + +#define _PAGE_CACHE040		0x020   /* 68040 cache mode, cachable, copyback */ +#define _PAGE_NOCACHE_S		0x040   /* 68040 no-cache mode, serialized */ +#define _PAGE_NOCACHE		0x060   /* 68040 cache mode, non-serialized */ +#define _PAGE_CACHE040W		0x000   /* 68040 cache mode, cachable, write-through */ +#define _DESCTYPE_MASK		0x003 +#define _CACHEMASK040		(~0x060) +#define _PAGE_GLOBAL040		0x400   /* 68040 global bit, used for kva descs */ + +/* + * Externally used page protection values. + */ +#define _PAGE_PRESENT	(CF_PAGE_VALID) +#define _PAGE_ACCESSED	(CF_PAGE_ACCESSED) +#define _PAGE_DIRTY	(CF_PAGE_DIRTY) +#define _PAGE_READWRITE (CF_PAGE_READABLE \ +				| CF_PAGE_WRITABLE \ +				| CF_PAGE_SYSTEM \ +				| CF_PAGE_SHARED) + +/* + * Compound page protection values. + */ +#define PAGE_NONE	__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED) + +#define PAGE_SHARED     __pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_SHARED) + +#define PAGE_INIT	__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_WRITABLE \ +				 | CF_PAGE_EXEC \ +				 | CF_PAGE_SYSTEM) + +#define PAGE_KERNEL	__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_WRITABLE \ +				 | CF_PAGE_EXEC \ +				 | CF_PAGE_SYSTEM \ +				 | CF_PAGE_SHARED) + +#define PAGE_COPY	__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_DIRTY) + +/* + * Page protections for initialising protection_map. See mm/mmap.c + * for use. In general, the bit positions are xwr, and P-items are + * private, the S-items are shared. + */ +#define __P000		PAGE_NONE +#define __P001		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE) +#define __P010		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_WRITABLE) +#define __P011		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_WRITABLE) +#define __P100		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_EXEC) +#define __P101		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_EXEC) +#define __P110		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_WRITABLE \ +				 | CF_PAGE_EXEC) +#define __P111		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_WRITABLE \ +				 | CF_PAGE_EXEC) + +#define __S000		PAGE_NONE +#define __S001		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE) +#define __S010		PAGE_SHARED +#define __S011		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_SHARED \ +				 | CF_PAGE_READABLE) +#define __S100		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_EXEC) +#define __S101		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_EXEC) +#define __S110		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_SHARED \ +				 | CF_PAGE_EXEC) +#define __S111		__pgprot(CF_PAGE_VALID \ +				 | CF_PAGE_ACCESSED \ +				 | CF_PAGE_SHARED \ +				 | CF_PAGE_READABLE \ +				 | CF_PAGE_EXEC) + +#define PTE_MASK	PAGE_MASK +#define CF_PAGE_CHG_MASK (PTE_MASK | CF_PAGE_ACCESSED | CF_PAGE_DIRTY) + +#ifndef __ASSEMBLY__ + +/* + * Conversion functions: convert a page and protection to a page entry, + * and a page entry and page directory to the page they refer to. + */ +#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) + +static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) +{ +	pte_val(pte) = (pte_val(pte) & CF_PAGE_CHG_MASK) | pgprot_val(newprot); +	return pte; +} + +#define pmd_set(pmdp, ptep) do {} while (0) + +static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp) +{ +	pgd_val(*pgdp) = virt_to_phys(pmdp); +} + +#define __pte_page(pte)	((unsigned long) (pte_val(pte) & PAGE_MASK)) +#define __pmd_page(pmd)	((unsigned long) (pmd_val(pmd))) + +static inline int pte_none(pte_t pte) +{ +	return !pte_val(pte); +} + +static inline int pte_present(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_VALID; +} + +static inline void pte_clear(struct mm_struct *mm, unsigned long addr, +	pte_t *ptep) +{ +	pte_val(*ptep) = 0; +} + +#define pte_pagenr(pte)	((__pte_page(pte) - PAGE_OFFSET) >> PAGE_SHIFT) +#define pte_page(pte)	virt_to_page(__pte_page(pte)) + +static inline int pmd_none2(pmd_t *pmd) { return !pmd_val(*pmd); } +#define pmd_none(pmd) pmd_none2(&(pmd)) +static inline int pmd_bad2(pmd_t *pmd) { return 0; } +#define pmd_bad(pmd) pmd_bad2(&(pmd)) +#define pmd_present(pmd) (!pmd_none2(&(pmd))) +static inline void pmd_clear(pmd_t *pmdp) { pmd_val(*pmdp) = 0; } + +static inline int pgd_none(pgd_t pgd) { return 0; } +static inline int pgd_bad(pgd_t pgd) { return 0; } +static inline int pgd_present(pgd_t pgd) { return 1; } +static inline void pgd_clear(pgd_t *pgdp) {} + +#define pte_ERROR(e) \ +	printk(KERN_ERR "%s:%d: bad pte %08lx.\n",	\ +	__FILE__, __LINE__, pte_val(e)) +#define pmd_ERROR(e) \ +	printk(KERN_ERR "%s:%d: bad pmd %08lx.\n",	\ +	__FILE__, __LINE__, pmd_val(e)) +#define pgd_ERROR(e) \ +	printk(KERN_ERR "%s:%d: bad pgd %08lx.\n",	\ +	__FILE__, __LINE__, pgd_val(e)) + +/* + * The following only work if pte_present() is true. + * Undefined behaviour if not... + * [we have the full set here even if they don't change from m68k] + */ +static inline int pte_read(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_READABLE; +} + +static inline int pte_write(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_WRITABLE; +} + +static inline int pte_exec(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_EXEC; +} + +static inline int pte_dirty(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_DIRTY; +} + +static inline int pte_young(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_ACCESSED; +} + +static inline int pte_file(pte_t pte) +{ +	return pte_val(pte) & CF_PAGE_FILE; +} + +static inline int pte_special(pte_t pte) +{ +	return 0; +} + +static inline pte_t pte_wrprotect(pte_t pte) +{ +	pte_val(pte) &= ~CF_PAGE_WRITABLE; +	return pte; +} + +static inline pte_t pte_rdprotect(pte_t pte) +{ +	pte_val(pte) &= ~CF_PAGE_READABLE; +	return pte; +} + +static inline pte_t pte_exprotect(pte_t pte) +{ +	pte_val(pte) &= ~CF_PAGE_EXEC; +	return pte; +} + +static inline pte_t pte_mkclean(pte_t pte) +{ +	pte_val(pte) &= ~CF_PAGE_DIRTY; +	return pte; +} + +static inline pte_t pte_mkold(pte_t pte) +{ +	pte_val(pte) &= ~CF_PAGE_ACCESSED; +	return pte; +} + +static inline pte_t pte_mkwrite(pte_t pte) +{ +	pte_val(pte) |= CF_PAGE_WRITABLE; +	return pte; +} + +static inline pte_t pte_mkread(pte_t pte) +{ +	pte_val(pte) |= CF_PAGE_READABLE; +	return pte; +} + +static inline pte_t pte_mkexec(pte_t pte) +{ +	pte_val(pte) |= CF_PAGE_EXEC; +	return pte; +} + +static inline pte_t pte_mkdirty(pte_t pte) +{ +	pte_val(pte) |= CF_PAGE_DIRTY; +	return pte; +} + +static inline pte_t pte_mkyoung(pte_t pte) +{ +	pte_val(pte) |= CF_PAGE_ACCESSED; +	return pte; +} + +static inline pte_t pte_mknocache(pte_t pte) +{ +	pte_val(pte) |= 0x80 | (pte_val(pte) & ~0x40); +	return pte; +} + +static inline pte_t pte_mkcache(pte_t pte) +{ +	pte_val(pte) &= ~CF_PAGE_NOCACHE; +	return pte; +} + +static inline pte_t pte_mkspecial(pte_t pte) +{ +	return pte; +} + +#define swapper_pg_dir kernel_pg_dir +extern pgd_t kernel_pg_dir[PTRS_PER_PGD]; + +/* + * Find an entry in a pagetable directory. + */ +#define pgd_index(address)	((address) >> PGDIR_SHIFT) +#define pgd_offset(mm, address)	((mm)->pgd + pgd_index(address)) + +/* + * Find an entry in a kernel pagetable directory. + */ +#define pgd_offset_k(address)	pgd_offset(&init_mm, address) + +/* + * Find an entry in the second-level pagetable. + */ +static inline pmd_t *pmd_offset(pgd_t *pgd, unsigned long address) +{ +	return (pmd_t *) pgd; +} + +/* + * Find an entry in the third-level pagetable. + */ +#define __pte_offset(address)	((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) +#define pte_offset_kernel(dir, address) \ +	((pte_t *) __pmd_page(*(dir)) + __pte_offset(address)) + +/* + * Disable caching for page at given kernel virtual address. + */ +static inline void nocache_page(void *vaddr) +{ +	pgd_t *dir; +	pmd_t *pmdp; +	pte_t *ptep; +	unsigned long addr = (unsigned long) vaddr; + +	dir = pgd_offset_k(addr); +	pmdp = pmd_offset(dir, addr); +	ptep = pte_offset_kernel(pmdp, addr); +	*ptep = pte_mknocache(*ptep); +} + +/* + * Enable caching for page at given kernel virtual address. + */ +static inline void cache_page(void *vaddr) +{ +	pgd_t *dir; +	pmd_t *pmdp; +	pte_t *ptep; +	unsigned long addr = (unsigned long) vaddr; + +	dir = pgd_offset_k(addr); +	pmdp = pmd_offset(dir, addr); +	ptep = pte_offset_kernel(pmdp, addr); +	*ptep = pte_mkcache(*ptep); +} + +#define PTE_FILE_MAX_BITS	21 +#define PTE_FILE_SHIFT		11 + +static inline unsigned long pte_to_pgoff(pte_t pte) +{ +	return pte_val(pte) >> PTE_FILE_SHIFT; +} + +static inline pte_t pgoff_to_pte(unsigned pgoff) +{ +	return __pte((pgoff << PTE_FILE_SHIFT) + CF_PAGE_FILE); +} + +/* + * Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) + */ +#define __swp_type(x)		((x).val & 0xFF) +#define __swp_offset(x)		((x).val >> PTE_FILE_SHIFT) +#define __swp_entry(typ, off)	((swp_entry_t) { (typ) | \ +					(off << PTE_FILE_SHIFT) }) +#define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) }) +#define __swp_entry_to_pte(x)	(__pte((x).val)) + +#define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) + +#define pte_offset_map(pmdp, addr) ((pte_t *)__pmd_page(*pmdp) + \ +				       __pte_offset(addr)) +#define pte_unmap(pte)		((void) 0) +#define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) +#define pte_pfn(pte)		(pte_val(pte) >> PAGE_SHIFT) + +#endif	/* !__ASSEMBLY__ */ +#endif	/* _MCF_PGTABLE_H */ diff --git a/arch/m68k/include/asm/mcfcache.h b/arch/m68k/include/asm/mcfcache.h deleted file mode 100644 index f49dfc09f70..00000000000 --- a/arch/m68k/include/asm/mcfcache.h +++ /dev/null @@ -1,150 +0,0 @@ -/****************************************************************************/ - -/* - *	mcfcache.h -- ColdFire CPU cache support code - * - *	(C) Copyright 2004, Greg Ungerer <gerg@snapgear.com> - */ - -/****************************************************************************/ -#ifndef	__M68KNOMMU_MCFCACHE_H -#define	__M68KNOMMU_MCFCACHE_H -/****************************************************************************/ - - -/* - *	The different ColdFire families have different cache arrangments. - *	Everything from a small instruction only cache, to configurable - *	data and/or instruction cache, to unified instruction/data, to  - *	harvard style separate instruction and data caches. - */ - -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272) -/* - *	Simple version 2 core cache. These have instruction cache only, - *	we just need to invalidate it and enable it. - */ -.macro CACHE_ENABLE -	movel	#0x01000000,%d0		/* invalidate cache cmd */ -	movec	%d0,%CACR		/* do invalidate cache */ -	movel	#0x80000100,%d0		/* setup cache mask */ -	movec	%d0,%CACR		/* enable cache */ -.endm -#endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */ - -#if defined(CONFIG_M523x) || defined(CONFIG_M527x) -/* - *	New version 2 cores have a configurable split cache arrangement. - *	For now I am just enabling instruction cache - but ultimately I - *	think a split instruction/data cache would be better. - */ -.macro CACHE_ENABLE -	movel	#0x01400000,%d0 -	movec	%d0,%CACR		/* invalidate cache */ -	nop -	movel	#0x0000c000,%d0		/* set SDRAM cached only */ -	movec	%d0,%ACR0 -	movel	#0x00000000,%d0		/* no other regions cached */ -	movec	%d0,%ACR1 -	movel	#0x80400100,%d0		/* configure cache */ -	movec	%d0,%CACR		/* enable cache */ -	nop -.endm -#endif /* CONFIG_M523x || CONFIG_M527x */ - -#if defined(CONFIG_M528x) -.macro CACHE_ENABLE -	nop -	movel	#0x01000000, %d0 -	movec	%d0, %CACR		/* Invalidate cache */ -	nop -	movel	#0x0000c020, %d0	/* Set SDRAM cached only */ -	movec	%d0, %ACR0 -	movel	#0x00000000, %d0	/* No other regions cached */ -	movec	%d0, %ACR1 -	movel	#0x80000200, %d0	/* Setup cache mask */ -	movec	%d0, %CACR		/* Enable cache */ -	nop -.endm -#endif /* CONFIG_M528x */ - -#if defined(CONFIG_M5249) || defined(CONFIG_M5307) -/* - *	The version 3 core cache. Oddly enough the version 2 core 5249 - *	has the same SDRAM and cache setup as the version 3 cores. - *	This is a single unified instruction/data cache. - */ -.macro CACHE_ENABLE -	movel	#0x01000000,%d0		/* invalidate whole cache */ -	movec	%d0,%CACR -	nop -#if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3) -	movel	#0x0000c000,%d0		/* set SDRAM cached (write-thru) */ -#else -	movel	#0x0000c020,%d0		/* set SDRAM cached (copyback) */ -#endif -	movec	%d0,%ACR0 -	movel	#0x00000000,%d0		/* no other regions cached */ -	movec	%d0,%ACR1 -	movel	#0xa0000200,%d0		/* enable cache */ -	movec	%d0,%CACR -	nop -.endm -#endif /* CONFIG_M5249 || CONFIG_M5307 */ - -#if defined(CONFIG_M532x) -.macro CACHE_ENABLE -	movel	#0x01000000,%d0		/* invalidate cache cmd */ -	movec	%d0,%CACR		/* do invalidate cache */ -	nop -	movel	#0x4001C000,%d0		/* set SDRAM cached (write-thru) */ -	movec	%d0,%ACR0 -	movel	#0x00000000,%d0		/* no other regions cached */ -	movec	%d0,%ACR1 -	movel	#0x80000200,%d0		/* setup cache mask */ -	movec	%d0,%CACR		/* enable cache */ -	nop -.endm -#endif /* CONFIG_M532x */ - -#if defined(CONFIG_M5407) || defined(CONFIG_M548x) -/* - *	Version 4 cores have a true harvard style separate instruction - *	and data cache. Invalidate and enable cache, also enable write - *	buffers and branch accelerator. - */ -.macro CACHE_ENABLE -	movel	#0x01040100,%d0		/* invalidate whole cache */ -	movec	%d0,%CACR -	nop -	movel	#0x000fc000,%d0		/* set SDRAM cached only */ -	movec	%d0, %ACR0 -	movel	#0x00000000,%d0		/* no other regions cached */ -	movec	%d0, %ACR1 -	movel	#0x000fc000,%d0		/* set SDRAM cached only */ -	movec	%d0, %ACR2 -	movel	#0x00000000,%d0		/* no other regions cached */ -	movec	%d0, %ACR3 -	movel	#0xb6088400,%d0		/* enable caches */ -	movec	%d0,%CACR -	nop -.endm -#endif /* CONFIG_M5407 */ - -#if defined(CONFIG_M520x) -.macro CACHE_ENABLE -	move.l	#0x01000000,%d0		/* invalidate whole cache */ -	movec	%d0,%CACR -	nop -	move.l	#0x0000c000,%d0		/* set SDRAM cached (write-thru) */ -	movec	%d0,%ACR0 -	move.l	#0x00000000,%d0		/* no other regions cached */ -	movec	%d0,%ACR1 -	move.l	#0x80400000,%d0		/* enable 8K instruction cache */ -	movec	%d0,%CACR -	nop -.endm -#endif /* CONFIG_M520x */ - -/****************************************************************************/ -#endif	/* __M68KNOMMU_MCFCACHE_H */ diff --git a/arch/m68k/include/asm/mcfclk.h b/arch/m68k/include/asm/mcfclk.h new file mode 100644 index 00000000000..ea4791e3a55 --- /dev/null +++ b/arch/m68k/include/asm/mcfclk.h @@ -0,0 +1,50 @@ +/* + * mcfclk.h -- coldfire specific clock structure + */ + + +#ifndef mcfclk_h +#define mcfclk_h + +struct clk; + +struct clk_ops { +	void (*enable)(struct clk *); +	void (*disable)(struct clk *); +}; + +struct clk { +	const char *name; +	struct clk_ops *clk_ops; +	unsigned long rate; +	unsigned long enabled; +	u8 slot; +}; + +extern struct clk *mcf_clks[]; + +#ifdef MCFPM_PPMCR0 +extern struct clk_ops clk_ops0; +#ifdef MCFPM_PPMCR1 +extern struct clk_ops clk_ops1; +#endif /* MCFPM_PPMCR1 */ + +#define DEFINE_CLK(clk_bank, clk_name, clk_slot, clk_rate) \ +static struct clk __clk_##clk_bank##_##clk_slot = { \ +	.name = clk_name, \ +	.clk_ops = &clk_ops##clk_bank, \ +	.rate = clk_rate, \ +	.slot = clk_slot, \ +} + +void __clk_init_enabled(struct clk *); +void __clk_init_disabled(struct clk *); +#else +#define DEFINE_CLK(clk_ref, clk_name, clk_rate) \ +        static struct clk clk_##clk_ref = { \ +                .name = clk_name, \ +                .rate = clk_rate, \ +        } +#endif /* MCFPM_PPMCR0 */ + +#endif /* mcfclk_h */ diff --git a/arch/m68k/include/asm/mcfdma.h b/arch/m68k/include/asm/mcfdma.h index 705c52c79cd..10bc7e391c1 100644 --- a/arch/m68k/include/asm/mcfdma.h +++ b/arch/m68k/include/asm/mcfdma.h @@ -11,29 +11,6 @@  #define	mcfdma_h  /****************************************************************************/ - -/* - *	Get address specific defines for this Coldfire member. - */ -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) -#define	MCFDMA_BASE0		0x200		/* Base address of DMA 0 */ -#define	MCFDMA_BASE1		0x240		/* Base address of DMA 1 */ -#elif defined(CONFIG_M5272) -#define	MCFDMA_BASE0		0x0e0		/* Base address of DMA 0 */ -#elif defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) -/* These are relative to the IPSBAR, not MBAR */ -#define	MCFDMA_BASE0		0x100		/* Base address of DMA 0 */ -#define	MCFDMA_BASE1		0x140		/* Base address of DMA 1 */ -#define	MCFDMA_BASE2		0x180		/* Base address of DMA 2 */ -#define	MCFDMA_BASE3		0x1C0		/* Base address of DMA 3 */ -#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) -#define	MCFDMA_BASE0		0x300		/* Base address of DMA 0 */ -#define	MCFDMA_BASE1		0x340		/* Base address of DMA 1 */ -#define	MCFDMA_BASE2		0x380		/* Base address of DMA 2 */ -#define	MCFDMA_BASE3		0x3C0		/* Base address of DMA 3 */ -#endif - -  #if !defined(CONFIG_M5272)  /* diff --git a/arch/m68k/include/asm/mcfgpio.h b/arch/m68k/include/asm/mcfgpio.h index ee5e4ccce89..66203c334c6 100644 --- a/arch/m68k/include/asm/mcfgpio.h +++ b/arch/m68k/include/asm/mcfgpio.h @@ -16,25 +16,293 @@  #ifndef mcfgpio_h  #define mcfgpio_h -#include <linux/io.h> +#ifdef CONFIG_GPIOLIB  #include <asm-generic/gpio.h> +#else -struct mcf_gpio_chip { -	struct gpio_chip gpio_chip; -	void __iomem *pddr; -	void __iomem *podr; -	void __iomem *ppdr; -	void __iomem *setr; -	void __iomem *clrr; -	const u8 *gpio_to_pinmux; -}; - -int mcf_gpio_direction_input(struct gpio_chip *, unsigned); -int mcf_gpio_get_value(struct gpio_chip *, unsigned); -int mcf_gpio_direction_output(struct gpio_chip *, unsigned, int); -void mcf_gpio_set_value(struct gpio_chip *, unsigned, int); -void mcf_gpio_set_value_fast(struct gpio_chip *, unsigned, int); -int mcf_gpio_request(struct gpio_chip *, unsigned); -void mcf_gpio_free(struct gpio_chip *, unsigned); +int __mcfgpio_get_value(unsigned gpio); +void __mcfgpio_set_value(unsigned gpio, int value); +int __mcfgpio_direction_input(unsigned gpio); +int __mcfgpio_direction_output(unsigned gpio, int value); +int __mcfgpio_request(unsigned gpio); +void __mcfgpio_free(unsigned gpio); + +/* our alternate 'gpiolib' functions */ +static inline int __gpio_get_value(unsigned gpio) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		return __mcfgpio_get_value(gpio); +	else +		return -EINVAL; +} + +static inline void __gpio_set_value(unsigned gpio, int value) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		__mcfgpio_set_value(gpio, value); +} + +static inline int __gpio_cansleep(unsigned gpio) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		return 0; +	else +		return -EINVAL; +} + +static inline int __gpio_to_irq(unsigned gpio) +{ +	return -EINVAL; +} + +static inline int gpio_direction_input(unsigned gpio) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		return __mcfgpio_direction_input(gpio); +	else +		return -EINVAL; +} + +static inline int gpio_direction_output(unsigned gpio, int value) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		return __mcfgpio_direction_output(gpio, value); +	else +		return -EINVAL; +} + +static inline int gpio_request(unsigned gpio, const char *label) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		return __mcfgpio_request(gpio); +	else +		return -EINVAL; +} + +static inline void gpio_free(unsigned gpio) +{ +	if (gpio < MCFGPIO_PIN_MAX) +		__mcfgpio_free(gpio); +} + +#endif /* CONFIG_GPIOLIB */ + + +/* + * The Freescale Coldfire family is quite varied in how they implement GPIO. + * Some parts have 8 bit ports, some have 16bit and some have 32bit; some have + * only one port, others have multiple ports; some have a single data latch + * for both input and output, others have a separate pin data register to read + * input; some require a read-modify-write access to change an output, others + * have set and clear registers for some of the outputs; Some have all the + * GPIOs in a single control area, others have some GPIOs implemented in + * different modules. + * + * This implementation attempts accommodate the differences while presenting + * a generic interface that will optimize to as few instructions as possible. + */ +#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ +    defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ +    defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ +    defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \ +    defined(CONFIG_M5441x) + +/* These parts have GPIO organized by 8 bit ports */ + +#define MCFGPIO_PORTTYPE		u8 +#define MCFGPIO_PORTSIZE		8 +#define mcfgpio_read(port)		__raw_readb(port) +#define mcfgpio_write(data, port)	__raw_writeb(data, port) + +#elif defined(CONFIG_M5307) || defined(CONFIG_M5407) || defined(CONFIG_M5272) + +/* These parts have GPIO organized by 16 bit ports */ + +#define MCFGPIO_PORTTYPE		u16 +#define MCFGPIO_PORTSIZE		16 +#define mcfgpio_read(port)		__raw_readw(port) +#define mcfgpio_write(data, port)	__raw_writew(data, port) + +#elif defined(CONFIG_M5249) || defined(CONFIG_M525x) + +/* These parts have GPIO organized by 32 bit ports */ + +#define MCFGPIO_PORTTYPE		u32 +#define MCFGPIO_PORTSIZE		32 +#define mcfgpio_read(port)		__raw_readl(port) +#define mcfgpio_write(data, port)	__raw_writel(data, port)  #endif + +#define mcfgpio_bit(gpio)		(1 << ((gpio) %  MCFGPIO_PORTSIZE)) +#define mcfgpio_port(gpio)		((gpio) / MCFGPIO_PORTSIZE) + +#if defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ +    defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ +    defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \ +    defined(CONFIG_M5441x) +/* + * These parts have an 'Edge' Port module (external interrupt/GPIO) which uses + * read-modify-write to change an output and a GPIO module which has separate + * set/clr registers to directly change outputs with a single write access. + */ +#if defined(CONFIG_M528x) +/* + * The 528x also has GPIOs in other modules (GPT, QADC) which use + * read-modify-write as well as those controlled by the EPORT and GPIO modules. + */ +#define MCFGPIO_SCR_START		40 +#elif defined(CONFIGM5441x) +/* The m5441x EPORT doesn't have its own GPIO port, uses PORT C */ +#define MCFGPIO_SCR_START		0 +#else +#define MCFGPIO_SCR_START		8 +#endif + +#define MCFGPIO_SETR_PORT(gpio)		(MCFGPIO_SETR + \ +					mcfgpio_port(gpio - MCFGPIO_SCR_START)) + +#define MCFGPIO_CLRR_PORT(gpio)		(MCFGPIO_CLRR + \ +					mcfgpio_port(gpio - MCFGPIO_SCR_START)) +#else + +#define MCFGPIO_SCR_START		MCFGPIO_PIN_MAX +/* with MCFGPIO_SCR == MCFGPIO_PIN_MAX, these will be optimized away */ +#define MCFGPIO_SETR_PORT(gpio)		0 +#define MCFGPIO_CLRR_PORT(gpio)		0 + +#endif +/* + * Coldfire specific helper functions + */ + +/* return the port pin data register for a gpio */ +static inline u32 __mcfgpio_ppdr(unsigned gpio) +{ +#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ +    defined(CONFIG_M5307) || defined(CONFIG_M5407) +	return MCFSIM_PADAT; +#elif defined(CONFIG_M5272) +	if (gpio < 16) +		return MCFSIM_PADAT; +	else if (gpio < 32) +		return MCFSIM_PBDAT; +	else +		return MCFSIM_PCDAT; +#elif defined(CONFIG_M5249) || defined(CONFIG_M525x) +	if (gpio < 32) +		return MCFSIM2_GPIOREAD; +	else +		return MCFSIM2_GPIO1READ; +#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ +      defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ +      defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \ +      defined(CONFIG_M5441x) +#if !defined(CONFIG_M5441x) +	if (gpio < 8) +		return MCFEPORT_EPPDR; +#if defined(CONFIG_M528x) +	else if (gpio < 16) +		return MCFGPTA_GPTPORT; +	else if (gpio < 24) +		return MCFGPTB_GPTPORT; +	else if (gpio < 32) +		return MCFQADC_PORTQA; +	else if (gpio < 40) +		return MCFQADC_PORTQB; +#endif /* defined(CONFIG_M528x) */ +	else +#endif /* !defined(CONFIG_M5441x) */ +		return MCFGPIO_PPDR + mcfgpio_port(gpio - MCFGPIO_SCR_START); +#else +	return 0; +#endif +} + +/* return the port output data register for a gpio */ +static inline u32 __mcfgpio_podr(unsigned gpio) +{ +#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ +    defined(CONFIG_M5307) || defined(CONFIG_M5407) +	return MCFSIM_PADAT; +#elif defined(CONFIG_M5272) +	if (gpio < 16) +		return MCFSIM_PADAT; +	else if (gpio < 32) +		return MCFSIM_PBDAT; +	else +		return MCFSIM_PCDAT; +#elif defined(CONFIG_M5249) || defined(CONFIG_M525x) +	if (gpio < 32) +		return MCFSIM2_GPIOWRITE; +	else +		return MCFSIM2_GPIO1WRITE; +#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ +      defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ +      defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \ +      defined(CONFIG_M5441x) +#if !defined(CONFIG_M5441x) +	if (gpio < 8) +		return MCFEPORT_EPDR; +#if defined(CONFIG_M528x) +	else if (gpio < 16) +		return MCFGPTA_GPTPORT; +	else if (gpio < 24) +		return MCFGPTB_GPTPORT; +	else if (gpio < 32) +		return MCFQADC_PORTQA; +	else if (gpio < 40) +		return MCFQADC_PORTQB; +#endif /* defined(CONFIG_M528x) */ +	else +#endif /* !defined(CONFIG_M5441x) */ +		return MCFGPIO_PODR + mcfgpio_port(gpio - MCFGPIO_SCR_START); +#else +	return 0; +#endif +} + +/* return the port direction data register for a gpio */ +static inline u32 __mcfgpio_pddr(unsigned gpio) +{ +#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ +    defined(CONFIG_M5307) || defined(CONFIG_M5407) +	return MCFSIM_PADDR; +#elif defined(CONFIG_M5272) +	if (gpio < 16) +		return MCFSIM_PADDR; +	else if (gpio < 32) +		return MCFSIM_PBDDR; +	else +		return MCFSIM_PCDDR; +#elif defined(CONFIG_M5249) || defined(CONFIG_M525x) +	if (gpio < 32) +		return MCFSIM2_GPIOENABLE; +	else +		return MCFSIM2_GPIO1ENABLE; +#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \ +      defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ +      defined(CONFIG_M53xx) || defined(CONFIG_M54xx) || \ +      defined(CONFIG_M5441x) +#if !defined(CONFIG_M5441x) +	if (gpio < 8) +		return MCFEPORT_EPDDR; +#if defined(CONFIG_M528x) +	else if (gpio < 16) +		return MCFGPTA_GPTDDR; +	else if (gpio < 24) +		return MCFGPTB_GPTDDR; +	else if (gpio < 32) +		return MCFQADC_DDRQA; +	else if (gpio < 40) +		return MCFQADC_DDRQB; +#endif /* defined(CONFIG_M528x) */ +	else +#endif /* !defined(CONFIG_M5441x) */ +		return MCFGPIO_PDDR + mcfgpio_port(gpio - MCFGPIO_SCR_START); +#else +	return 0; +#endif +} + +#endif /* mcfgpio_h */ diff --git a/arch/m68k/include/asm/mcfmbus.h b/arch/m68k/include/asm/mcfmbus.h deleted file mode 100644 index 319899c47a2..00000000000 --- a/arch/m68k/include/asm/mcfmbus.h +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************/ - -/* - *      mcfmbus.h -- Coldfire MBUS support defines. - * - *      (C) Copyright 1999, Martin Floeer (mfloeer@axcent.de)  - */ - -/****************************************************************************/ - - -#ifndef mcfmbus_h -#define mcfmbus_h - - -#define MCFMBUS_BASE		0x280 -#define MCFMBUS_IRQ_VECTOR	0x19 -#define MCFMBUS_IRQ		0x1 -#define MCFMBUS_CLK		0x3f -#define MCFMBUS_IRQ_LEVEL	0x07	/*IRQ Level 1*/ -#define MCFMBUS_ADDRESS		0x01 - - -/* -*	Define the 5307 MBUS register set addresses -*/ - -#define MCFMBUS_MADR	0x00 -#define MCFMBUS_MFDR	0x04 -#define MCFMBUS_MBCR	0x08 -#define MCFMBUS_MBSR	0x0C -#define MCFMBUS_MBDR	0x10 - - -#define MCFMBUS_MADR_ADDR(a)	(((a)&0x7F)<<0x01) /*Slave Address*/ - -#define MCFMBUS_MFDR_MBC(a)	((a)&0x3F)	   /*M-Bus Clock*/ - -/* -*	Define bit flags in Control Register -*/ - -#define MCFMBUS_MBCR_MEN           (0x80)  /* M-Bus Enable                 */ -#define MCFMBUS_MBCR_MIEN          (0x40)  /* M-Bus Interrupt Enable       */ -#define MCFMBUS_MBCR_MSTA          (0x20)  /* Master/Slave Mode Select Bit */ -#define MCFMBUS_MBCR_MTX           (0x10)  /* Transmit/Rcv Mode Select Bit */ -#define MCFMBUS_MBCR_TXAK          (0x08)  /* Transmit Acknowledge Enable  */ -#define MCFMBUS_MBCR_RSTA          (0x04)  /* Repeat Start                 */ - -/* -*	Define bit flags in Status Register -*/ - -#define MCFMBUS_MBSR_MCF           (0x80)  /* Data Transfer Complete       */ -#define MCFMBUS_MBSR_MAAS          (0x40)  /* Addressed as a Slave         */ -#define MCFMBUS_MBSR_MBB           (0x20)  /* Bus Busy                     */ -#define MCFMBUS_MBSR_MAL           (0x10)  /* Arbitration Lost             */ -#define MCFMBUS_MBSR_SRW           (0x04)  /* Slave Transmit               */ -#define MCFMBUS_MBSR_MIF           (0x02)  /* M-Bus Interrupt              */ -#define MCFMBUS_MBSR_RXAK          (0x01)  /* No Acknowledge Received      */ - -/* -*	Define bit flags in DATA I/O Register -*/ - -#define MCFMBUS_MBDR_READ          (0x01)  /* 1=read 0=write MBUS */ - -#define MBUSIOCSCLOCK		1 -#define MBUSIOCGCLOCK		2 -#define MBUSIOCSADDR			3 -#define MBUSIOCGADDR			4 -#define MBUSIOCSSLADDR			5 -#define MBUSIOCGSLADDR			6 -#define MBUSIOCSSUBADDR			7 -#define MBUSIOCGSUBADDR			8 - -#endif diff --git a/arch/m68k/include/asm/mcfmmu.h b/arch/m68k/include/asm/mcfmmu.h new file mode 100644 index 00000000000..26cc3d5a63f --- /dev/null +++ b/arch/m68k/include/asm/mcfmmu.h @@ -0,0 +1,112 @@ +/* + *	mcfmmu.h -- definitions for the ColdFire v4e MMU + * + *	(C) Copyright 2011,  Greg Ungerer <gerg@uclinux.org> + * + * This file is subject to the terms and conditions of the GNU General Public + * License.  See the file COPYING in the main directory of this archive + * for more details. + */ + +#ifndef	MCFMMU_H +#define	MCFMMU_H + +/* + *	The MMU support registers are mapped into the address space using + *	the processor MMUBASE register. We used a fixed address for mapping, + *	there doesn't seem any need to make this configurable yet. + */ +#define	MMUBASE		0xfe000000 + +/* + *	The support registers of the MMU. Names are the sames as those + *	used in the Freescale v4e documentation. + */ +#define	MMUCR		(MMUBASE + 0x00)	/* Control register */ +#define	MMUOR		(MMUBASE + 0x04)	/* Operation register */ +#define	MMUSR		(MMUBASE + 0x08)	/* Status register */ +#define	MMUAR		(MMUBASE + 0x10)	/* TLB Address register */ +#define	MMUTR		(MMUBASE + 0x14)	/* TLB Tag register */ +#define	MMUDR		(MMUBASE + 0x18)	/* TLB Data register */ + +/* + *	MMU Control register bit flags + */ +#define	MMUCR_EN	0x00000001		/* Virtual mode enable */ +#define	MMUCR_ASM	0x00000002		/* Address space mode */ + +/* + *	MMU Operation register. + */ +#define	MMUOR_UAA	0x00000001		/* Update allocatiom address */ +#define	MMUOR_ACC	0x00000002		/* TLB access */ +#define	MMUOR_RD	0x00000004		/* TLB access read */ +#define	MMUOR_WR	0x00000000		/* TLB access write */ +#define	MMUOR_ADR	0x00000008		/* TLB address select */ +#define	MMUOR_ITLB	0x00000010		/* ITLB operation */ +#define	MMUOR_CAS	0x00000020		/* Clear non-locked ASID TLBs */ +#define	MMUOR_CNL	0x00000040		/* Clear non-locked TLBs */ +#define	MMUOR_CA	0x00000080		/* Clear all TLBs */ +#define	MMUOR_STLB	0x00000100		/* Search TLBs */ +#define	MMUOR_AAN	16			/* TLB allocation address */ +#define	MMUOR_AAMASK	0xffff0000		/* AA mask */ + +/* + *	MMU Status register. + */ +#define	MMUSR_HIT	0x00000002		/* Search TLB hit */ +#define	MMUSR_WF	0x00000008		/* Write access fault */ +#define	MMUSR_RF	0x00000010		/* Read access fault */ +#define	MMUSR_SPF	0x00000020		/* Supervisor protect fault */ + +/* + *	MMU Read/Write Tag register. + */ +#define	MMUTR_V		0x00000001		/* Valid */ +#define	MMUTR_SG	0x00000002		/* Shared global */ +#define	MMUTR_IDN	2			/* Address Space ID */ +#define	MMUTR_IDMASK	0x000003fc		/* ASID mask */ +#define	MMUTR_VAN	10			/* Virtual Address */ +#define	MMUTR_VAMASK	0xfffffc00		/* VA mask */ + +/* + *	MMU Read/Write Data register. + */ +#define	MMUDR_LK	0x00000002		/* Lock entry */ +#define	MMUDR_X		0x00000004		/* Execute access enable */ +#define	MMUDR_W		0x00000008		/* Write access enable */ +#define	MMUDR_R		0x00000010		/* Read access enable */ +#define	MMUDR_SP	0x00000020		/* Supervisor access enable */ +#define	MMUDR_CM_CWT	0x00000000		/* Cachable write thru */ +#define	MMUDR_CM_CCB	0x00000040		/* Cachable copy back */ +#define	MMUDR_CM_NCP	0x00000080		/* Non-cachable precise */ +#define	MMUDR_CM_NCI	0x000000c0		/* Non-cachable imprecise */ +#define	MMUDR_SZ_1MB	0x00000000		/* 1MB page size */ +#define	MMUDR_SZ_4KB	0x00000100		/* 4kB page size */ +#define	MMUDR_SZ_8KB	0x00000200		/* 8kB page size */ +#define	MMUDR_SZ_1KB	0x00000300		/* 1kB page size */ +#define	MMUDR_PAN	10			/* Physical address */ +#define	MMUDR_PAMASK	0xfffffc00		/* PA mask */ + +#ifndef __ASSEMBLY__ + +/* + *	Simple access functions for the MMU registers. Nothing fancy + *	currently required, just simple 32bit access. + */ +static inline u32 mmu_read(u32 a) +{ +	return *((volatile u32 *) a); +} + +static inline void mmu_write(u32 a, u32 v) +{ +	*((volatile u32 *) a) = v; +	__asm__ __volatile__ ("nop"); +} + +int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word); + +#endif + +#endif	/* MCFMMU_H */ diff --git a/arch/m68k/include/asm/mcfpit.h b/arch/m68k/include/asm/mcfpit.h index f570cf64fd2..9fd321ca072 100644 --- a/arch/m68k/include/asm/mcfpit.h +++ b/arch/m68k/include/asm/mcfpit.h @@ -11,22 +11,8 @@  #define	mcfpit_h  /****************************************************************************/ - -/* - *	Get address specific defines for the 5270/5271, 5280/5282, and 5208. - */ -#if defined(CONFIG_M520x) -#define	MCFPIT_BASE1		0x00080000	/* Base address of TIMER1 */ -#define	MCFPIT_BASE2		0x00084000	/* Base address of TIMER2 */ -#else -#define	MCFPIT_BASE1		0x00150000	/* Base address of TIMER1 */ -#define	MCFPIT_BASE2		0x00160000	/* Base address of TIMER2 */ -#define	MCFPIT_BASE3		0x00170000	/* Base address of TIMER3 */ -#define	MCFPIT_BASE4		0x00180000	/* Base address of TIMER4 */ -#endif -  /* - *	Define the PIT timer register set addresses. + *	Define the PIT timer register address offsets.   */  #define	MCFPIT_PCSR		0x0		/* PIT control register */  #define	MCFPIT_PMR		0x2		/* PIT modulus register */ diff --git a/arch/m68k/include/asm/mcfqspi.h b/arch/m68k/include/asm/mcfqspi.h index 39d90d51111..7b51416ccae 100644 --- a/arch/m68k/include/asm/mcfqspi.h +++ b/arch/m68k/include/asm/mcfqspi.h @@ -21,15 +21,6 @@  #ifndef mcfqspi_h  #define mcfqspi_h -#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) -#define	MCFQSPI_IOBASE		(MCF_IPSBAR + 0x340) -#elif defined(CONFIG_M5249) -#define MCFQSPI_IOBASE		(MCF_MBAR + 0x300) -#elif defined(CONFIG_M520x) || defined(CONFIG_M532x) -#define MCFQSPI_IOBASE		0xFC058000 -#endif -#define MCFQSPI_IOSIZE		0x40 -  /**   * struct mcfqspi_cs_control - chip select control for the coldfire qspi driver   * @setup: setup the control; allocate gpio's, etc. May be NULL. diff --git a/arch/m68k/include/asm/mcfsim.h b/arch/m68k/include/asm/mcfsim.h index 6901fd68165..bc867de8a1e 100644 --- a/arch/m68k/include/asm/mcfsim.h +++ b/arch/m68k/include/asm/mcfsim.h @@ -24,8 +24,8 @@  #elif defined(CONFIG_M523x)  #include <asm/m523xsim.h>  #include <asm/mcfintc.h> -#elif defined(CONFIG_M5249) -#include <asm/m5249sim.h> +#elif defined(CONFIG_M5249) || defined(CONFIG_M525x) +#include <asm/m525xsim.h>  #include <asm/mcfintc.h>  #elif defined(CONFIG_M527x)  #include <asm/m527xsim.h> @@ -36,13 +36,15 @@  #elif defined(CONFIG_M5307)  #include <asm/m5307sim.h>  #include <asm/mcfintc.h> -#elif defined(CONFIG_M532x) -#include <asm/m532xsim.h> +#elif defined(CONFIG_M53xx) +#include <asm/m53xxsim.h>  #elif defined(CONFIG_M5407)  #include <asm/m5407sim.h>  #include <asm/mcfintc.h> -#elif defined(CONFIG_M548x) -#include <asm/m548xsim.h> +#elif defined(CONFIG_M54xx) +#include <asm/m54xxsim.h> +#elif defined(CONFIG_M5441x) +#include <asm/m5441xsim.h>  #endif  /****************************************************************************/ diff --git a/arch/m68k/include/asm/mcfslt.h b/arch/m68k/include/asm/mcfslt.h index d0d0ecba533..c2314b6f8ca 100644 --- a/arch/m68k/include/asm/mcfslt.h +++ b/arch/m68k/include/asm/mcfslt.h @@ -13,13 +13,6 @@  /****************************************************************************/  /* - *	Get address specific defines for the 547x. - */ -#define MCFSLT_TIMER0		0x900	/* Base address of TIMER0 */ -#define MCFSLT_TIMER1		0x910	/* Base address of TIMER1 */ - - -/*   *	Define the SLT timer register set addresses.   */  #define MCFSLT_STCNT		0x00	/* Terminal count */ diff --git a/arch/m68k/include/asm/mcftimer.h b/arch/m68k/include/asm/mcftimer.h index 0f90f6d2227..089f0f150bb 100644 --- a/arch/m68k/include/asm/mcftimer.h +++ b/arch/m68k/include/asm/mcftimer.h @@ -12,29 +12,6 @@  #define	mcftimer_h  /****************************************************************************/ - -/* - *	Get address specific defines for this ColdFire member. - */ -#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) -#define	MCFTIMER_BASE1		0x100		/* Base address of TIMER1 */ -#define	MCFTIMER_BASE2		0x120		/* Base address of TIMER2 */ -#elif defined(CONFIG_M5272) -#define MCFTIMER_BASE1		0x200           /* Base address of TIMER1 */ -#define MCFTIMER_BASE2		0x220           /* Base address of TIMER2 */ -#define MCFTIMER_BASE3		0x240           /* Base address of TIMER4 */ -#define MCFTIMER_BASE4		0x260           /* Base address of TIMER3 */ -#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) -#define MCFTIMER_BASE1		0x140           /* Base address of TIMER1 */ -#define MCFTIMER_BASE2		0x180           /* Base address of TIMER2 */ -#elif defined(CONFIG_M532x) -#define MCFTIMER_BASE1		0xfc070000	/* Base address of TIMER1 */ -#define MCFTIMER_BASE2		0xfc074000	/* Base address of TIMER2 */ -#define MCFTIMER_BASE3		0xfc078000	/* Base address of TIMER3 */ -#define MCFTIMER_BASE4		0xfc07c000	/* Base address of TIMER4 */ -#endif - -  /*   *	Define the TIMER register set addresses.   */ @@ -42,7 +19,7 @@  #define	MCFTIMER_TRR		0x04		/* Timer Reference (r/w) */  #define	MCFTIMER_TCR		0x08		/* Timer Capture reg (r/w) */  #define	MCFTIMER_TCN		0x0C		/* Timer Counter reg (r/w) */ -#if defined(CONFIG_M532x) +#if defined(CONFIG_M53xx) || defined(CONFIG_M5441x)  #define	MCFTIMER_TER		0x03		/* Timer Event reg (r/w) */  #else  #define	MCFTIMER_TER		0x11		/* Timer Event reg (r/w) */ @@ -50,7 +27,7 @@  /*   *	Bit definitions for the Timer Mode Register (TMR). - *	Register bit flags are common accross ColdFires. + *	Register bit flags are common across ColdFires.   */  #define	MCFTIMER_TMR_PREMASK	0xff00		/* Prescalar mask */  #define	MCFTIMER_TMR_DISCE	0x0000		/* Disable capture */ diff --git a/arch/m68k/include/asm/mcfuart.h b/arch/m68k/include/asm/mcfuart.h index db72e2b889c..b40c20f6664 100644 --- a/arch/m68k/include/asm/mcfuart.h +++ b/arch/m68k/include/asm/mcfuart.h @@ -12,49 +12,6 @@  #define	mcfuart_h  /****************************************************************************/ -/* - *	Define the base address of the UARTS within the MBAR address - *	space. - */ -#if defined(CONFIG_M5272) -#define	MCFUART_BASE1		0x100		/* Base address of UART1 */ -#define	MCFUART_BASE2		0x140		/* Base address of UART2 */ -#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) -#if defined(CONFIG_NETtel) -#define	MCFUART_BASE1		0x180		/* Base address of UART1 */ -#define	MCFUART_BASE2		0x140		/* Base address of UART2 */ -#else -#define	MCFUART_BASE1		0x140		/* Base address of UART1 */ -#define	MCFUART_BASE2		0x180		/* Base address of UART2 */ -#endif -#elif defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) -#define MCFUART_BASE1		0x200           /* Base address of UART1 */ -#define MCFUART_BASE2		0x240           /* Base address of UART2 */ -#define MCFUART_BASE3		0x280           /* Base address of UART3 */ -#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) -#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3) -#define MCFUART_BASE1		0x200           /* Base address of UART1 */ -#define MCFUART_BASE2		0x1c0           /* Base address of UART2 */ -#else -#define MCFUART_BASE1		0x1c0           /* Base address of UART1 */ -#define MCFUART_BASE2		0x200           /* Base address of UART2 */ -#endif -#elif defined(CONFIG_M520x) -#define MCFUART_BASE1		0x60000		/* Base address of UART1 */ -#define MCFUART_BASE2		0x64000		/* Base address of UART2 */ -#define MCFUART_BASE3		0x68000		/* Base address of UART2 */ -#elif defined(CONFIG_M532x) -#define MCFUART_BASE1		0xfc060000	/* Base address of UART1 */ -#define MCFUART_BASE2		0xfc064000	/* Base address of UART2 */ -#define MCFUART_BASE3		0xfc068000	/* Base address of UART3 */ -#elif defined(CONFIG_M548x) -#define MCFUART_BASE1		0x8600		/* on M548x */ -#define MCFUART_BASE2		0x8700		/* on M548x */ -#define MCFUART_BASE3		0x8800		/* on M548x */ -#define MCFUART_BASE4		0x8900		/* on M548x */ -#endif - -  #include <linux/serial_core.h>  #include <linux/platform_device.h> @@ -84,7 +41,10 @@ struct mcf_platform_uart {  #define	MCFUART_UTF		0x28		/* Transmitter FIFO (r/w) */  #define	MCFUART_URF		0x2c		/* Receiver FIFO (r/w) */  #define	MCFUART_UFPD		0x30		/* Frac Prec. Divider (r/w) */ -#else +#endif +#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ +	defined(CONFIG_M5249) || defined(CONFIG_M525x) || \ +	defined(CONFIG_M5307) || defined(CONFIG_M5407)  #define	MCFUART_UIVR		0x30		/* Interrupt Vector (r/w) */  #endif  #define	MCFUART_UIPR		0x34		/* Input Port (r) */ @@ -217,7 +177,7 @@ struct mcf_platform_uart {  #define	MCFUART_URF_RXS		0xc0		/* Receiver status */  #endif -#if defined(CONFIG_M548x) +#if defined(CONFIG_M54xx)  #define MCFUART_TXFIFOSIZE	512  #elif defined(CONFIG_M5272)  #define MCFUART_TXFIFOSIZE	25 diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h deleted file mode 100644 index 8eebf89f5ab..00000000000 --- a/arch/m68k/include/asm/mman.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/mman.h> diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h index 7d4341e55a9..dc3be991d63 100644 --- a/arch/m68k/include/asm/mmu_context.h +++ b/arch/m68k/include/asm/mmu_context.h @@ -8,7 +8,206 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)  }  #ifdef CONFIG_MMU -#ifndef CONFIG_SUN3 + +#if defined(CONFIG_COLDFIRE) + +#include <asm/atomic.h> +#include <asm/bitops.h> +#include <asm/mcfmmu.h> +#include <asm/mmu.h> + +#define NO_CONTEXT		256 +#define LAST_CONTEXT		255 +#define FIRST_CONTEXT		1 + +extern unsigned long context_map[]; +extern mm_context_t next_mmu_context; + +extern atomic_t nr_free_contexts; +extern struct mm_struct *context_mm[LAST_CONTEXT+1]; +extern void steal_context(void); + +static inline void get_mmu_context(struct mm_struct *mm) +{ +	mm_context_t ctx; + +	if (mm->context != NO_CONTEXT) +		return; +	while (atomic_dec_and_test_lt(&nr_free_contexts)) { +		atomic_inc(&nr_free_contexts); +		steal_context(); +	} +	ctx = next_mmu_context; +	while (test_and_set_bit(ctx, context_map)) { +		ctx = find_next_zero_bit(context_map, LAST_CONTEXT+1, ctx); +		if (ctx > LAST_CONTEXT) +			ctx = 0; +	} +	next_mmu_context = (ctx + 1) & LAST_CONTEXT; +	mm->context = ctx; +	context_mm[ctx] = mm; +} + +/* + * Set up the context for a new address space. + */ +#define init_new_context(tsk, mm)	(((mm)->context = NO_CONTEXT), 0) + +/* + * We're finished using the context for an address space. + */ +static inline void destroy_context(struct mm_struct *mm) +{ +	if (mm->context != NO_CONTEXT) { +		clear_bit(mm->context, context_map); +		mm->context = NO_CONTEXT; +		atomic_inc(&nr_free_contexts); +	} +} + +static inline void set_context(mm_context_t context, pgd_t *pgd) +{ +	__asm__ __volatile__ ("movec %0,%%asid" : : "d" (context)); +} + +static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, +	struct task_struct *tsk) +{ +	get_mmu_context(tsk->mm); +	set_context(tsk->mm->context, next->pgd); +} + +/* + * After we have set current->mm to a new value, this activates + * the context for the new mm so we see the new mappings. + */ +static inline void activate_mm(struct mm_struct *active_mm, +	struct mm_struct *mm) +{ +	get_mmu_context(mm); +	set_context(mm->context, mm->pgd); +} + +#define deactivate_mm(tsk, mm) do { } while (0) + +extern void mmu_context_init(void); +#define prepare_arch_switch(next) load_ksp_mmu(next) + +static inline void load_ksp_mmu(struct task_struct *task) +{ +	unsigned long flags; +	struct mm_struct *mm; +	int asid; +	pgd_t *pgd; +	pmd_t *pmd; +	pte_t *pte; +	unsigned long mmuar; + +	local_irq_save(flags); +	mmuar = task->thread.ksp; + +	/* Search for a valid TLB entry, if one is found, don't remap */ +	mmu_write(MMUAR, mmuar); +	mmu_write(MMUOR, MMUOR_STLB | MMUOR_ADR); +	if (mmu_read(MMUSR) & MMUSR_HIT) +		goto end; + +	if (mmuar >= PAGE_OFFSET) { +		mm = &init_mm; +	} else { +		pr_info("load_ksp_mmu: non-kernel mm found: 0x%p\n", task->mm); +		mm = task->mm; +	} + +	if (!mm) +		goto bug; + +	pgd = pgd_offset(mm, mmuar); +	if (pgd_none(*pgd)) +		goto bug; + +	pmd = pmd_offset(pgd, mmuar); +	if (pmd_none(*pmd)) +		goto bug; + +	pte = (mmuar >= PAGE_OFFSET) ? pte_offset_kernel(pmd, mmuar) +				     : pte_offset_map(pmd, mmuar); +	if (pte_none(*pte) || !pte_present(*pte)) +		goto bug; + +	set_pte(pte, pte_mkyoung(*pte)); +	asid = mm->context & 0xff; +	if (!pte_dirty(*pte) && mmuar <= PAGE_OFFSET) +		set_pte(pte, pte_wrprotect(*pte)); + +	mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | +		(((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK) +		>> CF_PAGE_MMUTR_SHIFT) | MMUTR_V); + +	mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) | +		((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X); + +	mmu_write(MMUOR, MMUOR_ACC | MMUOR_UAA); + +	goto end; + +bug: +	pr_info("ksp load failed: mm=0x%p ksp=0x08%lx\n", mm, mmuar); +end: +	local_irq_restore(flags); +} + +#elif defined(CONFIG_SUN3) +#include <asm/sun3mmu.h> +#include <linux/sched.h> + +extern unsigned long get_free_context(struct mm_struct *mm); +extern void clear_context(unsigned long context); + +/* set the context for a new task to unmapped */ +static inline int init_new_context(struct task_struct *tsk, +				   struct mm_struct *mm) +{ +	mm->context = SUN3_INVALID_CONTEXT; +	return 0; +} + +/* find the context given to this process, and if it hasn't already +   got one, go get one for it. */ +static inline void get_mmu_context(struct mm_struct *mm) +{ +	if (mm->context == SUN3_INVALID_CONTEXT) +		mm->context = get_free_context(mm); +} + +/* flush context if allocated... */ +static inline void destroy_context(struct mm_struct *mm) +{ +	if (mm->context != SUN3_INVALID_CONTEXT) +		clear_context(mm->context); +} + +static inline void activate_context(struct mm_struct *mm) +{ +	get_mmu_context(mm); +	sun3_put_context(mm->context); +} + +static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, +			     struct task_struct *tsk) +{ +	activate_context(tsk->mm); +} + +#define deactivate_mm(tsk, mm)	do { } while (0) + +static inline void activate_mm(struct mm_struct *prev_mm, +			       struct mm_struct *next_mm) +{ +	activate_context(next_mm); +} + +#else  #include <asm/setup.h>  #include <asm/page.h> @@ -103,55 +302,8 @@ static inline void activate_mm(struct mm_struct *prev_mm,  		switch_mm_0460(next_mm);  } -#else  /* CONFIG_SUN3 */ -#include <asm/sun3mmu.h> -#include <linux/sched.h> - -extern unsigned long get_free_context(struct mm_struct *mm); -extern void clear_context(unsigned long context); - -/* set the context for a new task to unmapped */ -static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) -{ -	mm->context = SUN3_INVALID_CONTEXT; -	return 0; -} - -/* find the context given to this process, and if it hasn't already -   got one, go get one for it. */ -static inline void get_mmu_context(struct mm_struct *mm) -{ -	if(mm->context == SUN3_INVALID_CONTEXT) -		mm->context = get_free_context(mm); -} - -/* flush context if allocated... */ -static inline void destroy_context(struct mm_struct *mm) -{ -	if(mm->context != SUN3_INVALID_CONTEXT) -		clear_context(mm->context); -} - -static inline void activate_context(struct mm_struct *mm) -{ -	get_mmu_context(mm); -	sun3_put_context(mm->context); -} - -static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) -{ -	activate_context(tsk->mm); -} - -#define deactivate_mm(tsk,mm)	do { } while (0) - -static inline void activate_mm(struct mm_struct *prev_mm, -			       struct mm_struct *next_mm) -{ -	activate_context(next_mm); -} -  #endif +  #else /* !CONFIG_MMU */  static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) diff --git a/arch/m68k/include/asm/module.h b/arch/m68k/include/asm/module.h index 5f21e11071b..8b58fce843d 100644 --- a/arch/m68k/include/asm/module.h +++ b/arch/m68k/include/asm/module.h @@ -1,17 +1,7 @@  #ifndef _ASM_M68K_MODULE_H  #define _ASM_M68K_MODULE_H -#ifdef CONFIG_MMU - -struct mod_arch_specific { -	struct m68k_fixup_info *fixup_start, *fixup_end; -}; - -#define MODULE_ARCH_INIT {				\ -	.fixup_start		= __start_fixup,	\ -	.fixup_end		= __stop_fixup,		\ -} - +#include <asm-generic/module.h>  enum m68k_fixup_type {  	m68k_fixup_memoffset, @@ -23,26 +13,29 @@ struct m68k_fixup_info {  	void *addr;  }; +struct mod_arch_specific { +	struct m68k_fixup_info *fixup_start, *fixup_end; +}; + +#ifdef CONFIG_MMU + +#define MODULE_ARCH_INIT {				\ +	.fixup_start		= __start_fixup,	\ +	.fixup_end		= __stop_fixup,		\ +} + +  #define m68k_fixup(type, addr)			\  	"	.section \".m68k_fixup\",\"aw\"\n"	\  	"	.long " #type "," #addr "\n"	\  	"	.previous\n" +#endif /* CONFIG_MMU */ +  extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];  struct module;  extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,  			 struct m68k_fixup_info *end); -#else - -struct mod_arch_specific { -}; - -#endif /* CONFIG_MMU */ - -#define Elf_Shdr Elf32_Shdr -#define Elf_Sym Elf32_Sym -#define Elf_Ehdr Elf32_Ehdr -  #endif /* _ASM_M68K_MODULE_H */ diff --git a/arch/m68k/include/asm/motorola_pgalloc.h b/arch/m68k/include/asm/motorola_pgalloc.h index 2f02f264e69..24bcba496c7 100644 --- a/arch/m68k/include/asm/motorola_pgalloc.h +++ b/arch/m68k/include/asm/motorola_pgalloc.h @@ -29,18 +29,22 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)  static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)  { -	struct page *page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); +	struct page *page;  	pte_t *pte; +	page = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);  	if(!page)  		return NULL; +	if (!pgtable_page_ctor(page)) { +		__free_page(page); +		return NULL; +	}  	pte = kmap(page);  	__flush_page_to_ram(pte);  	flush_tlb_kernel_page(pte);  	nocache_page(pte);  	kunmap(page); -	pgtable_page_ctor(page);  	return page;  } diff --git a/arch/m68k/include/asm/motorola_pgtable.h b/arch/m68k/include/asm/motorola_pgtable.h index 45bd3f589bf..e0fdd4d0807 100644 --- a/arch/m68k/include/asm/motorola_pgtable.h +++ b/arch/m68k/include/asm/motorola_pgtable.h @@ -8,6 +8,7 @@  #define _PAGE_PRESENT	0x001  #define _PAGE_SHORT	0x002  #define _PAGE_RONLY	0x004 +#define _PAGE_READWRITE	0x000  #define _PAGE_ACCESSED	0x008  #define _PAGE_DIRTY	0x010  #define _PAGE_SUPER	0x080	/* 68040 supervisor only */ diff --git a/arch/m68k/include/asm/msgbuf.h b/arch/m68k/include/asm/msgbuf.h deleted file mode 100644 index 243cb798de8..00000000000 --- a/arch/m68k/include/asm/msgbuf.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _M68K_MSGBUF_H -#define _M68K_MSGBUF_H - -/* - * The msqid64_ds structure for m68k architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct msqid64_ds { -	struct ipc64_perm msg_perm; -	__kernel_time_t msg_stime;	/* last msgsnd time */ -	unsigned long	__unused1; -	__kernel_time_t msg_rtime;	/* last msgrcv time */ -	unsigned long	__unused2; -	__kernel_time_t msg_ctime;	/* last change time */ -	unsigned long	__unused3; -	unsigned long  msg_cbytes;	/* current number of bytes on queue */ -	unsigned long  msg_qnum;	/* number of messages in queue */ -	unsigned long  msg_qbytes;	/* max number of bytes on queue */ -	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */ -	__kernel_pid_t msg_lrpid;	/* last receive pid */ -	unsigned long  __unused4; -	unsigned long  __unused5; -}; - -#endif /* _M68K_MSGBUF_H */ diff --git a/arch/m68k/include/asm/mutex.h b/arch/m68k/include/asm/mutex.h deleted file mode 100644 index 458c1f7fbc1..00000000000 --- a/arch/m68k/include/asm/mutex.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Pull in the generic implementation for the mutex fastpath. - * - * TODO: implement optimized primitives instead, or leave the generic - * implementation in place, or pick the atomic_xchg() based generic - * implementation. (see asm-generic/mutex-xchg.h for details) - */ - -#include <asm-generic/mutex-dec.h> diff --git a/arch/m68k/include/asm/mvme16xhw.h b/arch/m68k/include/asm/mvme16xhw.h index 6117f56653d..1eb89de631e 100644 --- a/arch/m68k/include/asm/mvme16xhw.h +++ b/arch/m68k/include/asm/mvme16xhw.h @@ -3,23 +3,6 @@  #include <asm/irq.h> -/* Board ID data structure - pointer to this retrieved from Bug by head.S */ - -/* Note, bytes 12 and 13 are board no in BCD (0162,0166,0167,0177,etc) */ - -extern long mvme_bdid_ptr; - -typedef struct { -	char	bdid[4]; -	u_char	rev, mth, day, yr; -	u_short	size, reserved; -	u_short	brdno; -	char brdsuffix[2]; -	u_long	options; -	u_short	clun, dlun, ctype, dnum; -	u_long	option2; -} t_bdid, *p_bdid; -  typedef struct {  	u_char	ack_icr, diff --git a/arch/m68k/include/asm/natfeat.h b/arch/m68k/include/asm/natfeat.h new file mode 100644 index 00000000000..a3521b80c3b --- /dev/null +++ b/arch/m68k/include/asm/natfeat.h @@ -0,0 +1,22 @@ +/* + * ARAnyM hardware support via Native Features (natfeats) + * + * Copyright (c) 2005 Petr Stehlik of ARAnyM dev team + * + * This software may be used and distributed according to the terms of + * the GNU General Public License (GPL), incorporated herein by reference. + */ + +#ifndef _NATFEAT_H +#define _NATFEAT_H + +long nf_get_id(const char *feature_name); +long nf_call(long id, ...); + +void nf_init(void); +void nf_shutdown(void); + +void nfprint(const char *fmt, ...) +	__attribute__ ((format (printf, 1, 2))); + +# endif /* _NATFEAT_H */ diff --git a/arch/m68k/include/asm/nettel.h b/arch/m68k/include/asm/nettel.h index 4dec2d9fb99..2a7a7667d80 100644 --- a/arch/m68k/include/asm/nettel.h +++ b/arch/m68k/include/asm/nettel.h @@ -21,6 +21,7 @@  #ifdef CONFIG_COLDFIRE  #include <asm/coldfire.h>  #include <asm/mcfsim.h> +#include <asm/io.h>  #endif  /*---------------------------------------------------------------------------*/ @@ -86,16 +87,12 @@ static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)   */  static __inline__ unsigned int mcf_getppdata(void)  { -	volatile unsigned short *pp; -	pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT); -	return((unsigned int) *pp); +	return readw(MCFSIM_PBDAT);  }  static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)  { -	volatile unsigned short *pp; -	pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PBDAT); -	*pp = (*pp & ~mask) | bits; +	write((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT);  }  #endif diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h index dfebb7c1e37..38b024a0b04 100644 --- a/arch/m68k/include/asm/page.h +++ b/arch/m68k/include/asm/page.h @@ -6,10 +6,10 @@  #include <asm/page_offset.h>  /* PAGE_SHIFT determines the page size */ -#ifndef CONFIG_SUN3 -#define PAGE_SHIFT	(12) +#if defined(CONFIG_SUN3) || defined(CONFIG_COLDFIRE) +#define PAGE_SHIFT	13  #else -#define PAGE_SHIFT	(13) +#define PAGE_SHIFT	12  #endif  #define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)  #define PAGE_MASK	(~(PAGE_SIZE-1)) @@ -36,14 +36,21 @@ typedef struct page *pgtable_t;  #define __pgd(x)	((pgd_t) { (x) } )  #define __pgprot(x)	((pgprot_t) { (x) } ) +extern unsigned long _rambase; +extern unsigned long _ramstart; +extern unsigned long _ramend; +  #endif /* !__ASSEMBLY__ */  #ifdef CONFIG_MMU -#include "page_mm.h" +#include <asm/page_mm.h>  #else -#include "page_no.h" +#include <asm/page_no.h>  #endif +#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \ +				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) +  #include <asm-generic/getorder.h>  #endif /* _M68K_PAGE_H */ diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index 31d5570d656..5029f73e629 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -162,7 +162,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void)  	pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn);		\  })  #define page_to_pfn(_page) ({						\ -	struct page *__p = (_page);					\ +	const struct page *__p = (_page);				\  	struct pglist_data *pgdat;					\  	pgdat = &pg_data_map[page_to_nid(__p)];				\  	((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn;		\ @@ -173,7 +173,4 @@ static inline __attribute_const__ int __virt_to_node_shift(void)  #endif /* __ASSEMBLY__ */ -#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \ -				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -  #endif /* _M68K_PAGE_MM_H */ diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index 90595721185..ef209169579 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h @@ -26,7 +26,7 @@ extern unsigned long memory_end;  #define pfn_to_virt(pfn)	__va((pfn) << PAGE_SHIFT)  #define virt_to_page(addr)	(mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) -#define page_to_virt(page)	((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) +#define page_to_virt(page)	__va(((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET))  #define pfn_to_page(pfn)	virt_to_page(pfn_to_virt(pfn))  #define page_to_pfn(page)	virt_to_pfn(page_to_virt(page)) diff --git a/arch/m68k/include/asm/page_offset.h b/arch/m68k/include/asm/page_offset.h index 1780152d81d..82626a8f1d0 100644 --- a/arch/m68k/include/asm/page_offset.h +++ b/arch/m68k/include/asm/page_offset.h @@ -1,11 +1,9 @@  /* This handles the memory map.. */ -#ifdef CONFIG_MMU -#ifndef CONFIG_SUN3 -#define PAGE_OFFSET_RAW		0x00000000 -#else +#if defined(CONFIG_RAMBASE) +#define PAGE_OFFSET_RAW		CONFIG_RAMBASE +#elif defined(CONFIG_SUN3)  #define PAGE_OFFSET_RAW		0x0E000000 -#endif  #else -#define	PAGE_OFFSET_RAW		CONFIG_RAMBASE +#define PAGE_OFFSET_RAW		0x00000000  #endif diff --git a/arch/m68k/include/asm/param.h b/arch/m68k/include/asm/param.h deleted file mode 100644 index 36265ccf5c7..00000000000 --- a/arch/m68k/include/asm/param.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _M68K_PARAM_H -#define _M68K_PARAM_H - -#ifdef __uClinux__ -#define EXEC_PAGESIZE	4096 -#else -#define EXEC_PAGESIZE	8192 -#endif - -#include <asm-generic/param.h> - -#endif /* _M68K_PARAM_H */ diff --git a/arch/m68k/include/asm/parport.h b/arch/m68k/include/asm/parport.h index 646b1872f73..c85cece778e 100644 --- a/arch/m68k/include/asm/parport.h +++ b/arch/m68k/include/asm/parport.h @@ -11,12 +11,14 @@  #ifndef _ASM_M68K_PARPORT_H  #define _ASM_M68K_PARPORT_H 1 +#undef insl +#undef outsl  #define insl(port,buf,len)   isa_insb(port,buf,(len)<<2)  #define outsl(port,buf,len)  isa_outsb(port,buf,(len)<<2)  /* no dma, or IRQ autoprobing */ -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +static int parport_pc_find_isa_ports (int autoirq, int autodma); +static int parport_pc_find_nonpci_ports (int autoirq, int autodma)  {          if (! (MACH_IS_Q40))  	  return 0; /* count=0 */ diff --git a/arch/m68k/include/asm/pci.h b/arch/m68k/include/asm/pci.h index 4ad0aea48ab..848c3dfaad5 100644 --- a/arch/m68k/include/asm/pci.h +++ b/arch/m68k/include/asm/pci.h @@ -2,6 +2,7 @@  #define _ASM_M68K_PCI_H  #include <asm-generic/pci-dma-compat.h> +#include <asm-generic/pci.h>  /* The PCI address space does equal the physical memory   * address space.  The networking and block device layers use @@ -9,4 +10,9 @@   */  #define PCI_DMA_BUS_IS_PHYS	(1) +#define	pcibios_assign_all_busses()	1 + +#define	PCIBIOS_MIN_IO		0x00000100 +#define	PCIBIOS_MIN_MEM		0x02000000 +  #endif /* _ASM_M68K_PCI_H */ diff --git a/arch/m68k/include/asm/percpu.h b/arch/m68k/include/asm/percpu.h deleted file mode 100644 index 0859d048faf..00000000000 --- a/arch/m68k/include/asm/percpu.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_M68K_PERCPU_H -#define __ASM_M68K_PERCPU_H - -#include <asm-generic/percpu.h> - -#endif	/* __ASM_M68K_PERCPU_H */ diff --git a/arch/m68k/include/asm/pgalloc.h b/arch/m68k/include/asm/pgalloc.h index c294aad8a90..37bee7e3223 100644 --- a/arch/m68k/include/asm/pgalloc.h +++ b/arch/m68k/include/asm/pgalloc.h @@ -7,7 +7,9 @@  #ifdef CONFIG_MMU  #include <asm/virtconvert.h> -#ifdef CONFIG_SUN3 +#if defined(CONFIG_COLDFIRE) +#include <asm/mcf_pgalloc.h> +#elif defined(CONFIG_SUN3)  #include <asm/sun3_pgalloc.h>  #else  #include <asm/motorola_pgalloc.h> diff --git a/arch/m68k/include/asm/pgtable.h b/arch/m68k/include/asm/pgtable.h index ee6759eb445..a3d733b524d 100644 --- a/arch/m68k/include/asm/pgtable.h +++ b/arch/m68k/include/asm/pgtable.h @@ -1,5 +1,5 @@  #ifdef __uClinux__ -#include "pgtable_no.h" +#include <asm/pgtable_no.h>  #else -#include "pgtable_mm.h" +#include <asm/pgtable_mm.h>  #endif diff --git a/arch/m68k/include/asm/pgtable_mm.h b/arch/m68k/include/asm/pgtable_mm.h index 87174c904d2..9f5abbda1ea 100644 --- a/arch/m68k/include/asm/pgtable_mm.h +++ b/arch/m68k/include/asm/pgtable_mm.h @@ -40,6 +40,8 @@  /* PGDIR_SHIFT determines what a third-level page table entry can map */  #ifdef CONFIG_SUN3  #define PGDIR_SHIFT     17 +#elif defined(CONFIG_COLDFIRE) +#define PGDIR_SHIFT     22  #else  #define PGDIR_SHIFT	25  #endif @@ -54,6 +56,10 @@  #define PTRS_PER_PTE   16  #define PTRS_PER_PMD   1  #define PTRS_PER_PGD   2048 +#elif defined(CONFIG_COLDFIRE) +#define PTRS_PER_PTE	512 +#define PTRS_PER_PMD	1 +#define PTRS_PER_PGD	1024  #else  #define PTRS_PER_PTE	1024  #define PTRS_PER_PMD	8 @@ -66,12 +72,22 @@  #ifdef CONFIG_SUN3  #define KMAP_START     0x0DC00000  #define KMAP_END       0x0E000000 +#elif defined(CONFIG_COLDFIRE) +#define KMAP_START	0xe0000000 +#define KMAP_END	0xf0000000  #else  #define	KMAP_START	0xd0000000  #define	KMAP_END	0xf0000000  #endif -#ifndef CONFIG_SUN3 +#ifdef CONFIG_SUN3 +extern unsigned long m68k_vmalloc_end; +#define VMALLOC_START 0x0f800000 +#define VMALLOC_END m68k_vmalloc_end +#elif defined(CONFIG_COLDFIRE) +#define VMALLOC_START	0xd0000000 +#define VMALLOC_END	0xe0000000 +#else  /* Just any arbitrary offset to the start of the vmalloc VM area: the   * current 8MB value just means that there will be a 8MB "hole" after the   * physical memory until the kernel virtual memory starts.  That means that @@ -82,11 +98,7 @@  #define VMALLOC_OFFSET	(8*1024*1024)  #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))  #define VMALLOC_END KMAP_START -#else -extern unsigned long m68k_vmalloc_end; -#define VMALLOC_START 0x0f800000 -#define VMALLOC_END m68k_vmalloc_end -#endif /* CONFIG_SUN3 */ +#endif  /* zero page used for uninitialized stuff */  extern void *empty_zero_page; @@ -123,13 +135,12 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,  #define kern_addr_valid(addr)	(1) -#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)		\ -		remap_pfn_range(vma, vaddr, pfn, size, prot) -  /* MMU-specific headers */  #ifdef CONFIG_SUN3  #include <asm/sun3_pgtable.h> +#elif defined(CONFIG_COLDFIRE) +#include <asm/mcf_pgtable.h>  #else  #include <asm/motorola_pgtable.h>  #endif @@ -138,6 +149,9 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,  /*   * Macro to mark a page protection value as "uncacheable".   */ +#ifdef CONFIG_COLDFIRE +# define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | CF_PAGE_NOCACHE)) +#else  #ifdef SUN3_PAGE_NOCACHE  # define __SUN3_PAGE_NOCACHE	SUN3_PAGE_NOCACHE  #else @@ -152,6 +166,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,  	    ? (__pgprot((pgprot_val(prot) & _CACHEMASK040) | _PAGE_NOCACHE_S))	\  	    : (prot))) +#endif /* CONFIG_COLDFIRE */  #include <asm-generic/pgtable.h>  #endif /* !__ASSEMBLY__ */ diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h index bf86b29fe64..c527fc2ecf8 100644 --- a/arch/m68k/include/asm/pgtable_no.h +++ b/arch/m68k/include/asm/pgtable_no.h @@ -55,15 +55,14 @@ extern unsigned int kobjsize(const void *objp);   */  #define pgtable_cache_init()	do { } while (0) -#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)		\ -		remap_pfn_range(vma, vaddr, pfn, size, prot) -  /*   * All 32bit addresses are effectively valid for vmalloc...   * Sort of meaningless for non-VM targets.   */  #define	VMALLOC_START	0  #define	VMALLOC_END	0xffffffff +#define	KMAP_START	0 +#define	KMAP_END	0xffffffff  #include <asm-generic/pgtable.h> diff --git a/arch/m68k/include/asm/pinmux.h b/arch/m68k/include/asm/pinmux.h deleted file mode 100644 index 119ee686dbd..00000000000 --- a/arch/m68k/include/asm/pinmux.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Coldfire generic GPIO pinmux support. - * - * (C) Copyright 2009, Steven King <sfking@fdwdc.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the - * GNU General Public License for more details. - */ - -#ifndef pinmux_h -#define pinmux_h - -#define MCFPINMUX_NONE		-1 - -extern int mcf_pinmux_request(unsigned, unsigned); -extern void mcf_pinmux_release(unsigned, unsigned); - -static inline int mcf_pinmux_is_valid(unsigned pinmux) -{ -	return pinmux != MCFPINMUX_NONE; -} - -#endif - diff --git a/arch/m68k/include/asm/poll.h b/arch/m68k/include/asm/poll.h deleted file mode 100644 index f080fcdb61b..00000000000 --- a/arch/m68k/include/asm/poll.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __m68k_POLL_H -#define __m68k_POLL_H - -#define POLLWRNORM	POLLOUT -#define POLLWRBAND	256 - -#include <asm-generic/poll.h> - -#endif diff --git a/arch/m68k/include/asm/posix_types.h b/arch/m68k/include/asm/posix_types.h deleted file mode 100644 index 63cdcc142d9..00000000000 --- a/arch/m68k/include/asm/posix_types.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ARCH_M68K_POSIX_TYPES_H -#define __ARCH_M68K_POSIX_TYPES_H - -/* - * This file is generally used by user-level software, so you need to - * be a little careful about namespace pollution etc.  Also, we cannot - * assume GCC is being used. - */ - -typedef unsigned long	__kernel_ino_t; -typedef unsigned short	__kernel_mode_t; -typedef unsigned short	__kernel_nlink_t; -typedef long		__kernel_off_t; -typedef int		__kernel_pid_t; -typedef unsigned short	__kernel_ipc_pid_t; -typedef unsigned short	__kernel_uid_t; -typedef unsigned short	__kernel_gid_t; -typedef unsigned int	__kernel_size_t; -typedef int		__kernel_ssize_t; -typedef int		__kernel_ptrdiff_t; -typedef long		__kernel_time_t; -typedef long		__kernel_suseconds_t; -typedef long		__kernel_clock_t; -typedef int		__kernel_timer_t; -typedef int		__kernel_clockid_t; -typedef int		__kernel_daddr_t; -typedef char *		__kernel_caddr_t; -typedef unsigned short	__kernel_uid16_t; -typedef unsigned short	__kernel_gid16_t; -typedef unsigned int	__kernel_uid32_t; -typedef unsigned int	__kernel_gid32_t; - -typedef unsigned short	__kernel_old_uid_t; -typedef unsigned short	__kernel_old_gid_t; -typedef unsigned short	__kernel_old_dev_t; - -#ifdef __GNUC__ -typedef long long	__kernel_loff_t; -#endif - -typedef struct { -	int	val[2]; -} __kernel_fsid_t; - -#if defined(__KERNEL__) - -#undef	__FD_SET -#define	__FD_SET(d, set)	((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) - -#undef	__FD_CLR -#define	__FD_CLR(d, set)	((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) - -#undef	__FD_ISSET -#define	__FD_ISSET(d, set)	((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) - -#undef	__FD_ZERO -#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) - -#endif /* defined(__KERNEL__) */ - -#endif diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h index 7a6a7590cc0..b0768a65792 100644 --- a/arch/m68k/include/asm/processor.h +++ b/arch/m68k/include/asm/processor.h @@ -20,23 +20,26 @@  static inline unsigned long rdusp(void)  { -#ifdef CONFIG_COLDFIRE +#ifdef CONFIG_COLDFIRE_SW_A7  	extern unsigned int sw_usp;  	return sw_usp;  #else -	unsigned long usp; -	__asm__ __volatile__("move %/usp,%0" : "=a" (usp)); +	register unsigned long usp __asm__("a0"); +	/* move %usp,%a0 */ +	__asm__ __volatile__(".word 0x4e68" : "=a" (usp));  	return usp;  #endif  }  static inline void wrusp(unsigned long usp)  { -#ifdef CONFIG_COLDFIRE +#ifdef CONFIG_COLDFIRE_SW_A7  	extern unsigned int sw_usp;  	sw_usp = usp;  #else -	__asm__ __volatile__("move %0,%/usp" : : "a" (usp)); +	register unsigned long a0 __asm__("a0") = usp; +	/* move %a0,%usp */ +	__asm__ __volatile__(".word 0x4e60" : : "a" (a0) );  #endif  } @@ -45,10 +48,12 @@ static inline void wrusp(unsigned long usp)   * so don't change it unless you know what you are doing.   */  #ifdef CONFIG_MMU -#ifndef CONFIG_SUN3 -#define TASK_SIZE	(0xF0000000UL) -#else +#if defined(CONFIG_COLDFIRE) +#define TASK_SIZE	(0xC0000000UL) +#elif defined(CONFIG_SUN3)  #define TASK_SIZE	(0x0E000000UL) +#else +#define TASK_SIZE	(0xF0000000UL)  #endif  #else  #define TASK_SIZE	(0xFFFFFFFFUL) @@ -63,10 +68,12 @@ static inline void wrusp(unsigned long usp)   * space during mmap's.   */  #ifdef CONFIG_MMU -#ifndef CONFIG_SUN3 -#define TASK_UNMAPPED_BASE	0xC0000000UL -#else +#if defined(CONFIG_COLDFIRE) +#define TASK_UNMAPPED_BASE	0x60000000UL +#elif defined(CONFIG_SUN3)  #define TASK_UNMAPPED_BASE	0x0A000000UL +#else +#define TASK_UNMAPPED_BASE	0xC0000000UL  #endif  #define TASK_UNMAPPED_ALIGN(addr, off)	PAGE_ALIGN(addr)  #else @@ -85,16 +92,24 @@ struct thread_struct {  	unsigned long  fp[8*3];  	unsigned long  fpcntl[3];	/* fp control regs */  	unsigned char  fpstate[FPSTATESIZE];  /* floating point state */ -	struct thread_info info;  };  #define INIT_THREAD  {							\  	.ksp	= sizeof(init_stack) + (unsigned long) init_stack,	\  	.sr	= PS_S,							\  	.fs	= __KERNEL_DS,						\ -	.info	= INIT_THREAD_INFO(init_task),				\  } +/* + * ColdFire stack format sbould be 0x4 for an aligned usp (will always be + * true on thread creation). We need to set this explicitly. + */ +#ifdef CONFIG_COLDFIRE +#define setframeformat(_regs)	do { (_regs)->format = 0x4; } while(0) +#else +#define setframeformat(_regs)	do { } while (0) +#endif +  #ifdef CONFIG_MMU  /*   * Do necessary setup to start up a newly executed thread. @@ -102,38 +117,32 @@ struct thread_struct {  static inline void start_thread(struct pt_regs * regs, unsigned long pc,  				unsigned long usp)  { -	/* reads from user space */ -	set_fs(USER_DS); -  	regs->pc = pc;  	regs->sr &= ~0x2000; +	setframeformat(regs);  	wrusp(usp);  } -#else +extern int handle_kernel_fault(struct pt_regs *regs); -/* - * Coldfire stacks need to be re-aligned on trap exit, conventional - * 68k can handle this case cleanly. - */ -#ifdef CONFIG_COLDFIRE -#define reformat(_regs)		do { (_regs)->format = 0x4; } while(0)  #else -#define reformat(_regs)		do { } while (0) -#endif  #define start_thread(_regs, _pc, _usp)                  \  do {                                                    \ -	set_fs(USER_DS); /* reads from user space */    \  	(_regs)->pc = (_pc);                            \ -	((struct switch_stack *)(_regs))[-1].a6 = 0;    \ -	reformat(_regs);                                \ +	setframeformat(_regs);                          \  	if (current->mm)                                \  		(_regs)->d5 = current->mm->start_data;  \  	(_regs)->sr &= ~0x2000;                         \  	wrusp(_usp);                                    \  } while(0) +static inline  int handle_kernel_fault(struct pt_regs *regs) +{ +	/* Any fault in kernel is fatal on non-mmu */ +	return 0; +} +  #endif  /* Forward declaration, a strange C thing */ @@ -144,11 +153,6 @@ static inline void release_thread(struct task_struct *dead_task)  {  } -/* Prepare to copy thread state - unlazy all lazy status */ -#define prepare_to_copy(tsk)	do { } while (0) - -extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -  /*   * Free current thread data structures etc..   */ diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index 6e6e3ac1d91..a45cb6894ad 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h @@ -1,82 +1,10 @@  #ifndef _M68K_PTRACE_H  #define _M68K_PTRACE_H -#define PT_D1	   0 -#define PT_D2	   1 -#define PT_D3	   2 -#define PT_D4	   3 -#define PT_D5	   4 -#define PT_D6	   5 -#define PT_D7	   6 -#define PT_A0	   7 -#define PT_A1	   8 -#define PT_A2	   9 -#define PT_A3	   10 -#define PT_A4	   11 -#define PT_A5	   12 -#define PT_A6	   13 -#define PT_D0	   14 -#define PT_USP	   15 -#define PT_ORIG_D0 16 -#define PT_SR	   17 -#define PT_PC	   18 +#include <uapi/asm/ptrace.h>  #ifndef __ASSEMBLY__ -/* this struct defines the way the registers are stored on the -   stack during a system call. */ - -struct pt_regs { -  long     d1; -  long     d2; -  long     d3; -  long     d4; -  long     d5; -  long     a0; -  long     a1; -  long     a2; -  long     d0; -  long     orig_d0; -  long     stkadj; -#ifdef CONFIG_COLDFIRE -  unsigned format :  4; /* frame format specifier */ -  unsigned vector : 12; /* vector offset */ -  unsigned short sr; -  unsigned long  pc; -#else -  unsigned short sr; -  unsigned long  pc; -  unsigned format :  4; /* frame format specifier */ -  unsigned vector : 12; /* vector offset */ -#endif -}; - -/* - * This is the extended stack used by signal handlers and the context - * switcher: it's pushed after the normal "struct pt_regs". - */ -struct switch_stack { -	unsigned long  d6; -	unsigned long  d7; -	unsigned long  a3; -	unsigned long  a4; -	unsigned long  a5; -	unsigned long  a6; -	unsigned long  retpc; -}; - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS            12 -#define PTRACE_SETREGS            13 -#define PTRACE_GETFPREGS          14 -#define PTRACE_SETFPREGS          15 - -#define PTRACE_GET_THREAD_AREA    25 - -#define PTRACE_SINGLEBLOCK	33	/* resume execution until next branch */ - -#ifdef __KERNEL__ -  #ifndef PS_S  #define PS_S  (0x2000)  #define PS_M  (0x1000) @@ -85,7 +13,9 @@ struct switch_stack {  #define user_mode(regs) (!((regs)->sr & PS_S))  #define instruction_pointer(regs) ((regs)->pc)  #define profile_pc(regs) instruction_pointer(regs) -extern void show_regs(struct pt_regs *); +#define current_pt_regs() \ +	(struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1 +#define current_user_stack_pointer() rdusp()  #define arch_has_single_step()	(1) @@ -93,6 +23,5 @@ extern void show_regs(struct pt_regs *);  #define arch_has_block_step()	(1)  #endif -#endif /* __KERNEL__ */  #endif /* __ASSEMBLY__ */  #endif /* _M68K_PTRACE_H */ diff --git a/arch/m68k/include/asm/q40_master.h b/arch/m68k/include/asm/q40_master.h index 3907a09d4fc..fc5b36278d0 100644 --- a/arch/m68k/include/asm/q40_master.h +++ b/arch/m68k/include/asm/q40_master.h @@ -60,7 +60,7 @@  #define Q40_RTC_WRITE  128  /* define some Q40 specific ints */ -#include "q40ints.h" +#include <asm/q40ints.h>  /* misc defs */  #define DAC_LEFT  ((unsigned char *)0xff008000) diff --git a/arch/m68k/include/asm/q40ints.h b/arch/m68k/include/asm/q40ints.h index 3d970afb708..22f12c9eb91 100644 --- a/arch/m68k/include/asm/q40ints.h +++ b/arch/m68k/include/asm/q40ints.h @@ -24,6 +24,3 @@  #define Q40_IRQ10_MASK       (1<<5)  #define Q40_IRQ14_MASK       (1<<6)  #define Q40_IRQ15_MASK       (1<<7) - -extern unsigned long q40_probe_irq_on (void); -extern int q40_probe_irq_off (unsigned long irqs); diff --git a/arch/m68k/include/asm/raw_io.h b/arch/m68k/include/asm/raw_io.h index d9eb9834ccc..932faa35655 100644 --- a/arch/m68k/include/asm/raw_io.h +++ b/arch/m68k/include/asm/raw_io.h @@ -10,7 +10,7 @@  #ifdef __KERNEL__ -#include <asm/types.h> +#include <asm/byteorder.h>  /* Values for nocacheflag and cmode */ @@ -60,6 +60,57 @@ extern void __iounmap(void *addr, unsigned long size);  #define __raw_writew(val,addr) out_be16((addr),(val))  #define __raw_writel(val,addr) out_be32((addr),(val)) +/* + * Atari ROM port (cartridge port) ISA adapter, used for the EtherNEC NE2000 + * network card driver. + * The ISA adapter connects address lines A9-A13 to ISA address lines A0-A4, + * and hardwires the rest of the ISA addresses for a base address of 0x300. + * + * Data lines D8-D15 are connected to ISA data lines D0-D7 for reading. + * For writes, address lines A1-A8 are latched to ISA data lines D0-D7 + * (meaning the bit pattern on A1-A8 can be read back as byte). + * + * Read and write operations are distinguished by the base address used: + * reads are from the ROM A side range, writes are through the B side range + * addresses (A side base + 0x10000). + * + * Reads and writes are byte only. + * + * 16 bit reads and writes are necessary for the NetUSBee adapter's USB + * chipset - 16 bit words are read straight off the ROM port while 16 bit + * reads are split into two byte writes. The low byte is latched to the + * NetUSBee buffer by a read from the _read_ window (with the data pattern + * asserted as A1-A8 address pattern). The high byte is then written to the + * write range as usual, completing the write cycle. + */ + +#if defined(CONFIG_ATARI_ROM_ISA) +#define rom_in_8(addr) \ +	({ u16 __v = (*(__force volatile u16 *) (addr)); __v >>= 8; __v; }) +#define rom_in_be16(addr) \ +	({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) +#define rom_in_le16(addr) \ +	({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) + +#define rom_out_8(addr, b)	\ +	({u8 __w, __v = (b);  u32 _addr = ((u32) (addr)); \ +	__w = ((*(__force volatile u8 *)  ((_addr | 0x10000) + (__v<<1)))); }) +#define rom_out_be16(addr, w)	\ +	({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \ +	__w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v & 0xFF)<<1)))); \ +	__w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v >> 8)<<1)))); }) +#define rom_out_le16(addr, w)	\ +	({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \ +	__w = ((*(__force volatile u16 *) ((_addr & 0xFFFF0000UL) + ((__v >> 8)<<1)))); \ +	__w = ((*(__force volatile u16 *) ((_addr | 0x10000) + ((__v & 0xFF)<<1)))); }) + +#define raw_rom_inb rom_in_8 +#define raw_rom_inw rom_in_be16 + +#define raw_rom_outb(val, port) rom_out_8((port), (val)) +#define raw_rom_outw(val, port) rom_out_be16((port), (val)) +#endif /* CONFIG_ATARI_ROM_ISA */ +  static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len)  {  	unsigned int i; @@ -342,6 +393,62 @@ static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf,  		: "d0", "a0", "a1", "d6");  } + +#if defined(CONFIG_ATARI_ROM_ISA) +static inline void raw_rom_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) +{ +	unsigned int i; + +	for (i = 0; i < len; i++) +		*buf++ = rom_in_8(port); +} + +static inline void raw_rom_outsb(volatile u8 __iomem *port, const u8 *buf, +			     unsigned int len) +{ +	unsigned int i; + +	for (i = 0; i < len; i++) +		rom_out_8(port, *buf++); +} + +static inline void raw_rom_insw(volatile u16 __iomem *port, u16 *buf, +				   unsigned int nr) +{ +	unsigned int i; + +	for (i = 0; i < nr; i++) +		*buf++ = rom_in_be16(port); +} + +static inline void raw_rom_outsw(volatile u16 __iomem *port, const u16 *buf, +				   unsigned int nr) +{ +	unsigned int i; + +	for (i = 0; i < nr; i++) +		rom_out_be16(port, *buf++); +} + +static inline void raw_rom_insw_swapw(volatile u16 __iomem *port, u16 *buf, +				   unsigned int nr) +{ +	unsigned int i; + +	for (i = 0; i < nr; i++) +		*buf++ = rom_in_le16(port); +} + +static inline void raw_rom_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, +				   unsigned int nr) +{ +	unsigned int i; + +	for (i = 0; i < nr; i++) +		rom_out_le16(port, *buf++); +} +#endif /* CONFIG_ATARI_ROM_ISA */ +  #endif /* __KERNEL__ */  #endif /* _RAW_IO_H */ diff --git a/arch/m68k/include/asm/resource.h b/arch/m68k/include/asm/resource.h deleted file mode 100644 index e7d35019f33..00000000000 --- a/arch/m68k/include/asm/resource.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_RESOURCE_H -#define _M68K_RESOURCE_H - -#include <asm-generic/resource.h> - -#endif /* _M68K_RESOURCE_H */ diff --git a/arch/m68k/include/asm/sbus.h b/arch/m68k/include/asm/sbus.h deleted file mode 100644 index bfe3ba147f2..00000000000 --- a/arch/m68k/include/asm/sbus.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * some sbus structures and macros to make usage of sbus drivers possible - */ - -#ifndef __M68K_SBUS_H -#define __M68K_SBUS_H - -struct sbus_dev { -	struct { -		unsigned int which_io; -		unsigned int phys_addr; -	} reg_addrs[1]; -}; - -/* sbus IO functions stolen from include/asm-sparc/io.h for the serial driver */ -/* No SBUS on the Sun3, kludge -- sam */ - -static inline void _sbus_writeb(unsigned char val, unsigned long addr) -{ -	*(volatile unsigned char *)addr = val; -} - -static inline unsigned char _sbus_readb(unsigned long addr) -{ -	return *(volatile unsigned char *)addr; -} - -static inline void _sbus_writel(unsigned long val, unsigned long addr) -{ -	*(volatile unsigned long *)addr = val; - -} - -extern inline unsigned long _sbus_readl(unsigned long addr) -{ -	return *(volatile unsigned long *)addr; -} - - -#define sbus_readb(a) _sbus_readb((unsigned long)a) -#define sbus_writeb(v, a) _sbus_writeb(v, (unsigned long)a) -#define sbus_readl(a) _sbus_readl((unsigned long)a) -#define sbus_writel(v, a) _sbus_writel(v, (unsigned long)a) - -#endif diff --git a/arch/m68k/include/asm/scatterlist.h b/arch/m68k/include/asm/scatterlist.h deleted file mode 100644 index 312505452a1..00000000000 --- a/arch/m68k/include/asm/scatterlist.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_SCATTERLIST_H -#define _M68K_SCATTERLIST_H - -#include <asm-generic/scatterlist.h> - -#endif /* !(_M68K_SCATTERLIST_H) */ diff --git a/arch/m68k/include/asm/sections.h b/arch/m68k/include/asm/sections.h deleted file mode 100644 index d64967ecfec..00000000000 --- a/arch/m68k/include/asm/sections.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_M68K_SECTIONS_H -#define _ASM_M68K_SECTIONS_H - -#include <asm-generic/sections.h> - -#endif /* _ASM_M68K_SECTIONS_H */ diff --git a/arch/m68k/include/asm/segment.h b/arch/m68k/include/asm/segment.h index ee959219fdf..0fa80e97ed2 100644 --- a/arch/m68k/include/asm/segment.h +++ b/arch/m68k/include/asm/segment.h @@ -22,23 +22,26 @@ typedef struct {  } mm_segment_t;  #define MAKE_MM_SEG(s)	((mm_segment_t) { (s) }) -#define USER_DS		MAKE_MM_SEG(__USER_DS) -#define KERNEL_DS	MAKE_MM_SEG(__KERNEL_DS) +#ifdef CONFIG_CPU_HAS_ADDRESS_SPACES  /*   * Get/set the SFC/DFC registers for MOVES instructions   */ +#define USER_DS		MAKE_MM_SEG(__USER_DS) +#define KERNEL_DS	MAKE_MM_SEG(__KERNEL_DS)  static inline mm_segment_t get_fs(void)  { -#ifdef CONFIG_MMU  	mm_segment_t _v;  	__asm__ ("movec %/dfc,%0":"=r" (_v.seg):); -  	return _v; -#else -	return USER_DS; -#endif +} + +static inline void set_fs(mm_segment_t val) +{ +	__asm__ __volatile__ ("movec %0,%/sfc\n\t" +			      "movec %0,%/dfc\n\t" +			      : /* no outputs */ : "r" (val.seg) : "memory");  }  static inline mm_segment_t get_ds(void) @@ -47,14 +50,13 @@ static inline mm_segment_t get_ds(void)      return KERNEL_DS;  } -static inline void set_fs(mm_segment_t val) -{ -#ifdef CONFIG_MMU -	__asm__ __volatile__ ("movec %0,%/sfc\n\t" -			      "movec %0,%/dfc\n\t" -			      : /* no outputs */ : "r" (val.seg) : "memory"); +#else +#define USER_DS		MAKE_MM_SEG(TASK_SIZE) +#define KERNEL_DS	MAKE_MM_SEG(0xFFFFFFFF) +#define get_ds()	(KERNEL_DS) +#define get_fs()	(current_thread_info()->addr_limit) +#define set_fs(x)	(current_thread_info()->addr_limit = (x))  #endif -}  #define segment_eq(a,b)	((a).seg == (b).seg) diff --git a/arch/m68k/include/asm/sembuf.h b/arch/m68k/include/asm/sembuf.h deleted file mode 100644 index 2308052a8c2..00000000000 --- a/arch/m68k/include/asm/sembuf.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _M68K_SEMBUF_H -#define _M68K_SEMBUF_H - -/* - * The semid64_ds structure for m68k architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct semid64_ds { -	struct ipc64_perm sem_perm;		/* permissions .. see ipc.h */ -	__kernel_time_t	sem_otime;		/* last semop time */ -	unsigned long	__unused1; -	__kernel_time_t	sem_ctime;		/* last change time */ -	unsigned long	__unused2; -	unsigned long	sem_nsems;		/* no. of semaphores in array */ -	unsigned long	__unused3; -	unsigned long	__unused4; -}; - -#endif /* _M68K_SEMBUF_H */ diff --git a/arch/m68k/include/asm/serial.h b/arch/m68k/include/asm/serial.h index 2b90d6e6907..7267536adbc 100644 --- a/arch/m68k/include/asm/serial.h +++ b/arch/m68k/include/asm/serial.h @@ -25,9 +25,11 @@  #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF  #endif +#ifdef CONFIG_ISA  #define SERIAL_PORT_DFNS			\  	/* UART CLK   PORT IRQ     FLAGS        */			\  	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\  	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\  	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\  	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */ +#endif diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h index 4dfb3952b37..8f2023f8c1c 100644 --- a/arch/m68k/include/asm/setup.h +++ b/arch/m68k/include/asm/setup.h @@ -19,32 +19,13 @@  **   Redesign of the boot information structure; moved boot information  **   structure to bootinfo.h  */ -  #ifndef _M68K_SETUP_H  #define _M68K_SETUP_H +#include <uapi/asm/bootinfo.h> +#include <uapi/asm/setup.h> -    /* -     *  Linux/m68k Architectures -     */ - -#define MACH_AMIGA    1 -#define MACH_ATARI    2 -#define MACH_MAC      3 -#define MACH_APOLLO   4 -#define MACH_SUN3     5 -#define MACH_MVME147  6 -#define MACH_MVME16x  7 -#define MACH_BVME6000 8 -#define MACH_HP300    9 -#define MACH_Q40     10 -#define MACH_SUN3X   11 - -#define COMMAND_LINE_SIZE 256 - -#ifdef __KERNEL__ -  #define CL_SIZE COMMAND_LINE_SIZE  #ifndef __ASSEMBLY__ @@ -193,57 +174,6 @@ extern unsigned long m68k_machtype;  #  define MACH_TYPE (m68k_machtype)  #endif -#endif /* __KERNEL__ */ - - -    /* -     *  CPU, FPU and MMU types -     * -     *  Note: we may rely on the following equalities: -     * -     *      CPU_68020 == MMU_68851 -     *      CPU_68030 == MMU_68030 -     *      CPU_68040 == FPU_68040 == MMU_68040 -     *      CPU_68060 == FPU_68060 == MMU_68060 -     */ - -#define CPUB_68020     0 -#define CPUB_68030     1 -#define CPUB_68040     2 -#define CPUB_68060     3 - -#define CPU_68020      (1<<CPUB_68020) -#define CPU_68030      (1<<CPUB_68030) -#define CPU_68040      (1<<CPUB_68040) -#define CPU_68060      (1<<CPUB_68060) - -#define FPUB_68881     0 -#define FPUB_68882     1 -#define FPUB_68040     2                       /* Internal FPU */ -#define FPUB_68060     3                       /* Internal FPU */ -#define FPUB_SUNFPA    4                       /* Sun-3 FPA */ - -#define FPU_68881      (1<<FPUB_68881) -#define FPU_68882      (1<<FPUB_68882) -#define FPU_68040      (1<<FPUB_68040) -#define FPU_68060      (1<<FPUB_68060) -#define FPU_SUNFPA     (1<<FPUB_SUNFPA) - -#define MMUB_68851     0 -#define MMUB_68030     1                       /* Internal MMU */ -#define MMUB_68040     2                       /* Internal MMU */ -#define MMUB_68060     3                       /* Internal MMU */ -#define MMUB_APOLLO    4                       /* Custom Apollo */ -#define MMUB_SUN3      5                       /* Custom Sun-3 */ - -#define MMU_68851      (1<<MMUB_68851) -#define MMU_68030      (1<<MMUB_68030) -#define MMU_68040      (1<<MMUB_68040) -#define MMU_68060      (1<<MMUB_68060) -#define MMU_SUN3       (1<<MMUB_SUN3) -#define MMU_APOLLO     (1<<MMUB_APOLLO) - -#ifdef __KERNEL__  #ifndef __ASSEMBLY__  extern unsigned long m68k_cputype; @@ -341,6 +271,13 @@ extern int m68k_is040or060;  #  endif  #endif +#if !defined(CONFIG_COLDFIRE) +#  define CPU_IS_COLDFIRE (0) +#else +#  define CPU_IS_COLDFIRE (1) +#  define MMU_IS_COLDFIRE (1) +#endif +  #define CPU_TYPE (m68k_cputype)  #ifdef CONFIG_M68KFPU_EMU @@ -361,16 +298,14 @@ extern int m68k_is040or060;  #define NUM_MEMINFO	4  #ifndef __ASSEMBLY__ -struct mem_info { +struct m68k_mem_info {  	unsigned long addr;		/* physical address of memory chunk */  	unsigned long size;		/* length of memory chunk (in bytes) */  };  extern int m68k_num_memory;		/* # of memory blocks found (and used) */  extern int m68k_realnum_memory;		/* real # of memory blocks found */ -extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ +extern struct m68k_mem_info m68k_memory[NUM_MEMINFO];/* memory description */  #endif -#endif /* __KERNEL__ */ -  #endif /* _M68K_SETUP_H */ diff --git a/arch/m68k/include/asm/shm.h b/arch/m68k/include/asm/shm.h deleted file mode 100644 index fa56ec84a12..00000000000 --- a/arch/m68k/include/asm/shm.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _M68K_SHM_H -#define _M68K_SHM_H - - -/* format of page table entries that correspond to shared memory pages -   currently out in swap space (see also mm/swap.c): -   bits 0-1 (PAGE_PRESENT) is  = 0 -   bits 8..2 (SWP_TYPE) are = SHM_SWP_TYPE -   bits 31..9 are used like this: -   bits 15..9 (SHM_ID) the id of the shared memory segment -   bits 30..16 (SHM_IDX) the index of the page within the shared memory segment -                    (actually only bits 25..16 get used since SHMMAX is so low) -   bit 31 (SHM_READ_ONLY) flag whether the page belongs to a read-only attach -*/ -/* on the m68k both bits 0 and 1 must be zero */ -/* format on the sun3 is similar, but bits 30, 31 are set to zero and all -   others are reduced by 2. --m */ - -#ifndef CONFIG_SUN3 -#define SHM_ID_SHIFT	9 -#else -#define SHM_ID_SHIFT	7 -#endif -#define _SHM_ID_BITS	7 -#define SHM_ID_MASK	((1<<_SHM_ID_BITS)-1) - -#define SHM_IDX_SHIFT	(SHM_ID_SHIFT+_SHM_ID_BITS) -#define _SHM_IDX_BITS	15 -#define SHM_IDX_MASK	((1<<_SHM_IDX_BITS)-1) - -#endif /* _M68K_SHM_H */ diff --git a/arch/m68k/include/asm/shmbuf.h b/arch/m68k/include/asm/shmbuf.h deleted file mode 100644 index f8928d62f1b..00000000000 --- a/arch/m68k/include/asm/shmbuf.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _M68K_SHMBUF_H -#define _M68K_SHMBUF_H - -/* - * The shmid64_ds structure for m68k architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct shmid64_ds { -	struct ipc64_perm	shm_perm;	/* operation perms */ -	size_t			shm_segsz;	/* size of segment (bytes) */ -	__kernel_time_t		shm_atime;	/* last attach time */ -	unsigned long		__unused1; -	__kernel_time_t		shm_dtime;	/* last detach time */ -	unsigned long		__unused2; -	__kernel_time_t		shm_ctime;	/* last change time */ -	unsigned long		__unused3; -	__kernel_pid_t		shm_cpid;	/* pid of creator */ -	__kernel_pid_t		shm_lpid;	/* pid of last operator */ -	unsigned long		shm_nattch;	/* no. of current attaches */ -	unsigned long		__unused4; -	unsigned long		__unused5; -}; - -struct shminfo64 { -	unsigned long	shmmax; -	unsigned long	shmmin; -	unsigned long	shmmni; -	unsigned long	shmseg; -	unsigned long	shmall; -	unsigned long	__unused1; -	unsigned long	__unused2; -	unsigned long	__unused3; -	unsigned long	__unused4; -}; - -#endif /* _M68K_SHMBUF_H */ diff --git a/arch/m68k/include/asm/shmparam.h b/arch/m68k/include/asm/shmparam.h deleted file mode 100644 index 558892a2efb..00000000000 --- a/arch/m68k/include/asm/shmparam.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_SHMPARAM_H -#define _M68K_SHMPARAM_H - -#define	SHMLBA PAGE_SIZE		 /* attach addr a multiple of this */ - -#endif /* _M68K_SHMPARAM_H */ diff --git a/arch/m68k/include/asm/sigcontext.h b/arch/m68k/include/asm/sigcontext.h deleted file mode 100644 index a29dd74a17c..00000000000 --- a/arch/m68k/include/asm/sigcontext.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _ASM_M68k_SIGCONTEXT_H -#define _ASM_M68k_SIGCONTEXT_H - -struct sigcontext { -	unsigned long  sc_mask;		/* old sigmask */ -	unsigned long  sc_usp;		/* old user stack pointer */ -	unsigned long  sc_d0; -	unsigned long  sc_d1; -	unsigned long  sc_a0; -	unsigned long  sc_a1; -#ifdef __uClinux__ -	unsigned long  sc_a5; -#endif -	unsigned short sc_sr; -	unsigned long  sc_pc; -	unsigned short sc_formatvec; -#ifndef __uClinux__ -# ifdef __mcoldfire__ -	unsigned long  sc_fpregs[2][2];	/* room for two fp registers */ -# else -	unsigned long  sc_fpregs[2*3];  /* room for two fp registers */ -# endif -	unsigned long  sc_fpcntl[3]; -	unsigned char  sc_fpstate[216]; -#endif -}; - -#endif diff --git a/arch/m68k/include/asm/siginfo.h b/arch/m68k/include/asm/siginfo.h deleted file mode 100644 index 851d3d784b5..00000000000 --- a/arch/m68k/include/asm/siginfo.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_SIGINFO_H -#define _M68K_SIGINFO_H - -#include <asm-generic/siginfo.h> - -#endif diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h index 5bc09c787a1..8c8ce5e1ee0 100644 --- a/arch/m68k/include/asm/signal.h +++ b/arch/m68k/include/asm/signal.h @@ -1,12 +1,8 @@  #ifndef _M68K_SIGNAL_H  #define _M68K_SIGNAL_H -#include <linux/types.h> +#include <uapi/asm/signal.h> -/* Avoid too many header ordering problems.  */ -struct siginfo; - -#ifdef __KERNEL__  /* Most things should be clean enough to redefine this at will, if care     is taken to make libc match.  */ @@ -20,143 +16,17 @@ typedef struct {  	unsigned long sig[_NSIG_WORDS];  } sigset_t; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -#define NSIG		32 -typedef unsigned long sigset_t; - -#endif /* __KERNEL__ */ - -#define SIGHUP		 1 -#define SIGINT		 2 -#define SIGQUIT		 3 -#define SIGILL		 4 -#define SIGTRAP		 5 -#define SIGABRT		 6 -#define SIGIOT		 6 -#define SIGBUS		 7 -#define SIGFPE		 8 -#define SIGKILL		 9 -#define SIGUSR1		10 -#define SIGSEGV		11 -#define SIGUSR2		12 -#define SIGPIPE		13 -#define SIGALRM		14 -#define SIGTERM		15 -#define SIGSTKFLT	16 -#define SIGCHLD		17 -#define SIGCONT		18 -#define SIGSTOP		19 -#define SIGTSTP		20 -#define SIGTTIN		21 -#define SIGTTOU		22 -#define SIGURG		23 -#define SIGXCPU		24 -#define SIGXFSZ		25 -#define SIGVTALRM	26 -#define SIGPROF		27 -#define SIGWINCH	28 -#define SIGIO		29 -#define SIGPOLL		SIGIO -/* -#define SIGLOST		29 -*/ -#define SIGPWR		30 -#define SIGSYS		31 -#define	SIGUNUSED	31 - -/* These should not be considered constants from userland.  */ -#define SIGRTMIN	32 -#define SIGRTMAX	_NSIG - -/* - * SA_FLAGS values: - * - * SA_ONSTACK indicates that a registered stack_t will be used. - * SA_RESTART flag to get restarting signals (which were the default long ago) - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. - * SA_RESETHAND clears the handler when the signal is delivered. - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. - * SA_NODEFER prevents the current signal from being masked in the handler. - * - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single - * Unix names RESETHAND and NODEFER respectively. - */ -#define SA_NOCLDSTOP	0x00000001 -#define SA_NOCLDWAIT	0x00000002 -#define SA_SIGINFO	0x00000004 -#define SA_ONSTACK	0x08000000 -#define SA_RESTART	0x10000000 -#define SA_NODEFER	0x40000000 -#define SA_RESETHAND	0x80000000 - -#define SA_NOMASK	SA_NODEFER -#define SA_ONESHOT	SA_RESETHAND - -/* - * sigaltstack controls - */ -#define SS_ONSTACK	1 -#define SS_DISABLE	2 - -#define MINSIGSTKSZ	2048 -#define SIGSTKSZ	8192 - -#include <asm-generic/signal-defs.h> - -#ifdef __KERNEL__ -struct old_sigaction { -	__sighandler_t sa_handler; -	old_sigset_t sa_mask; -	unsigned long sa_flags; -	__sigrestore_t sa_restorer; -}; - -struct sigaction { -	__sighandler_t sa_handler; -	unsigned long sa_flags; -	__sigrestore_t sa_restorer; -	sigset_t sa_mask;		/* mask last for extensibility */ -}; - -struct k_sigaction { -	struct sigaction sa; -}; -#else -/* Here we must cater to libcs that poke about in kernel headers.  */ - -struct sigaction { -	union { -	  __sighandler_t _sa_handler; -	  void (*_sa_sigaction)(int, struct siginfo *, void *); -	} _u; -	sigset_t sa_mask; -	unsigned long sa_flags; -	void (*sa_restorer)(void); -}; - -#define sa_handler	_u._sa_handler -#define sa_sigaction	_u._sa_sigaction - -#endif /* __KERNEL__ */ - -typedef struct sigaltstack { -	void __user *ss_sp; -	int ss_flags; -	size_t ss_size; -} stack_t; - -#ifdef __KERNEL__ +#define __ARCH_HAS_SA_RESTORER +  #include <asm/sigcontext.h> -#ifndef __uClinux__ +#ifndef CONFIG_CPU_HAS_NO_BITFIELDS  #define __HAVE_ARCH_SIG_BITOPS  static inline void sigaddset(sigset_t *set, int _sig)  {  	asm ("bfset %0{%1,#1}" -		: "+od" (*set) +		: "+o" (*set)  		: "id" ((_sig - 1) ^ 31)  		: "cc");  } @@ -164,7 +34,7 @@ static inline void sigaddset(sigset_t *set, int _sig)  static inline void sigdelset(sigset_t *set, int _sig)  {  	asm ("bfclr %0{%1,#1}" -		: "+od" (*set) +		: "+o" (*set)  		: "id" ((_sig - 1) ^ 31)  		: "cc");  } @@ -180,7 +50,7 @@ static inline int __gen_sigismember(sigset_t *set, int _sig)  	int ret;  	asm ("bfextu %1{%2,#1},%0"  		: "=d" (ret) -		: "od" (*set), "id" ((_sig-1) ^ 31) +		: "o" (*set), "id" ((_sig-1) ^ 31)  		: "cc");  	return ret;  } @@ -190,24 +60,11 @@ static inline int __gen_sigismember(sigset_t *set, int _sig)  	 __const_sigismember(set,sig) :		\  	 __gen_sigismember(set,sig)) -static inline int sigfindinword(unsigned long word) -{ -	asm ("bfffo %1{#0,#0},%0" -		: "=d" (word) -		: "d" (word & -word) -		: "cc"); -	return word ^ 31; -} - -struct pt_regs; -extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); - -#else - -#undef __HAVE_ARCH_SIG_BITOPS -#define ptrace_signal_deliver(regs, cookie) do { } while (0) +#endif /* !CONFIG_CPU_HAS_NO_BITFIELDS */ +#ifndef __uClinux__ +extern void ptrace_signal_deliver(void); +#define ptrace_signal_deliver ptrace_signal_deliver  #endif /* __uClinux__ */ -#endif /* __KERNEL__ */  #endif /* _M68K_SIGNAL_H */ diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h deleted file mode 100644 index 9bf49c87d95..00000000000 --- a/arch/m68k/include/asm/socket.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _ASM_SOCKET_H -#define _ASM_SOCKET_H - -#include <asm/sockios.h> - -/* For setsockopt(2) */ -#define SOL_SOCKET	1 - -#define SO_DEBUG	1 -#define SO_REUSEADDR	2 -#define SO_TYPE		3 -#define SO_ERROR	4 -#define SO_DONTROUTE	5 -#define SO_BROADCAST	6 -#define SO_SNDBUF	7 -#define SO_RCVBUF	8 -#define SO_SNDBUFFORCE	32 -#define SO_RCVBUFFORCE	33 -#define SO_KEEPALIVE	9 -#define SO_OOBINLINE	10 -#define SO_NO_CHECK	11 -#define SO_PRIORITY	12 -#define SO_LINGER	13 -#define SO_BSDCOMPAT	14 -/* To add :#define SO_REUSEPORT 15 */ -#define SO_PASSCRED	16 -#define SO_PEERCRED	17 -#define SO_RCVLOWAT	18 -#define SO_SNDLOWAT	19 -#define SO_RCVTIMEO	20 -#define SO_SNDTIMEO	21 - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION		22 -#define SO_SECURITY_ENCRYPTION_TRANSPORT	23 -#define SO_SECURITY_ENCRYPTION_NETWORK		24 - -#define SO_BINDTODEVICE	25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER        26 -#define SO_DETACH_FILTER        27 - -#define SO_PEERNAME             28 -#define SO_TIMESTAMP		29 -#define SCM_TIMESTAMP		SO_TIMESTAMP - -#define SO_ACCEPTCONN		30 - -#define SO_PEERSEC             31 -#define SO_PASSSEC		34 -#define SO_TIMESTAMPNS		35 -#define SCM_TIMESTAMPNS		SO_TIMESTAMPNS - -#define SO_MARK			36 - -#define SO_TIMESTAMPING		37 -#define SCM_TIMESTAMPING	SO_TIMESTAMPING - -#define SO_PROTOCOL		38 -#define SO_DOMAIN		39 - -#define SO_RXQ_OVFL             40 - -#endif /* _ASM_SOCKET_H */ diff --git a/arch/m68k/include/asm/sockios.h b/arch/m68k/include/asm/sockios.h deleted file mode 100644 index c04a23943cb..00000000000 --- a/arch/m68k/include/asm/sockios.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __ARCH_M68K_SOCKIOS__ -#define __ARCH_M68K_SOCKIOS__ - -/* Socket-level I/O control calls. */ -#define FIOSETOWN	0x8901 -#define SIOCSPGRP	0x8902 -#define FIOGETOWN	0x8903 -#define SIOCGPGRP	0x8904 -#define SIOCATMARK	0x8905 -#define SIOCGSTAMP	0x8906		/* Get stamp (timeval) */ -#define SIOCGSTAMPNS	0x8907		/* Get stamp (timespec) */ - -#endif /* __ARCH_M68K_SOCKIOS__ */ diff --git a/arch/m68k/include/asm/spinlock.h b/arch/m68k/include/asm/spinlock.h deleted file mode 100644 index 20f46e27b53..00000000000 --- a/arch/m68k/include/asm/spinlock.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __M68K_SPINLOCK_H -#define __M68K_SPINLOCK_H - -#error "m68k doesn't do SMP yet" - -#endif diff --git a/arch/m68k/include/asm/stat.h b/arch/m68k/include/asm/stat.h deleted file mode 100644 index dd38bc2e9f9..00000000000 --- a/arch/m68k/include/asm/stat.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef _M68K_STAT_H -#define _M68K_STAT_H - -struct __old_kernel_stat { -	unsigned short st_dev; -	unsigned short st_ino; -	unsigned short st_mode; -	unsigned short st_nlink; -	unsigned short st_uid; -	unsigned short st_gid; -	unsigned short st_rdev; -	unsigned long  st_size; -	unsigned long  st_atime; -	unsigned long  st_mtime; -	unsigned long  st_ctime; -}; - -struct stat { -	unsigned short st_dev; -	unsigned short __pad1; -	unsigned long  st_ino; -	unsigned short st_mode; -	unsigned short st_nlink; -	unsigned short st_uid; -	unsigned short st_gid; -	unsigned short st_rdev; -	unsigned short __pad2; -	unsigned long  st_size; -	unsigned long  st_blksize; -	unsigned long  st_blocks; -	unsigned long  st_atime; -	unsigned long  __unused1; -	unsigned long  st_mtime; -	unsigned long  __unused2; -	unsigned long  st_ctime; -	unsigned long  __unused3; -	unsigned long  __unused4; -	unsigned long  __unused5; -}; - -/* This matches struct stat64 in glibc2.1, hence the absolutely - * insane amounts of padding around dev_t's. - */ -struct stat64 { -	unsigned long long	st_dev; -	unsigned char	__pad1[2]; - -#define STAT64_HAS_BROKEN_ST_INO	1 -	unsigned long	__st_ino; - -	unsigned int	st_mode; -	unsigned int	st_nlink; - -	unsigned long	st_uid; -	unsigned long	st_gid; - -	unsigned long long	st_rdev; -	unsigned char	__pad3[2]; - -	long long	st_size; -	unsigned long	st_blksize; - -	unsigned long long	st_blocks;	/* Number 512-byte blocks allocated. */ - -	unsigned long	st_atime; -	unsigned long	st_atime_nsec; - -	unsigned long	st_mtime; -	unsigned long	st_mtime_nsec; - -	unsigned long	st_ctime; -	unsigned long	st_ctime_nsec; - -	unsigned long long	st_ino; -}; - -#endif /* _M68K_STAT_H */ diff --git a/arch/m68k/include/asm/statfs.h b/arch/m68k/include/asm/statfs.h deleted file mode 100644 index 08d93f14e06..00000000000 --- a/arch/m68k/include/asm/statfs.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _M68K_STATFS_H -#define _M68K_STATFS_H - -#include <asm-generic/statfs.h> - -#endif /* _M68K_STATFS_H */ diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index 2936dda938d..c30c03d9858 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h @@ -4,34 +4,6 @@  #include <linux/types.h>  #include <linux/compiler.h> -static inline size_t __kernel_strlen(const char *s) -{ -	const char *sc; - -	for (sc = s; *sc++; ) -		; -	return sc - s - 1; -} - -static inline char *__kernel_strcpy(char *dest, const char *src) -{ -	char *xdest = dest; - -	asm volatile ("\n" -		"1:	move.b	(%1)+,(%0)+\n" -		"	jne	1b" -		: "+a" (dest), "+a" (src) -		: : "memory"); -	return xdest; -} - -#ifndef __IN_STRING_C - -#define __HAVE_ARCH_STRLEN -#define strlen(s)	(__builtin_constant_p(s) ?	\ -			 __builtin_strlen(s) :		\ -			 __kernel_strlen(s)) -  #define __HAVE_ARCH_STRNLEN  static inline size_t strnlen(const char *s, size_t count)  { @@ -48,16 +20,6 @@ static inline size_t strnlen(const char *s, size_t count)  	return sc - s;  } -#define __HAVE_ARCH_STRCPY -#if __GNUC__ >= 4 -#define strcpy(d, s)	(__builtin_constant_p(s) &&	\ -			 __builtin_strlen(s) <= 32 ?	\ -			 __builtin_strcpy(d, s) :	\ -			 __kernel_strcpy(d, s)) -#else -#define strcpy(d, s)	__kernel_strcpy(d, s) -#endif -  #define __HAVE_ARCH_STRNCPY  static inline char *strncpy(char *dest, const char *src, size_t n)  { @@ -75,24 +37,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n)  	return xdest;  } -#define __HAVE_ARCH_STRCAT -#define strcat(d, s)	({			\ -	char *__d = (d);			\ -	strcpy(__d + strlen(__d), (s));		\ -}) - -#define __HAVE_ARCH_STRCHR -static inline char *strchr(const char *s, int c) -{ -	char sc, ch = c; - -	for (; (sc = *s++) != ch; ) { -		if (!sc) -			return NULL; -	} -	return (char *)s - 1; -} -  #ifndef CONFIG_COLDFIRE  #define __HAVE_ARCH_STRCMP  static inline int strcmp(const char *cs, const char *ct) @@ -111,14 +55,12 @@ static inline int strcmp(const char *cs, const char *ct)  		: "+a" (cs), "+a" (ct), "=d" (res));  	return res;  } +#endif /* CONFIG_COLDFIRE */  #define __HAVE_ARCH_MEMMOVE  extern void *memmove(void *, const void *, __kernel_size_t); -#define __HAVE_ARCH_MEMCMP -extern int memcmp(const void *, const void *, __kernel_size_t);  #define memcmp(d, s, n) __builtin_memcmp(d, s, n) -#endif /* CONFIG_COLDFIRE */  #define __HAVE_ARCH_MEMSET  extern void *memset(void *, int, __kernel_size_t); @@ -128,6 +70,4 @@ extern void *memset(void *, int, __kernel_size_t);  extern void *memcpy(void *, const void *, __kernel_size_t);  #define memcpy(d, s, n) __builtin_memcpy(d, s, n) -#endif -  #endif /* _M68K_STRING_H_ */ diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index 48d80d5a666..f868506e335 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h @@ -59,7 +59,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,  		return NULL;  	clear_highpage(page); -	pgtable_page_ctor(page); +	if (!pgtable_page_ctor(page)) { +		__free_page(page); +		return NULL; +	}  	return page;  } diff --git a/arch/m68k/include/asm/sun3_pgtable.h b/arch/m68k/include/asm/sun3_pgtable.h index cf5fad9b525..f55aa04161e 100644 --- a/arch/m68k/include/asm/sun3_pgtable.h +++ b/arch/m68k/include/asm/sun3_pgtable.h @@ -217,9 +217,8 @@ static inline pte_t pgoff_to_pte(unsigned off)  /* Find an entry in the third-level pagetable. */  #define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))  #define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address)) -/* FIXME: should we bother with kmap() here? */ -#define pte_offset_map(pmd, address) ((pte_t *)kmap(pmd_page(*pmd)) + pte_index(address)) -#define pte_unmap(pte) kunmap(pte) +#define pte_offset_map(pmd, address) ((pte_t *)page_address(pmd_page(*pmd)) + pte_index(address)) +#define pte_unmap(pte) do { } while (0)  /* Macros to (de)construct the fake PTEs representing swap pages. */  #define __swp_type(x)		((x).val & 0x7F) diff --git a/arch/m68k/include/asm/sun3xflop.h b/arch/m68k/include/asm/sun3xflop.h index 32c45f84ac6..a02ea3a7bb2 100644 --- a/arch/m68k/include/asm/sun3xflop.h +++ b/arch/m68k/include/asm/sun3xflop.h @@ -11,7 +11,6 @@  #include <asm/page.h>  #include <asm/pgtable.h> -#include <asm/system.h>  #include <asm/irq.h>  #include <asm/sun3x.h> @@ -208,7 +207,7 @@ static int sun3xflop_request_irq(void)  	if(!once) {  		once = 1;  		error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, -				    IRQF_DISABLED, "floppy", NULL); +				    0, "floppy", NULL);  		return ((error == 0) ? 0 : -1);  	} else return 0;  } diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/asm/swab.h deleted file mode 100644 index b7b37a40def..00000000000 --- a/arch/m68k/include/asm/swab.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _M68K_SWAB_H -#define _M68K_SWAB_H - -#include <linux/types.h> -#include <linux/compiler.h> - -#define __SWAB_64_THRU_32__ - -#if defined (__mcfisaaplus__) || defined (__mcfisac__) -static inline __attribute_const__ __u32 __arch_swab32(__u32 val) -{ -	__asm__("byterev %0" : "=d" (val) : "0" (val)); -	return val; -} - -#define __arch_swab32 __arch_swab32 -#elif !defined(__mcoldfire__) - -static inline __attribute_const__ __u32 __arch_swab32(__u32 val) -{ -	__asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); -	return val; -} -#define __arch_swab32 __arch_swab32 -#endif - -#endif /* _M68K_SWAB_H */ diff --git a/arch/m68k/include/asm/switch_to.h b/arch/m68k/include/asm/switch_to.h new file mode 100644 index 00000000000..16fd6b63498 --- /dev/null +++ b/arch/m68k/include/asm/switch_to.h @@ -0,0 +1,41 @@ +#ifndef _M68K_SWITCH_TO_H +#define _M68K_SWITCH_TO_H + +/* + * switch_to(n) should switch tasks to task ptr, first checking that + * ptr isn't the current task, in which case it does nothing.  This + * also clears the TS-flag if the task we switched to has used the + * math co-processor latest. + */ +/* + * switch_to() saves the extra registers, that are not saved + * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and + * a0-a1. Some of these are used by schedule() and its predecessors + * and so we might get see unexpected behaviors when a task returns + * with unexpected register values. + * + * syscall stores these registers itself and none of them are used + * by syscall after the function in the syscall has been called. + * + * Beware that resume now expects *next to be in d1 and the offset of + * tss to be in a1. This saves a few instructions as we no longer have + * to push them onto the stack and read them back right after. + * + * 02/17/96 - Jes Sorensen (jds@kom.auc.dk) + * + * Changed 96/09/19 by Andreas Schwab + * pass prev in a0, next in a1 + */ +asmlinkage void resume(void); +#define switch_to(prev,next,last) do { \ +  register void *_prev __asm__ ("a0") = (prev); \ +  register void *_next __asm__ ("a1") = (next); \ +  register void *_last __asm__ ("d1"); \ +  __asm__ __volatile__("jbsr resume" \ +		       : "=a" (_prev), "=a" (_next), "=d" (_last) \ +		       : "0" (_prev), "1" (_next) \ +		       : "d0", "d2", "d3", "d4", "d5"); \ +  (last) = _last; \ +} while (0) + +#endif /* _M68K_SWITCH_TO_H */ diff --git a/arch/m68k/include/asm/system.h b/arch/m68k/include/asm/system.h deleted file mode 100644 index ccea925ff4f..00000000000 --- a/arch/m68k/include/asm/system.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef __uClinux__ -#include "system_no.h" -#else -#include "system_mm.h" -#endif diff --git a/arch/m68k/include/asm/system_no.h b/arch/m68k/include/asm/system_no.h deleted file mode 100644 index 6fe9f93bc3f..00000000000 --- a/arch/m68k/include/asm/system_no.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef _M68KNOMMU_SYSTEM_H -#define _M68KNOMMU_SYSTEM_H - -#include <linux/linkage.h> -#include <linux/irqflags.h> -#include <asm/segment.h> -#include <asm/entry.h> - -/* - * switch_to(n) should switch tasks to task ptr, first checking that - * ptr isn't the current task, in which case it does nothing.  This - * also clears the TS-flag if the task we switched to has used the - * math co-processor latest. - */ -/* - * switch_to() saves the extra registers, that are not saved - * automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and - * a0-a1. Some of these are used by schedule() and its predecessors - * and so we might get see unexpected behaviors when a task returns - * with unexpected register values. - * - * syscall stores these registers itself and none of them are used - * by syscall after the function in the syscall has been called. - * - * Beware that resume now expects *next to be in d1 and the offset of - * tss to be in a1. This saves a few instructions as we no longer have - * to push them onto the stack and read them back right after. - * - * 02/17/96 - Jes Sorensen (jds@kom.auc.dk) - * - * Changed 96/09/19 by Andreas Schwab - * pass prev in a0, next in a1, offset of tss in d1, and whether - * the mm structures are shared in d2 (to avoid atc flushing). - */ -asmlinkage void resume(void); -#define switch_to(prev,next,last)				\ -{								\ -  void *_last;							\ -  __asm__ __volatile__(						\ -  	"movel	%1, %%a0\n\t"					\ -	"movel	%2, %%a1\n\t"					\ -	"jbsr resume\n\t"					\ -	"movel	%%d1, %0\n\t"					\ -       : "=d" (_last)						\ -       : "d" (prev), "d" (next)					\ -       : "cc", "d0", "d1", "d2", "d3", "d4", "d5", "a0", "a1");	\ -  (last) = _last;						\ -} - -#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc") - -/* - * Force strict CPU ordering. - * Not really required on m68k... - */ -#define nop()  asm volatile ("nop"::) -#define mb()   asm volatile (""   : : :"memory") -#define rmb()  asm volatile (""   : : :"memory") -#define wmb()  asm volatile (""   : : :"memory") -#define set_mb(var, value)	({ (var) = (value); wmb(); }) - -#define smp_mb()	barrier() -#define smp_rmb()	barrier() -#define smp_wmb()	barrier() -#define smp_read_barrier_depends()	do { } while(0) - -#define read_barrier_depends()  ((void)0) - -#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) - -struct __xchg_dummy { unsigned long a[100]; }; -#define __xg(x) ((volatile struct __xchg_dummy *)(x)) - -#ifndef CONFIG_RMW_INSNS -static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) -{ -  unsigned long tmp, flags; - -  local_irq_save(flags); - -  switch (size) { -  case 1: -    __asm__ __volatile__ -    ("moveb %2,%0\n\t" -     "moveb %1,%2" -    : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory"); -    break; -  case 2: -    __asm__ __volatile__ -    ("movew %2,%0\n\t" -     "movew %1,%2" -    : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory"); -    break; -  case 4: -    __asm__ __volatile__ -    ("movel %2,%0\n\t" -     "movel %1,%2" -    : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory"); -    break; -  } -  local_irq_restore(flags); -  return tmp; -} -#else -static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) -{ -	switch (size) { -	    case 1: -		__asm__ __volatile__ -			("moveb %2,%0\n\t" -			 "1:\n\t" -			 "casb %0,%1,%2\n\t" -			 "jne 1b" -			 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory"); -		break; -	    case 2: -		__asm__ __volatile__ -			("movew %2,%0\n\t" -			 "1:\n\t" -			 "casw %0,%1,%2\n\t" -			 "jne 1b" -			 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory"); -		break; -	    case 4: -		__asm__ __volatile__ -			("movel %2,%0\n\t" -			 "1:\n\t" -			 "casl %0,%1,%2\n\t" -			 "jne 1b" -			 : "=&d" (x) : "d" (x), "m" (*__xg(ptr)) : "memory"); -		break; -	} -	return x; -} -#endif - -#include <asm-generic/cmpxchg-local.h> - -/* - * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make - * them available. - */ -#define cmpxchg_local(ptr, o, n)				  	       \ -	((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\ -			(unsigned long)(n), sizeof(*(ptr)))) -#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) - -#include <asm-generic/cmpxchg.h> - -#define arch_align_stack(x) (x) - - -#endif /* _M68KNOMMU_SYSTEM_H */ diff --git a/arch/m68k/include/asm/termbits.h b/arch/m68k/include/asm/termbits.h deleted file mode 100644 index aea1e37b765..00000000000 --- a/arch/m68k/include/asm/termbits.h +++ /dev/null @@ -1,201 +0,0 @@ -#ifndef __ARCH_M68K_TERMBITS_H__ -#define __ARCH_M68K_TERMBITS_H__ - -#include <linux/posix_types.h> - -typedef unsigned char	cc_t; -typedef unsigned int	speed_t; -typedef unsigned int	tcflag_t; - -#define NCCS 19 -struct termios { -	tcflag_t c_iflag;		/* input mode flags */ -	tcflag_t c_oflag;		/* output mode flags */ -	tcflag_t c_cflag;		/* control mode flags */ -	tcflag_t c_lflag;		/* local mode flags */ -	cc_t c_line;			/* line discipline */ -	cc_t c_cc[NCCS];		/* control characters */ -}; - -struct termios2 { -	tcflag_t c_iflag;		/* input mode flags */ -	tcflag_t c_oflag;		/* output mode flags */ -	tcflag_t c_cflag;		/* control mode flags */ -	tcflag_t c_lflag;		/* local mode flags */ -	cc_t c_line;			/* line discipline */ -	cc_t c_cc[NCCS];		/* control characters */ -	speed_t c_ispeed;		/* input speed */ -	speed_t c_ospeed;		/* output speed */ -}; - -struct ktermios { -	tcflag_t c_iflag;		/* input mode flags */ -	tcflag_t c_oflag;		/* output mode flags */ -	tcflag_t c_cflag;		/* control mode flags */ -	tcflag_t c_lflag;		/* local mode flags */ -	cc_t c_line;			/* line discipline */ -	cc_t c_cc[NCCS];		/* control characters */ -	speed_t c_ispeed;		/* input speed */ -	speed_t c_ospeed;		/* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - - -/* c_iflag bits */ -#define IGNBRK	0000001 -#define BRKINT	0000002 -#define IGNPAR	0000004 -#define PARMRK	0000010 -#define INPCK	0000020 -#define ISTRIP	0000040 -#define INLCR	0000100 -#define IGNCR	0000200 -#define ICRNL	0000400 -#define IUCLC	0001000 -#define IXON	0002000 -#define IXANY	0004000 -#define IXOFF	0010000 -#define IMAXBEL	0020000 -#define IUTF8	0040000 - -/* c_oflag bits */ -#define OPOST	0000001 -#define OLCUC	0000002 -#define ONLCR	0000004 -#define OCRNL	0000010 -#define ONOCR	0000020 -#define ONLRET	0000040 -#define OFILL	0000100 -#define OFDEL	0000200 -#define NLDLY	0000400 -#define   NL0	0000000 -#define   NL1	0000400 -#define CRDLY	0003000 -#define   CR0	0000000 -#define   CR1	0001000 -#define   CR2	0002000 -#define   CR3	0003000 -#define TABDLY	0014000 -#define   TAB0	0000000 -#define   TAB1	0004000 -#define   TAB2	0010000 -#define   TAB3	0014000 -#define   XTABS	0014000 -#define BSDLY	0020000 -#define   BS0	0000000 -#define   BS1	0020000 -#define VTDLY	0040000 -#define   VT0	0000000 -#define   VT1	0040000 -#define FFDLY	0100000 -#define   FF0	0000000 -#define   FF1	0100000 - -/* c_cflag bit meaning */ -#define CBAUD	0010017 -#define  B0	0000000		/* hang up */ -#define  B50	0000001 -#define  B75	0000002 -#define  B110	0000003 -#define  B134	0000004 -#define  B150	0000005 -#define  B200	0000006 -#define  B300	0000007 -#define  B600	0000010 -#define  B1200	0000011 -#define  B1800	0000012 -#define  B2400	0000013 -#define  B4800	0000014 -#define  B9600	0000015 -#define  B19200	0000016 -#define  B38400	0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE	0000060 -#define   CS5	0000000 -#define   CS6	0000020 -#define   CS7	0000040 -#define   CS8	0000060 -#define CSTOPB	0000100 -#define CREAD	0000200 -#define PARENB	0000400 -#define PARODD	0001000 -#define HUPCL	0002000 -#define CLOCAL	0004000 -#define CBAUDEX 0010000 -#define    BOTHER 0010000 -#define    B57600 0010001 -#define   B115200 0010002 -#define   B230400 0010003 -#define   B460800 0010004 -#define   B500000 0010005 -#define   B576000 0010006 -#define   B921600 0010007 -#define  B1000000 0010010 -#define  B1152000 0010011 -#define  B1500000 0010012 -#define  B2000000 0010013 -#define  B2500000 0010014 -#define  B3000000 0010015 -#define  B3500000 0010016 -#define  B4000000 0010017 -#define CIBAUD	  002003600000		/* input baud rate */ -#define CMSPAR	  010000000000		/* mark or space (stick) parity */ -#define CRTSCTS	  020000000000		/* flow control */ - -#define IBSHIFT	16			/* Shift from CBAUD to CIBAUD */ - -/* c_lflag bits */ -#define ISIG	0000001 -#define ICANON	0000002 -#define XCASE	0000004 -#define ECHO	0000010 -#define ECHOE	0000020 -#define ECHOK	0000040 -#define ECHONL	0000100 -#define NOFLSH	0000200 -#define TOSTOP	0000400 -#define ECHOCTL	0001000 -#define ECHOPRT	0002000 -#define ECHOKE	0004000 -#define FLUSHO	0010000 -#define PENDIN	0040000 -#define IEXTEN	0100000 -#define EXTPROC	0200000 - - -/* tcflow() and TCXONC use these */ -#define	TCOOFF		0 -#define	TCOON		1 -#define	TCIOFF		2 -#define	TCION		3 - -/* tcflush() and TCFLSH use these */ -#define	TCIFLUSH	0 -#define	TCOFLUSH	1 -#define	TCIOFLUSH	2 - -/* tcsetattr uses these */ -#define	TCSANOW		0 -#define	TCSADRAIN	1 -#define	TCSAFLUSH	2 - -#endif /* __ARCH_M68K_TERMBITS_H__ */ diff --git a/arch/m68k/include/asm/termios.h b/arch/m68k/include/asm/termios.h deleted file mode 100644 index 0823032e404..00000000000 --- a/arch/m68k/include/asm/termios.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef _M68K_TERMIOS_H -#define _M68K_TERMIOS_H - -#include <asm/termbits.h> -#include <asm/ioctls.h> - -struct winsize { -	unsigned short ws_row; -	unsigned short ws_col; -	unsigned short ws_xpixel; -	unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { -	unsigned short c_iflag;		/* input mode flags */ -	unsigned short c_oflag;		/* output mode flags */ -	unsigned short c_cflag;		/* control mode flags */ -	unsigned short c_lflag;		/* local mode flags */ -	unsigned char c_line;		/* line discipline */ -	unsigned char c_cc[NCC];	/* control characters */ -}; - -#ifdef __KERNEL__ -/*	intr=^C		quit=^|		erase=del	kill=^U -	eof=^D		vtime=\0	vmin=\1		sxtc=\0 -	start=^Q	stop=^S		susp=^Z		eol=\0 -	reprint=^R	discard=^U	werase=^W	lnext=^V -	eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" -#endif - -/* modem lines */ -#define TIOCM_LE	0x001 -#define TIOCM_DTR	0x002 -#define TIOCM_RTS	0x004 -#define TIOCM_ST	0x008 -#define TIOCM_SR	0x010 -#define TIOCM_CTS	0x020 -#define TIOCM_CAR	0x040 -#define TIOCM_RNG	0x080 -#define TIOCM_DSR	0x100 -#define TIOCM_CD	TIOCM_CAR -#define TIOCM_RI	TIOCM_RNG -#define TIOCM_OUT1	0x2000 -#define TIOCM_OUT2	0x4000 -#define TIOCM_LOOP	0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__ - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ -	unsigned short tmp; \ -	get_user(tmp, &(termio)->c_iflag); \ -	(termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ -	get_user(tmp, &(termio)->c_oflag); \ -	(termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ -	get_user(tmp, &(termio)->c_cflag); \ -	(termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ -	get_user(tmp, &(termio)->c_lflag); \ -	(termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ -	get_user((termios)->c_line, &(termio)->c_line); \ -	copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ -	put_user((termios)->c_iflag, &(termio)->c_iflag); \ -	put_user((termios)->c_oflag, &(termio)->c_oflag); \ -	put_user((termios)->c_cflag, &(termio)->c_cflag); \ -	put_user((termios)->c_lflag, &(termio)->c_lflag); \ -	put_user((termios)->c_line,  &(termio)->c_line); \ -	copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) -#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif	/* __KERNEL__ */ - -#endif /* _M68K_TERMIOS_H */ diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h index 1da5d53a00e..21a4784ca5a 100644 --- a/arch/m68k/include/asm/thread_info.h +++ b/arch/m68k/include/asm/thread_info.h @@ -3,6 +3,7 @@  #include <asm/types.h>  #include <asm/page.h> +#include <asm/segment.h>  /*   * On machines with 4k pages we default to an 8k thread size, though we @@ -26,6 +27,7 @@ struct thread_info {  	struct task_struct	*task;		/* main task structure */  	unsigned long		flags;  	struct exec_domain	*exec_domain;	/* execution domain */ +	mm_segment_t		addr_limit;	/* thread address space */  	int			preempt_count;	/* 0 => preemptable, <0 => BUG */  	__u32			cpu;		/* should always be 0 on m68k */  	unsigned long		tp_value;	/* thread pointer */ @@ -33,12 +35,11 @@ struct thread_info {  };  #endif /* __ASSEMBLY__ */ -#define PREEMPT_ACTIVE		0x4000000 -  #define INIT_THREAD_INFO(tsk)			\  {						\  	.task		= &tsk,			\  	.exec_domain	= &default_exec_domain,	\ +	.addr_limit	= KERNEL_DS,		\  	.preempt_count	= INIT_PREEMPT_COUNT,	\  	.restart_block = {			\  		.fn = do_no_restart_syscall,	\ @@ -47,34 +48,6 @@ struct thread_info {  #define init_stack		(init_thread_union.stack) -#ifdef CONFIG_MMU - -#ifndef __ASSEMBLY__ -#include <asm/current.h> -#endif - -#ifdef ASM_OFFSETS_C -#define task_thread_info(tsk)	((struct thread_info *) NULL) -#else -#include <asm/asm-offsets.h> -#define task_thread_info(tsk)	((struct thread_info *)((char *)tsk+TASK_TINFO)) -#endif - -#define init_thread_info	(init_task.thread.info) -#define task_stack_page(tsk)	((tsk)->stack) -#define current_thread_info()	task_thread_info(current) - -#define __HAVE_THREAD_FUNCTIONS - -#define setup_thread_stack(p, org) ({			\ -	*(struct task_struct **)(p)->stack = (p);	\ -	task_thread_info(p)->task = (p);		\ -}) - -#define end_of_stack(p)		((unsigned long *)(p)->stack + 1) - -#else /* !CONFIG_MMU */ -  #ifndef __ASSEMBLY__  /* how to get the thread information struct from C */  static inline struct thread_info *current_thread_info(void) @@ -92,17 +65,16 @@ static inline struct thread_info *current_thread_info(void)  #define init_thread_info	(init_thread_union.thread_info) -#endif /* CONFIG_MMU */ -  /* entry.S relies on these definitions!   * bits 0-7 are tested at every exception exit   * bits 8-15 are also tested at syscall exit   */ +#define TIF_NOTIFY_RESUME	5	/* callback before returning to user */  #define TIF_SIGPENDING		6	/* signal pending */  #define TIF_NEED_RESCHED	7	/* rescheduling necessary */  #define TIF_DELAYED_TRACE	14	/* single step a syscall */  #define TIF_SYSCALL_TRACE	15	/* syscall trace active */  #define TIF_MEMDIE		16	/* is terminating due to OOM killer */ -#define TIF_FREEZE		17	/* thread is freezing for suspend */ +#define TIF_RESTORE_SIGMASK	18	/* restore signal mask in do_signal */  #endif	/* _ASM_M68K_THREAD_INFO_H */ diff --git a/arch/m68k/include/asm/timex.h b/arch/m68k/include/asm/timex.h index 6759dad954f..efc1f489235 100644 --- a/arch/m68k/include/asm/timex.h +++ b/arch/m68k/include/asm/timex.h @@ -28,4 +28,14 @@ static inline cycles_t get_cycles(void)  	return 0;  } +extern unsigned long (*mach_random_get_entropy)(void); + +static inline unsigned long random_get_entropy(void) +{ +	if (mach_random_get_entropy) +		return mach_random_get_entropy(); +	return 0; +} +#define random_get_entropy	random_get_entropy +  #endif diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h index a6b4ed4fc90..965ea35c9a4 100644 --- a/arch/m68k/include/asm/tlbflush.h +++ b/arch/m68k/include/asm/tlbflush.h @@ -5,10 +5,13 @@  #ifndef CONFIG_SUN3  #include <asm/current.h> +#include <asm/mcfmmu.h>  static inline void flush_tlb_kernel_page(void *addr)  { -	if (CPU_IS_040_OR_060) { +	if (CPU_IS_COLDFIRE) { +		mmu_write(MMUOR, MMUOR_CNL); +	} else if (CPU_IS_040_OR_060) {  		mm_segment_t old_fs = get_fs();  		set_fs(KERNEL_DS);  		__asm__ __volatile__(".chip 68040\n\t" @@ -25,12 +28,15 @@ static inline void flush_tlb_kernel_page(void *addr)   */  static inline void __flush_tlb(void)  { -	if (CPU_IS_040_OR_060) +	if (CPU_IS_COLDFIRE) { +		mmu_write(MMUOR, MMUOR_CNL); +	} else if (CPU_IS_040_OR_060) {  		__asm__ __volatile__(".chip 68040\n\t"  				     "pflushan\n\t"  				     ".chip 68k"); -	else if (CPU_IS_020_OR_030) +	} else if (CPU_IS_020_OR_030) {  		__asm__ __volatile__("pflush #0,#4"); +	}  }  static inline void __flush_tlb040_one(unsigned long addr) @@ -43,7 +49,9 @@ static inline void __flush_tlb040_one(unsigned long addr)  static inline void __flush_tlb_one(unsigned long addr)  { -	if (CPU_IS_040_OR_060) +	if (CPU_IS_COLDFIRE) +		mmu_write(MMUOR, MMUOR_CNL); +	else if (CPU_IS_040_OR_060)  		__flush_tlb040_one(addr);  	else if (CPU_IS_020_OR_030)  		__asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr)); @@ -56,12 +64,15 @@ static inline void __flush_tlb_one(unsigned long addr)   */  static inline void flush_tlb_all(void)  { -	if (CPU_IS_040_OR_060) +	if (CPU_IS_COLDFIRE) { +		mmu_write(MMUOR, MMUOR_CNL); +	} else if (CPU_IS_040_OR_060) {  		__asm__ __volatile__(".chip 68040\n\t"  				     "pflusha\n\t"  				     ".chip 68k"); -	else if (CPU_IS_020_OR_030) +	} else if (CPU_IS_020_OR_030) {  		__asm__ __volatile__("pflusha"); +	}  }  static inline void flush_tlb_mm(struct mm_struct *mm) diff --git a/arch/m68k/include/asm/topology.h b/arch/m68k/include/asm/topology.h deleted file mode 100644 index ca173e9f26f..00000000000 --- a/arch/m68k/include/asm/topology.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_M68K_TOPOLOGY_H -#define _ASM_M68K_TOPOLOGY_H - -#include <asm-generic/topology.h> - -#endif /* _ASM_M68K_TOPOLOGY_H */ diff --git a/arch/m68k/include/asm/traps.h b/arch/m68k/include/asm/traps.h index 0bffb17d5db..4aff3358fba 100644 --- a/arch/m68k/include/asm/traps.h +++ b/arch/m68k/include/asm/traps.h @@ -18,11 +18,11 @@  typedef void (*e_vector)(void);  extern e_vector vectors[]; +extern e_vector *_ramvec;  asmlinkage void auto_inthandler(void);  asmlinkage void user_inthandler(void);  asmlinkage void bad_inthandler(void); -extern void init_vectors(void);  #endif diff --git a/arch/m68k/include/asm/types.h b/arch/m68k/include/asm/types.h deleted file mode 100644 index 6441cb5f8e7..00000000000 --- a/arch/m68k/include/asm/types.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _M68K_TYPES_H -#define _M68K_TYPES_H - -/* - * This file is never included by application software unless - * explicitly requested (e.g., via linux/types.h) in which case the - * application is Linux specific so (user-) name space pollution is - * not a major issue.  However, for interoperability, libraries still - * need to be careful to avoid a name clashes. - */ -#include <asm-generic/int-ll64.h> - -#ifndef __ASSEMBLY__ - -typedef unsigned short umode_t; - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -#define BITS_PER_LONG 32 - -#ifndef __ASSEMBLY__ - -/* DMA addresses are always 32-bits wide */ - -typedef u32 dma_addr_t; -typedef u32 dma64_addr_t; - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _M68K_TYPES_H */ diff --git a/arch/m68k/include/asm/uaccess.h b/arch/m68k/include/asm/uaccess.h index 38f92dbb9a4..3fadc4a93d9 100644 --- a/arch/m68k/include/asm/uaccess.h +++ b/arch/m68k/include/asm/uaccess.h @@ -1,5 +1,12 @@  #ifdef __uClinux__ -#include "uaccess_no.h" +#include <asm/uaccess_no.h>  #else -#include "uaccess_mm.h" +#include <asm/uaccess_mm.h> +#endif + +#ifdef CONFIG_CPU_HAS_NO_UNALIGNED +#include <asm-generic/uaccess-unaligned.h> +#else +#define __get_user_unaligned(x, ptr)	__get_user((x), (ptr)) +#define __put_user_unaligned(x, ptr)	__put_user((x), (ptr))  #endif diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h index 7107f3fbdbb..15901db435b 100644 --- a/arch/m68k/include/asm/uaccess_mm.h +++ b/arch/m68k/include/asm/uaccess_mm.h @@ -21,6 +21,22 @@ static inline int access_ok(int type, const void __user *addr,  }  /* + * Not all varients of the 68k family support the notion of address spaces. + * The traditional 680x0 parts do, and they use the sfc/dfc registers and + * the "moves" instruction to access user space from kernel space. Other + * family members like ColdFire don't support this, and only have a single + * address space, and use the usual "move" instruction for user space access. + * + * Outside of this difference the user space access functions are the same. + * So lets keep the code simple and just define in what we need to use. + */ +#ifdef CONFIG_CPU_HAS_ADDRESS_SPACES +#define	MOVES	"moves" +#else +#define	MOVES	"move" +#endif + +/*   * The exception table consists of pairs of addresses: the first is the   * address of an instruction that is allowed to fault, and the second is   * the address at which the program should continue.  No registers are @@ -43,7 +59,7 @@ extern int __get_user_bad(void);  #define __put_user_asm(res, x, ptr, bwl, reg, err)	\  asm volatile ("\n"					\ -	"1:	moves."#bwl"	%2,%1\n"		\ +	"1:	"MOVES"."#bwl"	%2,%1\n"		\  	"2:\n"						\  	"	.section .fixup,\"ax\"\n"		\  	"	.even\n"				\ @@ -74,7 +90,7 @@ asm volatile ("\n"					\  		__put_user_asm(__pu_err, __pu_val, ptr, b, d, -EFAULT);	\  		break;							\  	case 2:								\ -		__put_user_asm(__pu_err, __pu_val, ptr, w, d, -EFAULT);	\ +		__put_user_asm(__pu_err, __pu_val, ptr, w, r, -EFAULT);	\  		break;							\  	case 4:								\  		__put_user_asm(__pu_err, __pu_val, ptr, l, r, -EFAULT);	\ @@ -83,8 +99,8 @@ asm volatile ("\n"					\   	    {								\   		const void __user *__pu_ptr = (ptr);			\  		asm volatile ("\n"					\ -			"1:	moves.l	%2,(%1)+\n"			\ -			"2:	moves.l	%R2,(%1)\n"			\ +			"1:	"MOVES".l	%2,(%1)+\n"		\ +			"2:	"MOVES".l	%R2,(%1)\n"		\  			"3:\n"						\  			"	.section .fixup,\"ax\"\n"		\  			"	.even\n"				\ @@ -115,12 +131,12 @@ asm volatile ("\n"					\  #define __get_user_asm(res, x, ptr, type, bwl, reg, err) ({	\  	type __gu_val;						\  	asm volatile ("\n"					\ -		"1:	moves."#bwl"	%2,%1\n"		\ +		"1:	"MOVES"."#bwl"	%2,%1\n"		\  		"2:\n"						\  		"	.section .fixup,\"ax\"\n"		\  		"	.even\n"				\  		"10:	move.l	%3,%0\n"			\ -		"	sub."#bwl"	%1,%1\n"		\ +		"	sub.l	%1,%1\n"			\  		"	jra	2b\n"				\  		"	.previous\n"				\  		"\n"						\ @@ -142,7 +158,7 @@ asm volatile ("\n"					\  		__get_user_asm(__gu_err, x, ptr, u8, b, d, -EFAULT);	\  		break;							\  	case 2:								\ -		__get_user_asm(__gu_err, x, ptr, u16, w, d, -EFAULT);	\ +		__get_user_asm(__gu_err, x, ptr, u16, w, r, -EFAULT);	\  		break;							\  	case 4:								\  		__get_user_asm(__gu_err, x, ptr, u32, l, r, -EFAULT);	\ @@ -152,8 +168,8 @@ asm volatile ("\n"					\   		const void *__gu_ptr = (ptr);				\   		u64 __gu_val;						\  		asm volatile ("\n"					\ -			"1:	moves.l	(%2)+,%1\n"			\ -			"2:	moves.l	(%2),%R1\n"			\ +			"1:	"MOVES".l	(%2)+,%1\n"		\ +			"2:	"MOVES".l	(%2),%R1\n"		\  			"3:\n"						\  			"	.section .fixup,\"ax\"\n"		\  			"	.even\n"				\ @@ -188,12 +204,12 @@ unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned  #define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\  	asm volatile ("\n"						\ -		"1:	moves."#s1"	(%2)+,%3\n"			\ +		"1:	"MOVES"."#s1"	(%2)+,%3\n"			\  		"	move."#s1"	%3,(%1)+\n"			\ -		"2:	moves."#s2"	(%2)+,%3\n"			\ +		"2:	"MOVES"."#s2"	(%2)+,%3\n"			\  		"	move."#s2"	%3,(%1)+\n"			\  		"	.ifnc	\""#s3"\",\"\"\n"			\ -		"3:	moves."#s3"	(%2)+,%3\n"			\ +		"3:	"MOVES"."#s3"	(%2)+,%3\n"			\  		"	move."#s3"	%3,(%1)+\n"			\  		"	.endif\n"					\  		"4:\n"							\ @@ -229,7 +245,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n)  		__get_user_asm(res, *(u8 *)to, (u8 __user *)from, u8, b, d, 1);  		break;  	case 2: -		__get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w, d, 2); +		__get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w, r, 2);  		break;  	case 3:  		__constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,); @@ -269,13 +285,13 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n)  #define __constant_copy_to_user_asm(res, to, from, tmp, n, s1, s2, s3)	\  	asm volatile ("\n"						\  		"	move."#s1"	(%2)+,%3\n"			\ -		"11:	moves."#s1"	%3,(%1)+\n"			\ +		"11:	"MOVES"."#s1"	%3,(%1)+\n"			\  		"12:	move."#s2"	(%2)+,%3\n"			\ -		"21:	moves."#s2"	%3,(%1)+\n"			\ +		"21:	"MOVES"."#s2"	%3,(%1)+\n"			\  		"22:\n"							\  		"	.ifnc	\""#s3"\",\"\"\n"			\  		"	move."#s3"	(%2)+,%3\n"			\ -		"31:	moves."#s3"	%3,(%1)+\n"			\ +		"31:	"MOVES"."#s3"	%3,(%1)+\n"			\  		"32:\n"							\  		"	.endif\n"					\  		"4:\n"							\ @@ -310,7 +326,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n)  		__put_user_asm(res, *(u8 *)from, (u8 __user *)to, b, d, 1);  		break;  	case 2: -		__put_user_asm(res, *(u16 *)from, (u16 __user *)to, w, d, 2); +		__put_user_asm(res, *(u16 *)from, (u16 __user *)to, w, r, 2);  		break;  	case 3:  		__constant_copy_to_user_asm(res, to, from, tmp, 3, w, b,); @@ -363,12 +379,15 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n)  #define copy_from_user(to, from, n)	__copy_from_user(to, from, n)  #define copy_to_user(to, from, n)	__copy_to_user(to, from, n) -long strncpy_from_user(char *dst, const char __user *src, long count); -long strnlen_user(const char __user *src, long n); +#define user_addr_max() \ +	(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) + +extern long strncpy_from_user(char *dst, const char __user *src, long count); +extern __must_check long strlen_user(const char __user *str); +extern __must_check long strnlen_user(const char __user *str, long n); +  unsigned long __clear_user(void __user *to, unsigned long n);  #define clear_user	__clear_user -#define strlen_user(str) strnlen_user(str, 32767) -  #endif /* _M68K_UACCESS_H */ diff --git a/arch/m68k/include/asm/ucontext.h b/arch/m68k/include/asm/ucontext.h index 00dcc5176c5..e4e22669edc 100644 --- a/arch/m68k/include/asm/ucontext.h +++ b/arch/m68k/include/asm/ucontext.h @@ -7,11 +7,7 @@ typedef greg_t gregset_t[NGREG];  typedef struct fpregset {  	int f_fpcntl[3]; -#ifdef __mcoldfire__ -	int f_fpregs[8][2]; -#else  	int f_fpregs[8*3]; -#endif  } fpregset_t;  struct mcontext { diff --git a/arch/m68k/include/asm/unaligned.h b/arch/m68k/include/asm/unaligned.h index 019caa740c2..2b3ca0bf7a0 100644 --- a/arch/m68k/include/asm/unaligned.h +++ b/arch/m68k/include/asm/unaligned.h @@ -2,7 +2,7 @@  #define _ASM_M68K_UNALIGNED_H -#ifdef CONFIG_COLDFIRE +#ifdef CONFIG_CPU_HAS_NO_UNALIGNED  #include <linux/unaligned/be_struct.h>  #include <linux/unaligned/le_byteshift.h>  #include <linux/unaligned/generic.h> @@ -12,7 +12,7 @@  #else  /* - * The m68k can do unaligned accesses itself.  + * The m68k can do unaligned accesses itself.   */  #include <linux/unaligned/access_ok.h>  #include <linux/unaligned/generic.h> diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index b43b36beafe..1fcdd344c7a 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h @@ -1,354 +1,11 @@  #ifndef _ASM_M68K_UNISTD_H_  #define _ASM_M68K_UNISTD_H_ -/* - * This file contains the system call numbers. - */ +#include <uapi/asm/unistd.h> -#define __NR_restart_syscall	  0 -#define __NR_exit		  1 -#define __NR_fork		  2 -#define __NR_read		  3 -#define __NR_write		  4 -#define __NR_open		  5 -#define __NR_close		  6 -#define __NR_waitpid		  7 -#define __NR_creat		  8 -#define __NR_link		  9 -#define __NR_unlink		 10 -#define __NR_execve		 11 -#define __NR_chdir		 12 -#define __NR_time		 13 -#define __NR_mknod		 14 -#define __NR_chmod		 15 -#define __NR_chown		 16 -#define __NR_break		 17 -#define __NR_oldstat		 18 -#define __NR_lseek		 19 -#define __NR_getpid		 20 -#define __NR_mount		 21 -#define __NR_umount		 22 -#define __NR_setuid		 23 -#define __NR_getuid		 24 -#define __NR_stime		 25 -#define __NR_ptrace		 26 -#define __NR_alarm		 27 -#define __NR_oldfstat		 28 -#define __NR_pause		 29 -#define __NR_utime		 30 -#define __NR_stty		 31 -#define __NR_gtty		 32 -#define __NR_access		 33 -#define __NR_nice		 34 -#define __NR_ftime		 35 -#define __NR_sync		 36 -#define __NR_kill		 37 -#define __NR_rename		 38 -#define __NR_mkdir		 39 -#define __NR_rmdir		 40 -#define __NR_dup		 41 -#define __NR_pipe		 42 -#define __NR_times		 43 -#define __NR_prof		 44 -#define __NR_brk		 45 -#define __NR_setgid		 46 -#define __NR_getgid		 47 -#define __NR_signal		 48 -#define __NR_geteuid		 49 -#define __NR_getegid		 50 -#define __NR_acct		 51 -#define __NR_umount2		 52 -#define __NR_lock		 53 -#define __NR_ioctl		 54 -#define __NR_fcntl		 55 -#define __NR_mpx		 56 -#define __NR_setpgid		 57 -#define __NR_ulimit		 58 -#define __NR_oldolduname	 59 -#define __NR_umask		 60 -#define __NR_chroot		 61 -#define __NR_ustat		 62 -#define __NR_dup2		 63 -#define __NR_getppid		 64 -#define __NR_getpgrp		 65 -#define __NR_setsid		 66 -#define __NR_sigaction		 67 -#define __NR_sgetmask		 68 -#define __NR_ssetmask		 69 -#define __NR_setreuid		 70 -#define __NR_setregid		 71 -#define __NR_sigsuspend		 72 -#define __NR_sigpending		 73 -#define __NR_sethostname	 74 -#define __NR_setrlimit		 75 -#define __NR_getrlimit		 76 -#define __NR_getrusage		 77 -#define __NR_gettimeofday	 78 -#define __NR_settimeofday	 79 -#define __NR_getgroups		 80 -#define __NR_setgroups		 81 -#define __NR_select		 82 -#define __NR_symlink		 83 -#define __NR_oldlstat		 84 -#define __NR_readlink		 85 -#define __NR_uselib		 86 -#define __NR_swapon		 87 -#define __NR_reboot		 88 -#define __NR_readdir		 89 -#define __NR_mmap		 90 -#define __NR_munmap		 91 -#define __NR_truncate		 92 -#define __NR_ftruncate		 93 -#define __NR_fchmod		 94 -#define __NR_fchown		 95 -#define __NR_getpriority	 96 -#define __NR_setpriority	 97 -#define __NR_profil		 98 -#define __NR_statfs		 99 -#define __NR_fstatfs		100 -#define __NR_ioperm		101 -#define __NR_socketcall		102 -#define __NR_syslog		103 -#define __NR_setitimer		104 -#define __NR_getitimer		105 -#define __NR_stat		106 -#define __NR_lstat		107 -#define __NR_fstat		108 -#define __NR_olduname		109 -#define __NR_iopl		/* 110 */ not supported -#define __NR_vhangup		111 -#define __NR_idle		/* 112 */ Obsolete -#define __NR_vm86		/* 113 */ not supported -#define __NR_wait4		114 -#define __NR_swapoff		115 -#define __NR_sysinfo		116 -#define __NR_ipc		117 -#define __NR_fsync		118 -#define __NR_sigreturn		119 -#define __NR_clone		120 -#define __NR_setdomainname	121 -#define __NR_uname		122 -#define __NR_cacheflush		123 -#define __NR_adjtimex		124 -#define __NR_mprotect		125 -#define __NR_sigprocmask	126 -#define __NR_create_module	127 -#define __NR_init_module	128 -#define __NR_delete_module	129 -#define __NR_get_kernel_syms	130 -#define __NR_quotactl		131 -#define __NR_getpgid		132 -#define __NR_fchdir		133 -#define __NR_bdflush		134 -#define __NR_sysfs		135 -#define __NR_personality	136 -#define __NR_afs_syscall	137 /* Syscall for Andrew File System */ -#define __NR_setfsuid		138 -#define __NR_setfsgid		139 -#define __NR__llseek		140 -#define __NR_getdents		141 -#define __NR__newselect		142 -#define __NR_flock		143 -#define __NR_msync		144 -#define __NR_readv		145 -#define __NR_writev		146 -#define __NR_getsid		147 -#define __NR_fdatasync		148 -#define __NR__sysctl		149 -#define __NR_mlock		150 -#define __NR_munlock		151 -#define __NR_mlockall		152 -#define __NR_munlockall		153 -#define __NR_sched_setparam		154 -#define __NR_sched_getparam		155 -#define __NR_sched_setscheduler		156 -#define __NR_sched_getscheduler		157 -#define __NR_sched_yield		158 -#define __NR_sched_get_priority_max	159 -#define __NR_sched_get_priority_min	160 -#define __NR_sched_rr_get_interval	161 -#define __NR_nanosleep		162 -#define __NR_mremap		163 -#define __NR_setresuid		164 -#define __NR_getresuid		165 -#define __NR_getpagesize	166 -#define __NR_query_module	167 -#define __NR_poll		168 -#define __NR_nfsservctl		169 -#define __NR_setresgid		170 -#define __NR_getresgid		171 -#define __NR_prctl		172 -#define __NR_rt_sigreturn	173 -#define __NR_rt_sigaction	174 -#define __NR_rt_sigprocmask	175 -#define __NR_rt_sigpending	176 -#define __NR_rt_sigtimedwait	177 -#define __NR_rt_sigqueueinfo	178 -#define __NR_rt_sigsuspend	179 -#define __NR_pread64		180 -#define __NR_pwrite64		181 -#define __NR_lchown		182 -#define __NR_getcwd		183 -#define __NR_capget		184 -#define __NR_capset		185 -#define __NR_sigaltstack	186 -#define __NR_sendfile		187 -#define __NR_getpmsg		188	/* some people actually want streams */ -#define __NR_putpmsg		189	/* some people actually want streams */ -#define __NR_vfork		190 -#define __NR_ugetrlimit		191 -#define __NR_mmap2		192 -#define __NR_truncate64		193 -#define __NR_ftruncate64	194 -#define __NR_stat64		195 -#define __NR_lstat64		196 -#define __NR_fstat64		197 -#define __NR_chown32		198 -#define __NR_getuid32		199 -#define __NR_getgid32		200 -#define __NR_geteuid32		201 -#define __NR_getegid32		202 -#define __NR_setreuid32		203 -#define __NR_setregid32		204 -#define __NR_getgroups32	205 -#define __NR_setgroups32	206 -#define __NR_fchown32		207 -#define __NR_setresuid32	208 -#define __NR_getresuid32	209 -#define __NR_setresgid32	210 -#define __NR_getresgid32	211 -#define __NR_lchown32		212 -#define __NR_setuid32		213 -#define __NR_setgid32		214 -#define __NR_setfsuid32		215 -#define __NR_setfsgid32		216 -#define __NR_pivot_root		217 -#define __NR_getdents64		220 -#define __NR_gettid		221 -#define __NR_tkill		222 -#define __NR_setxattr		223 -#define __NR_lsetxattr		224 -#define __NR_fsetxattr		225 -#define __NR_getxattr		226 -#define __NR_lgetxattr		227 -#define __NR_fgetxattr		228 -#define __NR_listxattr		229 -#define __NR_llistxattr		230 -#define __NR_flistxattr		231 -#define __NR_removexattr	232 -#define __NR_lremovexattr	233 -#define __NR_fremovexattr	234 -#define __NR_futex		235 -#define __NR_sendfile64		236 -#define __NR_mincore		237 -#define __NR_madvise		238 -#define __NR_fcntl64		239 -#define __NR_readahead		240 -#define __NR_io_setup		241 -#define __NR_io_destroy		242 -#define __NR_io_getevents	243 -#define __NR_io_submit		244 -#define __NR_io_cancel		245 -#define __NR_fadvise64		246 -#define __NR_exit_group		247 -#define __NR_lookup_dcookie	248 -#define __NR_epoll_create	249 -#define __NR_epoll_ctl		250 -#define __NR_epoll_wait		251 -#define __NR_remap_file_pages	252 -#define __NR_set_tid_address	253 -#define __NR_timer_create	254 -#define __NR_timer_settime	255 -#define __NR_timer_gettime	256 -#define __NR_timer_getoverrun	257 -#define __NR_timer_delete	258 -#define __NR_clock_settime	259 -#define __NR_clock_gettime	260 -#define __NR_clock_getres	261 -#define __NR_clock_nanosleep	262 -#define __NR_statfs64		263 -#define __NR_fstatfs64		264 -#define __NR_tgkill		265 -#define __NR_utimes		266 -#define __NR_fadvise64_64	267 -#define __NR_mbind		268 -#define __NR_get_mempolicy	269 -#define __NR_set_mempolicy	270 -#define __NR_mq_open		271 -#define __NR_mq_unlink		272 -#define __NR_mq_timedsend	273 -#define __NR_mq_timedreceive	274 -#define __NR_mq_notify		275 -#define __NR_mq_getsetattr	276 -#define __NR_waitid		277 -#define __NR_vserver		278 -#define __NR_add_key		279 -#define __NR_request_key	280 -#define __NR_keyctl		281 -#define __NR_ioprio_set		282 -#define __NR_ioprio_get		283 -#define __NR_inotify_init	284 -#define __NR_inotify_add_watch	285 -#define __NR_inotify_rm_watch	286 -#define __NR_migrate_pages	287 -#define __NR_openat		288 -#define __NR_mkdirat		289 -#define __NR_mknodat		290 -#define __NR_fchownat		291 -#define __NR_futimesat		292 -#define __NR_fstatat64		293 -#define __NR_unlinkat		294 -#define __NR_renameat		295 -#define __NR_linkat		296 -#define __NR_symlinkat		297 -#define __NR_readlinkat		298 -#define __NR_fchmodat		299 -#define __NR_faccessat		300 -#define __NR_pselect6		301 -#define __NR_ppoll		302 -#define __NR_unshare		303 -#define __NR_set_robust_list	304 -#define __NR_get_robust_list	305 -#define __NR_splice		306 -#define __NR_sync_file_range	307 -#define __NR_tee		308 -#define __NR_vmsplice		309 -#define __NR_move_pages		310 -#define __NR_sched_setaffinity	311 -#define __NR_sched_getaffinity	312 -#define __NR_kexec_load		313 -#define __NR_getcpu		314 -#define __NR_epoll_pwait	315 -#define __NR_utimensat		316 -#define __NR_signalfd		317 -#define __NR_timerfd_create	318 -#define __NR_eventfd		319 -#define __NR_fallocate		320 -#define __NR_timerfd_settime	321 -#define __NR_timerfd_gettime	322 -#define __NR_signalfd4		323 -#define __NR_eventfd2		324 -#define __NR_epoll_create1	325 -#define __NR_dup3		326 -#define __NR_pipe2		327 -#define __NR_inotify_init1	328 -#define __NR_preadv		329 -#define __NR_pwritev		330 -#define __NR_rt_tgsigqueueinfo	331 -#define __NR_perf_event_open	332 -#define __NR_get_thread_area	333 -#define __NR_set_thread_area	334 -#define __NR_atomic_cmpxchg_32	335 -#define __NR_atomic_barrier	336 -#define __NR_fanotify_init	337 -#define __NR_fanotify_mark	338 -#define __NR_prlimit64		339 -#ifdef __KERNEL__ +#define NR_syscalls		352 -#define NR_syscalls		340 - -#define __ARCH_WANT_IPC_PARSE_VERSION  #define __ARCH_WANT_OLD_READDIR  #define __ARCH_WANT_OLD_STAT  #define __ARCH_WANT_STAT64 @@ -356,7 +13,6 @@  #define __ARCH_WANT_SYS_GETHOSTNAME  #define __ARCH_WANT_SYS_IPC  #define __ARCH_WANT_SYS_PAUSE -#define __ARCH_WANT_SYS_SGETMASK  #define __ARCH_WANT_SYS_SIGNAL  #define __ARCH_WANT_SYS_TIME  #define __ARCH_WANT_SYS_UTIME @@ -372,15 +28,7 @@  #define __ARCH_WANT_SYS_OLDUMOUNT  #define __ARCH_WANT_SYS_SIGPENDING  #define __ARCH_WANT_SYS_SIGPROCMASK -#define __ARCH_WANT_SYS_RT_SIGACTION - -/* - * "Conditional" syscalls - * - * What we want is __attribute__((weak,alias("sys_ni_syscall"))), - * but it doesn't work on all toolchains, so we just do it by hand - */ -#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") +#define __ARCH_WANT_SYS_FORK +#define __ARCH_WANT_SYS_VFORK -#endif /* __KERNEL__ */  #endif /* _ASM_M68K_UNISTD_H_ */ diff --git a/arch/m68k/include/asm/vga.h b/arch/m68k/include/asm/vga.h new file mode 100644 index 00000000000..d3aa1401e7a --- /dev/null +++ b/arch/m68k/include/asm/vga.h @@ -0,0 +1,27 @@ +#ifndef _ASM_M68K_VGA_H +#define _ASM_M68K_VGA_H + +#include <asm/raw_io.h> + +/* + * FIXME + * Ugh, we don't have PCI space, so map readb() and friends to use raw I/O + * accessors, which are identical to the z_*() Zorro bus accessors. + * This should make cirrusfb work again on Amiga + */ +#undef inb_p +#undef inw_p +#undef outb_p +#undef outw +#undef readb +#undef writeb +#undef writew +#define inb_p(port)		0 +#define inw_p(port)		0 +#define outb_p(port, val)	do { } while (0) +#define outw(port, val)		do { } while (0) +#define readb			raw_inb +#define writeb			raw_outb +#define writew			raw_outw + +#endif /* _ASM_M68K_VGA_H */ diff --git a/arch/m68k/include/asm/xor.h b/arch/m68k/include/asm/xor.h deleted file mode 100644 index c82eb12a5b1..00000000000 --- a/arch/m68k/include/asm/xor.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/xor.h>  | 
