diff options
Diffstat (limited to 'arch/m68k')
40 files changed, 267 insertions, 183 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 498b567..d140206 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -14,7 +14,6 @@ config M68K select GENERIC_IOMAP select GENERIC_STRNCPY_FROM_USER if MMU select GENERIC_STRNLEN_USER if MMU - select FPU if MMU select ARCH_WANT_IPC_PARSE_VERSION select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE select HAVE_FUTEX_CMPXCHG if MMU && FUTEX diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu index 967260f..d2219f30 100644 --- a/arch/m68k/Kconfig.cpu +++ b/arch/m68k/Kconfig.cpu @@ -62,6 +62,7 @@ config MCPU32 config M68020 bool "68020 support" depends on MMU + select FPU select CPU_HAS_ADDRESS_SPACES help If you anticipate running this kernel on a computer with a MC68020 @@ -72,6 +73,7 @@ config M68020 config M68030 bool "68030 support" depends on MMU && !MMU_SUN3 + select FPU select CPU_HAS_ADDRESS_SPACES help If you anticipate running this kernel on a computer with a MC68030 @@ -81,6 +83,7 @@ config M68030 config M68040 bool "68040 support" depends on MMU && !MMU_SUN3 + select FPU select CPU_HAS_ADDRESS_SPACES help If you anticipate running this kernel on a computer with a MC68LC040 @@ -91,6 +94,7 @@ config M68040 config M68060 bool "68060 support" depends on MMU && !MMU_SUN3 + select FPU select CPU_HAS_ADDRESS_SPACES help If you anticipate running this kernel on a computer with a MC68060 @@ -259,6 +263,7 @@ config M547x bool "MCF547x" select M54xx select MMU_COLDFIRE if MMU + select FPU if MMU select HAVE_CACHE_CB select HAVE_MBAR select CPU_NO_EFFICIENT_FFS @@ -268,6 +273,7 @@ config M547x config M548x bool "MCF548x" select MMU_COLDFIRE if MMU + select FPU if MMU select M54xx select HAVE_CACHE_CB select HAVE_MBAR diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index ec9cc1f..ddb8192 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -396,7 +396,7 @@ void __init config_amiga(void) mach_max_dma_address = 0xffffffff; mach_reset = amiga_reset; -#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) +#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) mach_beep = amiga_mksound; #endif diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index cbd5991..97a3c38 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -211,7 +211,7 @@ void __init config_atari(void) arch_gettimeoffset = atari_gettimeoffset; mach_reset = atari_reset; mach_max_dma_address = 0xffffff; -#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) +#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) mach_beep = atari_mksound; #endif #ifdef CONFIG_HEARTBEAT diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c index fddfdcc..1e3c7e9 100644 --- a/arch/m68k/coldfire/clk.c +++ b/arch/m68k/coldfire/clk.c @@ -101,6 +101,10 @@ EXPORT_SYMBOL(clk_enable); void clk_disable(struct clk *clk) { unsigned long flags; + + if (!clk) + return; + spin_lock_irqsave(&clk_lock, flags); if ((--clk->enabled == 0) && clk->clk_ops) clk->clk_ops->disable(clk); diff --git a/arch/m68k/coldfire/head.S b/arch/m68k/coldfire/head.S index 73d92ea..bdb472c 100644 --- a/arch/m68k/coldfire/head.S +++ b/arch/m68k/coldfire/head.S @@ -280,10 +280,10 @@ _clear_bss: movel %d0,m68k_cputype /* Mark us as a ColdFire */ movel #MMU_COLDFIRE,%d0 movel %d0,m68k_mmutype - movel #FPU_COLDFIRE,%d0 - movel %d0,m68k_fputype - movel #MACH_M54XX,%d0 - movel %d0,m68k_machtype /* Mark us as a 54xx machine */ + movel #FPUTYPE,%d0 + movel %d0,m68k_fputype /* Mark FPU type */ + movel #MACHINE,%d0 + movel %d0,m68k_machtype /* Mark machine type */ lea init_task,%a2 /* Set "current" init task */ #endif diff --git a/arch/m68k/coldfire/m528x.c b/arch/m68k/coldfire/m528x.c index 45e947a..12f9e37 100644 --- a/arch/m68k/coldfire/m528x.c +++ b/arch/m68k/coldfire/m528x.c @@ -102,14 +102,14 @@ void wildfiremod_halt(void) printk(KERN_INFO "WildFireMod hibernating...\n"); /* Set portE.5 to Digital IO */ - MCF5282_GPIO_PEPAR &= ~(1 << (5 * 2)); + writew(readw(MCFGPIO_PEPAR) & ~(1 << (5 * 2)), MCFGPIO_PEPAR); /* Make portE.5 an output */ - MCF5282_GPIO_DDRE |= (1 << 5); + writeb(readb(MCFGPIO_PDDR_E) | (1 << 5), MCFGPIO_PDDR_E); /* Now toggle portE.5 from low to high */ - MCF5282_GPIO_PORTE &= ~(1 << 5); - MCF5282_GPIO_PORTE |= (1 << 5); + writeb(readb(MCFGPIO_PODR_E) & ~(1 << 5), MCFGPIO_PODR_E); + writeb(readb(MCFGPIO_PODR_E) | (1 << 5), MCFGPIO_PODR_E); printk(KERN_EMERG "Failed to hibernate. Halting!\n"); } diff --git a/arch/m68k/coldfire/m53xx.c b/arch/m68k/coldfire/m53xx.c index 80879a7..2502f63 100644 --- a/arch/m68k/coldfire/m53xx.c +++ b/arch/m68k/coldfire/m53xx.c @@ -271,9 +271,6 @@ void __init config_BSP(char *commandp, int size) #define NAND_FLASH_ADDRESS (0xD0000000) -int sys_clk_khz = 0; -int sys_clk_mhz = 0; - void wtm_init(void); void scm_init(void); void gpio_init(void); @@ -286,9 +283,8 @@ int get_sys_clock (void); asmlinkage void __init sysinit(void) { - sys_clk_khz = clock_pll(0, 0); - sys_clk_mhz = sys_clk_khz/1000; - + clock_pll(0, 0); + wtm_init(); scm_init(); gpio_init(); diff --git a/arch/m68k/coldfire/m54xx.c b/arch/m68k/coldfire/m54xx.c index c32f767..386df3b 100644 --- a/arch/m68k/coldfire/m54xx.c +++ b/arch/m68k/coldfire/m54xx.c @@ -25,7 +25,6 @@ #include <asm/m54xxgpt.h> #ifdef CONFIG_MMU #include <asm/mmu_context.h> -#include <linux/pfn.h> #endif /***************************************************************************/ @@ -78,47 +77,10 @@ static void mcf54xx_reset(void) /***************************************************************************/ -#ifdef CONFIG_MMU - -unsigned long num_pages; - -static void __init mcf54xx_bootmem_alloc(void) -{ - unsigned long start_pfn; - unsigned long memstart; - - /* _rambase and _ramend will be naturally page aligned */ - m68k_memory[0].addr = _rambase; - m68k_memory[0].size = _ramend - _rambase; - - /* compute total pages in system */ - num_pages = PFN_DOWN(_ramend - _rambase); - - /* page numbers */ - memstart = PAGE_ALIGN(_ramstart); - min_low_pfn = PFN_DOWN(_rambase); - start_pfn = PFN_DOWN(memstart); - max_pfn = max_low_pfn = PFN_DOWN(_ramend); - high_memory = (void *)_ramend; - - m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6; - module_fixup(NULL, __start_fixup, __stop_fixup); - - /* setup bootmem data */ - m68k_setup_node(0); - memstart += init_bootmem_node(NODE_DATA(0), start_pfn, - min_low_pfn, max_low_pfn); - free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart); -} - -#endif /* CONFIG_MMU */ - -/***************************************************************************/ - void __init config_BSP(char *commandp, int size) { #ifdef CONFIG_MMU - mcf54xx_bootmem_alloc(); + cf_bootmem_alloc(); mmu_context_init(); #endif mach_reset = mcf54xx_reset; diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 8f5b6f7..55be7e3 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig @@ -566,6 +566,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -584,6 +586,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index 31bded9..365dda66 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig @@ -525,6 +525,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -543,6 +545,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 0d7739e..ce3cbfd 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig @@ -546,6 +546,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -564,6 +566,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index 2cbb5c4..8db496a 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig @@ -517,6 +517,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -535,6 +537,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index 96102a4..8314156 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig @@ -527,6 +527,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -545,6 +547,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 97d88f7..6600270 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig @@ -549,6 +549,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -567,6 +569,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index be25ef2..90abfe9 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig @@ -629,6 +629,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -647,6 +649,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index a008344..0d502c2 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig @@ -517,6 +517,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -535,6 +537,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 6735a25..5930e91 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig @@ -517,6 +517,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -535,6 +537,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 780c6e9..74e3ad8 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig @@ -540,6 +540,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -558,6 +560,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 44693cf..4ba8606 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig @@ -518,6 +518,8 @@ CONFIG_TEST_FIRMWARE=m CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -536,6 +538,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index ef0071d..c6f4972 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig @@ -519,6 +519,8 @@ CONFIG_TEST_UDELAY=m CONFIG_TEST_STATIC_KEYS=m CONFIG_EARLY_PRINTK=y CONFIG_CRYPTO_RSA=m +CONFIG_CRYPTO_DH=m +CONFIG_CRYPTO_ECDH=m CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_CRYPTD=m @@ -537,6 +539,7 @@ CONFIG_CRYPTO_RMD160=m CONFIG_CRYPTO_RMD256=m CONFIG_CRYPTO_RMD320=m CONFIG_CRYPTO_SHA512=m +CONFIG_CRYPTO_SHA3=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_ANUBIS=m diff --git a/arch/m68k/include/asm/bootinfo.h b/arch/m68k/include/asm/bootinfo.h index 8e21326..81c91af 100644 --- a/arch/m68k/include/asm/bootinfo.h +++ b/arch/m68k/include/asm/bootinfo.h @@ -22,6 +22,12 @@ extern void save_bootinfo(const struct bi_record *bi); static inline void save_bootinfo(const struct bi_record *bi) {} #endif +#ifdef CONFIG_UBOOT +void process_uboot_commandline(char *commandp, int size); +#else +static inline void process_uboot_commandline(char *commandp, int size) {} +#endif + #endif /* __ASSEMBLY__ */ diff --git a/arch/m68k/include/asm/m5441xsim.h b/arch/m68k/include/asm/m5441xsim.h index cc798ab..64f60be 100644 --- a/arch/m68k/include/asm/m5441xsim.h +++ b/arch/m68k/include/asm/m5441xsim.h @@ -10,6 +10,10 @@ #define CPU_NAME "COLDFIRE(m5441x)" #define CPU_INSTR_PER_JIFFY 2 #define MCF_BUSCLK (MCF_CLK / 2) +#define MACHINE MACH_M5441X +#define FPUTYPE 0 +#define IOMEMBASE 0xe0000000 +#define IOMEMSIZE 0x20000000 #include <asm/m54xxacr.h> diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h index 59e1710..c6ac05c 100644 --- a/arch/m68k/include/asm/m54xxacr.h +++ b/arch/m68k/include/asm/m54xxacr.h @@ -94,7 +94,7 @@ * 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)+ \ +#define ACR0_MODE (ACR_BA(IOMEMBASE)+ACR_ADMSK(IOMEMSIZE)+ \ 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)+ \ diff --git a/arch/m68k/include/asm/m54xxsim.h b/arch/m68k/include/asm/m54xxsim.h index a5fbd17..73d937f 100644 --- a/arch/m68k/include/asm/m54xxsim.h +++ b/arch/m68k/include/asm/m54xxsim.h @@ -8,6 +8,10 @@ #define CPU_NAME "COLDFIRE(m54xx)" #define CPU_INSTR_PER_JIFFY 2 #define MCF_BUSCLK (MCF_CLK / 2) +#define MACHINE MACH_M54XX +#define FPUTYPE FPU_COLDFIRE +#define IOMEMBASE MCF_MBAR +#define IOMEMSIZE 0x01000000 #include <asm/m54xxacr.h> diff --git a/arch/m68k/include/asm/mcfmmu.h b/arch/m68k/include/asm/mcfmmu.h index 8824236..10f9930 100644 --- a/arch/m68k/include/asm/mcfmmu.h +++ b/arch/m68k/include/asm/mcfmmu.h @@ -105,6 +105,7 @@ static inline void mmu_write(u32 a, u32 v) __asm__ __volatile__ ("nop"); } +void cf_bootmem_alloc(void); int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word); #endif diff --git a/arch/m68k/include/asm/nettel.h b/arch/m68k/include/asm/nettel.h index 2a7a766..926375d 100644 --- a/arch/m68k/include/asm/nettel.h +++ b/arch/m68k/include/asm/nettel.h @@ -92,7 +92,7 @@ static __inline__ unsigned int mcf_getppdata(void) static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits) { - write((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT); + writew((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT); } #endif diff --git a/arch/m68k/include/uapi/asm/bootinfo.h b/arch/m68k/include/uapi/asm/bootinfo.h index cdeb26a0..a48cf54 100644 --- a/arch/m68k/include/uapi/asm/bootinfo.h +++ b/arch/m68k/include/uapi/asm/bootinfo.h @@ -81,6 +81,7 @@ struct mem_info { #define MACH_Q40 10 #define MACH_SUN3X 11 #define MACH_M54XX 12 +#define MACH_M5441X 13 /* diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile index e47778f..8a1c4d3 100644 --- a/arch/m68k/kernel/Makefile +++ b/arch/m68k/kernel/Makefile @@ -24,6 +24,7 @@ obj-$(CONFIG_HAS_DMA) += dma.o obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o obj-$(CONFIG_BOOTINFO_PROC) += bootinfo_proc.o +obj-$(CONFIG_UBOOT) += uboot.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index c55ff71..4ba1ae7 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -203,11 +203,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, } /* Fill in the fpu structure for a core dump. */ -#ifdef CONFIG_FPU int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu) { - char fpustate[216]; - if (FPU_IS_EMU) { int i; @@ -222,37 +219,40 @@ int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu) return 1; } - /* First dump the fpu context to avoid protocol violation. */ - asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory"); - if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2]) - return 0; + if (IS_ENABLED(CONFIG_FPU)) { + char fpustate[216]; - if (CPU_IS_COLDFIRE) { - asm volatile ("fmovel %/fpiar,%0\n\t" - "fmovel %/fpcr,%1\n\t" - "fmovel %/fpsr,%2\n\t" - "fmovemd %/fp0-%/fp7,%3" - : - : "m" (fpu->fpcntl[0]), - "m" (fpu->fpcntl[1]), - "m" (fpu->fpcntl[2]), - "m" (fpu->fpregs[0]) - : "memory"); - } else { - asm volatile ("fmovem %/fpiar/%/fpcr/%/fpsr,%0" - : - : "m" (fpu->fpcntl[0]) - : "memory"); - asm volatile ("fmovemx %/fp0-%/fp7,%0" - : - : "m" (fpu->fpregs[0]) - : "memory"); + /* First dump the fpu context to avoid protocol violation. */ + asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory"); + if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2]) + return 0; + + if (CPU_IS_COLDFIRE) { + asm volatile ("fmovel %/fpiar,%0\n\t" + "fmovel %/fpcr,%1\n\t" + "fmovel %/fpsr,%2\n\t" + "fmovemd %/fp0-%/fp7,%3" + : + : "m" (fpu->fpcntl[0]), + "m" (fpu->fpcntl[1]), + "m" (fpu->fpcntl[2]), + "m" (fpu->fpregs[0]) + : "memory"); + } else { + asm volatile ("fmovem %/fpiar/%/fpcr/%/fpsr,%0" + : + : "m" (fpu->fpcntl[0]) + : "memory"); + asm volatile ("fmovemx %/fp0-%/fp7,%0" + : + : "m" (fpu->fpregs[0]) + : "memory"); + } } return 1; } EXPORT_SYMBOL(dump_fpu); -#endif /* CONFIG_FPU */ unsigned long get_wchan(struct task_struct *p) { diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c index 5b8ec4d..7a2c212 100644 --- a/arch/m68k/kernel/setup_mm.c +++ b/arch/m68k/kernel/setup_mm.c @@ -105,7 +105,7 @@ EXPORT_SYMBOL(mach_heartbeat); #ifdef CONFIG_M68K_L2_CACHE void (*mach_l2_flush) (int); #endif -#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) +#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) void (*mach_beep)(unsigned int, unsigned int); EXPORT_SYMBOL(mach_beep); #endif @@ -245,7 +245,7 @@ void __init setup_arch(char **cmdline_p) * We should really do our own FPU check at startup. * [what do we do with buggy 68LC040s? if we have problems * with them, we should add a test to check_bugs() below] */ -#ifndef CONFIG_M68KFPU_EMU_ONLY +#if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU_ONLY) /* clear the fpu if we have one */ if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|FPU_COLDFIRE)) { volatile int zero = 0; @@ -274,6 +274,7 @@ void __init setup_arch(char **cmdline_p) strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE); m68k_command_line[CL_SIZE - 1] = 0; #endif /* CONFIG_BOOTPARAM */ + process_uboot_commandline(&m68k_command_line[0], CL_SIZE); *cmdline_p = m68k_command_line; memcpy(boot_command_line, *cmdline_p, CL_SIZE); @@ -341,6 +342,7 @@ void __init setup_arch(char **cmdline_p) #endif #ifdef CONFIG_COLDFIRE case MACH_M54XX: + case MACH_M5441X: config_BSP(NULL, 0); break; #endif @@ -548,7 +550,7 @@ module_init(proc_hardware_init); void check_bugs(void) { -#ifndef CONFIG_M68KFPU_EMU +#if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU) if (m68k_fputype == 0) { pr_emerg("*** YOU DO NOT HAVE A FLOATING POINT UNIT, " "WHICH IS REQUIRED BY LINUX/M68K ***\n"); diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c index 9309789..8afe6f6 100644 --- a/arch/m68k/kernel/setup_no.c +++ b/arch/m68k/kernel/setup_no.c @@ -34,6 +34,7 @@ #include <linux/rtc.h> #include <asm/setup.h> +#include <asm/bootinfo.h> #include <asm/irq.h> #include <asm/machdep.h> #include <asm/pgtable.h> @@ -82,69 +83,6 @@ void (*mach_power_off)(void); #define CPU_INSTR_PER_JIFFY 16 #endif -#if defined(CONFIG_UBOOT) -/* - * parse_uboot_commandline - * - * Copies u-boot commandline arguments and store them in the proper linux - * variables. - * - * Assumes: - * _init_sp global contains the address in the stack pointer when the - * kernel starts (see head.S::_start) - * - * U-Boot calling convention: - * (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); - * - * _init_sp can be parsed as such - * - * _init_sp+00 = u-boot cmd after jsr into kernel (skip) - * _init_sp+04 = &kernel board_info (residual data) - * _init_sp+08 = &initrd_start - * _init_sp+12 = &initrd_end - * _init_sp+16 = &cmd_start - * _init_sp+20 = &cmd_end - * - * This also assumes that the memory locations pointed to are still - * unmodified. U-boot places them near the end of external SDRAM. - * - * Argument(s): - * commandp = the linux commandline arg container to fill. - * size = the sizeof commandp. - * - * Returns: - */ -static void __init parse_uboot_commandline(char *commandp, int size) -{ - extern unsigned long _init_sp; - unsigned long *sp; - unsigned long uboot_kbd; - unsigned long uboot_initrd_start, uboot_initrd_end; - unsigned long uboot_cmd_start, uboot_cmd_end; - - - sp = (unsigned long *)_init_sp; - uboot_kbd = sp[1]; - uboot_initrd_start = sp[2]; - uboot_initrd_end = sp[3]; - uboot_cmd_start = sp[4]; - uboot_cmd_end = sp[5]; - - if (uboot_cmd_start && uboot_cmd_end) - strncpy(commandp, (const char *)uboot_cmd_start, size); -#if defined(CONFIG_BLK_DEV_INITRD) - if (uboot_initrd_start && uboot_initrd_end && - (uboot_initrd_end > uboot_initrd_start)) { - initrd_start = uboot_initrd_start; - initrd_end = uboot_initrd_end; - ROOT_DEV = Root_RAM0; - printk(KERN_INFO "initrd at 0x%lx:0x%lx\n", - initrd_start, initrd_end); - } -#endif /* if defined(CONFIG_BLK_DEV_INITRD) */ -} -#endif /* #if defined(CONFIG_UBOOT) */ - void __init setup_arch(char **cmdline_p) { int bootmap_size; @@ -164,53 +102,38 @@ void __init setup_arch(char **cmdline_p) command_line[sizeof(command_line) - 1] = 0; #endif /* CONFIG_BOOTPARAM */ -#if defined(CONFIG_UBOOT) - /* CONFIG_UBOOT and CONFIG_BOOTPARAM defined, concatenate cmdline */ - #if defined(CONFIG_BOOTPARAM) - /* Add the whitespace separator */ - command_line[strlen(CONFIG_BOOTPARAM_STRING)] = ' '; - /* Parse uboot command line into the rest of the buffer */ - parse_uboot_commandline( - &command_line[(strlen(CONFIG_BOOTPARAM_STRING)+1)], - (sizeof(command_line) - - (strlen(CONFIG_BOOTPARAM_STRING)+1))); - /* Only CONFIG_UBOOT defined, create cmdline */ - #else - parse_uboot_commandline(&command_line[0], sizeof(command_line)); - #endif /* CONFIG_BOOTPARAM */ - command_line[sizeof(command_line) - 1] = 0; -#endif /* CONFIG_UBOOT */ + process_uboot_commandline(&command_line[0], sizeof(command_line)); - printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU_NAME "\n"); + pr_info("uClinux with CPU " CPU_NAME "\n"); #ifdef CONFIG_UCDIMM - printk(KERN_INFO "uCdimm by Lineo, Inc. <www.lineo.com>\n"); + pr_info("uCdimm by Lineo, Inc. <www.lineo.com>\n"); #endif #ifdef CONFIG_M68VZ328 - printk(KERN_INFO "M68VZ328 support by Evan Stawnyczy <e@lineo.ca>\n"); + pr_info("M68VZ328 support by Evan Stawnyczy <e@lineo.ca>\n"); #endif #ifdef CONFIG_COLDFIRE - printk(KERN_INFO "COLDFIRE port done by Greg Ungerer, gerg@snapgear.com\n"); + pr_info("COLDFIRE port done by Greg Ungerer, gerg@snapgear.com\n"); #ifdef CONFIG_M5307 - printk(KERN_INFO "Modified for M5307 by Dave Miller, dmiller@intellistor.com\n"); + pr_info("Modified for M5307 by Dave Miller, dmiller@intellistor.com\n"); #endif #ifdef CONFIG_ELITE - printk(KERN_INFO "Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n"); + pr_info("Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n"); #endif #endif - printk(KERN_INFO "Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n"); + pr_info("Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n"); #if defined( CONFIG_PILOT ) && defined( CONFIG_M68328 ) - printk(KERN_INFO "TRG SuperPilot FLASH card support <info@trgnet.com>\n"); + pr_info("TRG SuperPilot FLASH card support <info@trgnet.com>\n"); #endif #if defined( CONFIG_PILOT ) && defined( CONFIG_M68EZ328 ) - printk(KERN_INFO "PalmV support by Lineo Inc. <jeff@uclinux.com>\n"); + pr_info("PalmV support by Lineo Inc. <jeff@uclinux.com>\n"); #endif #ifdef CONFIG_DRAGEN2 - printk(KERN_INFO "DragonEngine II board support by Georges Menie\n"); + pr_info("DragonEngine II board support by Georges Menie\n"); #endif #ifdef CONFIG_M5235EVB - printk(KERN_INFO "Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n"); + pr_info("Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n"); #endif pr_debug("KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p BSS=0x%p-0x%p\n", diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 9202f82..58507ed 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -42,7 +42,7 @@ #include <linux/personality.h> #include <linux/tty.h> #include <linux/binfmts.h> -#include <linux/module.h> +#include <linux/extable.h> #include <linux/tracehook.h> #include <asm/setup.h> diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c new file mode 100644 index 0000000..b3536a8 --- /dev/null +++ b/arch/m68k/kernel/uboot.c @@ -0,0 +1,107 @@ +/* + * uboot.c -- uboot arguments support + * + * 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. + */ + +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/delay.h> +#include <linux/interrupt.h> +#include <linux/fb.h> +#include <linux/module.h> +#include <linux/mm.h> +#include <linux/console.h> +#include <linux/errno.h> +#include <linux/string.h> +#include <linux/bootmem.h> +#include <linux/seq_file.h> +#include <linux/init.h> +#include <linux/initrd.h> +#include <linux/root_dev.h> +#include <linux/rtc.h> + +#include <asm/setup.h> +#include <asm/irq.h> +#include <asm/machdep.h> +#include <asm/pgtable.h> +#include <asm/sections.h> + +/* + * parse_uboot_commandline + * + * Copies u-boot commandline arguments and store them in the proper linux + * variables. + * + * Assumes: + * _init_sp global contains the address in the stack pointer when the + * kernel starts (see head.S::_start) + * + * U-Boot calling convention: + * (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end); + * + * _init_sp can be parsed as such + * + * _init_sp+00 = u-boot cmd after jsr into kernel (skip) + * _init_sp+04 = &kernel board_info (residual data) + * _init_sp+08 = &initrd_start + * _init_sp+12 = &initrd_end + * _init_sp+16 = &cmd_start + * _init_sp+20 = &cmd_end + * + * This also assumes that the memory locations pointed to are still + * unmodified. U-boot places them near the end of external SDRAM. + * + * Argument(s): + * commandp = the linux commandline arg container to fill. + * size = the sizeof commandp. + * + * Returns: + */ +static void __init parse_uboot_commandline(char *commandp, int size) +{ + extern unsigned long _init_sp; + unsigned long *sp; + unsigned long uboot_kbd; + unsigned long uboot_initrd_start, uboot_initrd_end; + unsigned long uboot_cmd_start, uboot_cmd_end; + + sp = (unsigned long *)_init_sp; + uboot_kbd = sp[1]; + uboot_initrd_start = sp[2]; + uboot_initrd_end = sp[3]; + uboot_cmd_start = sp[4]; + uboot_cmd_end = sp[5]; + + if (uboot_cmd_start && uboot_cmd_end) + strncpy(commandp, (const char *)uboot_cmd_start, size); +#if defined(CONFIG_BLK_DEV_INITRD) + if (uboot_initrd_start && uboot_initrd_end && + (uboot_initrd_end > uboot_initrd_start)) { + initrd_start = uboot_initrd_start; + initrd_end = uboot_initrd_end; + ROOT_DEV = Root_RAM0; + printk(KERN_INFO "initrd at 0x%lx:0x%lx\n", + initrd_start, initrd_end); + } +#endif /* if defined(CONFIG_BLK_DEV_INITRD) */ +} + +__init void process_uboot_commandline(char *commandp, int size) +{ + int len, n; + + n = strnlen(commandp, size); + commandp += n; + len = size - n; + if (len) { + /* Add the whitespace separator */ + *commandp++ = ' '; + len--; + } + + parse_uboot_commandline(commandp, len); + commandp[size - 1] = 0; +} diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds index 06a763f..d2c8abf 100644 --- a/arch/m68k/kernel/vmlinux-nommu.lds +++ b/arch/m68k/kernel/vmlinux-nommu.lds @@ -45,6 +45,7 @@ SECTIONS { HEAD_TEXT TEXT_TEXT SCHED_TEXT + CPUIDLE_TEXT LOCK_TEXT *(.fixup) . = ALIGN(16); diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index d099359..5b5ce1e 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds @@ -16,6 +16,7 @@ SECTIONS HEAD_TEXT TEXT_TEXT SCHED_TEXT + CPUIDLE_TEXT LOCK_TEXT *(.fixup) *(.gnu.warning) diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index 8080469..fe5ea19 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds @@ -16,6 +16,7 @@ SECTIONS HEAD_TEXT TEXT_TEXT SCHED_TEXT + CPUIDLE_TEXT LOCK_TEXT *(.fixup) *(.gnu.warning) diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 2f33a33..e468953 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -162,7 +162,7 @@ void __init config_mac(void) mach_halt = mac_poweroff; mach_power_off = mac_poweroff; mach_max_dma_address = 0xffffffff; -#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) +#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) mach_beep = mac_mksound; #endif diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c index f58fafe..87131cd 100644 --- a/arch/m68k/mm/mcfmmu.c +++ b/arch/m68k/mm/mcfmmu.c @@ -27,7 +27,7 @@ mm_context_t next_mmu_context; unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1]; atomic_t nr_free_contexts; struct mm_struct *context_mm[LAST_CONTEXT+1]; -extern unsigned long num_pages; +unsigned long num_pages; /* * ColdFire paging_init derived from sun3. @@ -150,6 +150,35 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word) return 0; } +void __init cf_bootmem_alloc(void) +{ + unsigned long start_pfn; + unsigned long memstart; + + /* _rambase and _ramend will be naturally page aligned */ + m68k_memory[0].addr = _rambase; + m68k_memory[0].size = _ramend - _rambase; + + /* compute total pages in system */ + num_pages = PFN_DOWN(_ramend - _rambase); + + /* page numbers */ + memstart = PAGE_ALIGN(_ramstart); + min_low_pfn = PFN_DOWN(_rambase); + start_pfn = PFN_DOWN(memstart); + max_pfn = max_low_pfn = PFN_DOWN(_ramend); + high_memory = (void *)_ramend; + + m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6; + module_fixup(NULL, __start_fixup, __stop_fixup); + + /* setup bootmem data */ + m68k_setup_node(0); + memstart += init_bootmem_node(NODE_DATA(0), start_pfn, + min_low_pfn, max_low_pfn); + free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart); +} + /* * Initialize the context management stuff. * The following was taken from arch/ppc/mmu_context.c diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index fcb7f05..ea89a24 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -180,7 +180,7 @@ void __init config_q40(void) mach_reset = q40_reset; mach_get_model = q40_get_model; -#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) +#if IS_ENABLED(CONFIG_INPUT_M68K_BEEP) mach_beep = q40_mksound; #endif #ifdef CONFIG_HEARTBEAT |