Commit bdab2250 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-mn10300: (44 commits)
  MN10300: Save frame pointer in thread_info struct rather than global var
  MN10300: Change "Matsushita" to "Panasonic".
  MN10300: Create a defconfig for the ASB2364 board
  MN10300: Update the ASB2303 defconfig
  MN10300: ASB2364: Add support for SMSC911X and SMC911X
  MN10300: ASB2364: Handle the IRQ multiplexer in the FPGA
  MN10300: Generic time support
  MN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support
  MN10300: Map userspace atomic op regs as a vmalloc page
  MN10300: And Panasonic AM34 subarch and implement SMP
  MN10300: Delete idle_timestamp from irq_cpustat_t
  MN10300: Make various interrupt priority settings configurable
  MN10300: Optimise do_csum()
  MN10300: Implement atomic ops using atomic ops unit
  MN10300: Make the FPU operate in non-lazy mode under SMP
  MN10300: SMP TLB flushing
  MN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control
  MN10300: Make the use of PIDR to mark TLB entries controllable
  MN10300: Rename __flush_tlb*() to local_flush_tlb*()
  MN10300: AM34 erratum requires MMUCTR read and write on exception entry
  ...
parents 7c5814c7 7c7fcf76
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@ targets += arch/$(SRCARCH)/kernel/asm-offsets.s
# Default sed regexp - multiline due to syntax constraints
# Default sed regexp - multiline due to syntax constraints
define sed-y
define sed-y
	"/^->/{s:->#\(.*\):/* \1 */:; \
	"/^->/{s:->#\(.*\):/* \1 */:; \
	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 (\2) /* \3 */:; \
	s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
	s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
	s:->::; p;}"
	s:->::; p;}"
endef
endef
+1 −1
Original line number Original line Diff line number Diff line
@@ -4448,7 +4448,7 @@ L: platform-driver-x86@vger.kernel.org
S:	Maintained
S:	Maintained
F:	drivers/platform/x86/panasonic-laptop.c
F:	drivers/platform/x86/panasonic-laptop.c


PANASONIC MN10300/AM33 PORT
PANASONIC MN10300/AM33/AM34 PORT
M:	David Howells <dhowells@redhat.com>
M:	David Howells <dhowells@redhat.com>
M:	Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
M:	Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
L:	linux-am33-list@redhat.com (moderated for non-subscribers)
L:	linux-am33-list@redhat.com (moderated for non-subscribers)
+219 −60
Original line number Original line Diff line number Diff line
@@ -9,8 +9,19 @@ config MN10300
	def_bool y
	def_bool y
	select HAVE_OPROFILE
	select HAVE_OPROFILE


config AM33
config AM33_2
	def_bool y
	def_bool n

config AM33_3
	def_bool n

config AM34_2
	def_bool n
	select MN10300_HAS_ATOMIC_OPS_UNIT
	select MN10300_HAS_CACHE_SNOOP

config ERRATUM_NEED_TO_RELOAD_MMUCTR
	def_bool y if AM33_3 || AM34_2


config MMU
config MMU
	def_bool y
	def_bool y
@@ -37,7 +48,7 @@ config GENERIC_CALIBRATE_DELAY
	def_bool y
	def_bool y


config GENERIC_CMOS_UPDATE
config GENERIC_CMOS_UPDATE
        def_bool y
        def_bool n


config GENERIC_FIND_NEXT_BIT
config GENERIC_FIND_NEXT_BIT
	def_bool y
	def_bool y
@@ -45,6 +56,27 @@ config GENERIC_FIND_NEXT_BIT
config GENERIC_HWEIGHT
config GENERIC_HWEIGHT
	def_bool y
	def_bool y


config GENERIC_TIME
	def_bool y

config GENERIC_CLOCKEVENTS
	def_bool y

config GENERIC_CLOCKEVENTS_BUILD
	def_bool y
	depends on GENERIC_CLOCKEVENTS

config GENERIC_CLOCKEVENTS_BROADCAST
	bool

config CEVT_MN10300
       def_bool y
       depends on GENERIC_CLOCKEVENTS

config CSRC_MN10300
       def_bool y
       depends on GENERIC_TIME

config GENERIC_BUG
config GENERIC_BUG
	def_bool y
	def_bool y


@@ -61,18 +93,14 @@ config GENERIC_HARDIRQS
config HOTPLUG_CPU
config HOTPLUG_CPU
	def_bool n
	def_bool n


config HZ
mainmenu "Panasonic MN10300/AM33 Kernel Configuration"
	int
	default 1000

mainmenu "Matsushita MN10300/AM33 Kernel Configuration"


source "init/Kconfig"
source "init/Kconfig"


source "kernel/Kconfig.freezer"
source "kernel/Kconfig.freezer"




menu "Matsushita MN10300 system setup"
menu "Panasonic MN10300 system setup"


choice
choice
	prompt "Unit type"
	prompt "Unit type"
@@ -87,6 +115,10 @@ config MN10300_UNIT_ASB2303
config MN10300_UNIT_ASB2305
config MN10300_UNIT_ASB2305
	bool "ASB2305"
	bool "ASB2305"


config MN10300_UNIT_ASB2364
	bool "ASB2364"
	select SMSC911X_ARCH_HOOKS if SMSC911X

endchoice
endchoice


choice
choice
@@ -99,57 +131,51 @@ choice
config MN10300_PROC_MN103E010
config MN10300_PROC_MN103E010
	bool "MN103E010"
	bool "MN103E010"
	depends on MN10300_UNIT_ASB2303 || MN10300_UNIT_ASB2305
	depends on MN10300_UNIT_ASB2303 || MN10300_UNIT_ASB2305
	select AM33_2
	select MN10300_PROC_HAS_TTYSM0
	select MN10300_PROC_HAS_TTYSM1
	select MN10300_PROC_HAS_TTYSM2

config MN10300_PROC_MN2WS0050
	bool "MN2WS0050"
	depends on MN10300_UNIT_ASB2364
	select AM34_2
	select MN10300_PROC_HAS_TTYSM0
	select MN10300_PROC_HAS_TTYSM0
	select MN10300_PROC_HAS_TTYSM1
	select MN10300_PROC_HAS_TTYSM1
	select MN10300_PROC_HAS_TTYSM2
	select MN10300_PROC_HAS_TTYSM2


endchoice
endchoice


choice
config MN10300_HAS_ATOMIC_OPS_UNIT
	prompt "Processor core support"
	def_bool n
	default MN10300_CPU_AM33V2
	help
	help
	  This option specifies the processor core for which the kernel will be
	  This should be enabled if the processor has an atomic ops unit
	  compiled. It affects the instruction set used.
	  capable of doing LL/SC equivalent operations.

config MN10300_CPU_AM33V2
	bool "AM33v2"

endchoice


config FPU
config FPU
	bool "FPU present"
	bool "FPU present"
	default y
	default y
	depends on MN10300_PROC_MN103E010
	depends on MN10300_PROC_MN103E010 || MN10300_PROC_MN2WS0050


choice
config LAZY_SAVE_FPU
	prompt "CPU Caching mode"
	bool "Save FPU state lazily"
	default MN10300_CACHE_WBACK
	default y
	depends on FPU && !SMP
	help
	help
	  This option determines the caching mode for the kernel.
	  Enable this to be lazy in the saving of the FPU state to the owning

	  task's thread struct.  This is useful if most tasks on the system
	  Write-Back caching mode involves the all reads and writes causing
	  don't use the FPU as only those tasks that use it will pass it
	  the affected cacheline to be read into the cache first before being
	  between them, and the state needn't be saved for a task that isn't
	  operated upon. Memory is not then updated by a write until the cache
	  using it.
	  is filled and a cacheline needs to be displaced from the cache to
	  make room. Only at that point is it written back.


	  Write-Through caching only fetches cachelines from memory on a
	  This can't be so easily used on SMP as the process that owns the FPU
	  read. Writes always get written directly to memory. If the affected
	  state on a CPU may be currently running on another CPU, so for the
	  cacheline is also in cache, it will be updated too.
	  moment, it is disabled.


	  The final option is to turn of caching entirely.
source "arch/mn10300/mm/Kconfig.cache"


config MN10300_CACHE_WBACK
config MN10300_TLB_USE_PIDR
	bool "Write-Back"
	def_bool y

config MN10300_CACHE_WTHRU
	bool "Write-Through"

config MN10300_CACHE_DISABLED
	bool "Disabled"

endchoice


menu "Memory layout options"
menu "Memory layout options"


@@ -170,24 +196,55 @@ config KERNEL_TEXT_ADDRESS


config KERNEL_ZIMAGE_BASE_ADDRESS
config KERNEL_ZIMAGE_BASE_ADDRESS
	hex "Base address of compressed vmlinux image"
	hex "Base address of compressed vmlinux image"
	default "0x90700000"
	default "0x50700000"


config BOOT_STACK_OFFSET
	hex
	default	"0xF00"	if SMP
	default	"0xFF0" if !SMP

config BOOT_STACK_SIZE
	hex
	depends on SMP
	default	"0x100"
endmenu
endmenu


config PREEMPT
config SMP
	bool "Preemptible Kernel"
	bool "Symmetric multi-processing support"
	help
	default y
	  This option reduces the latency of the kernel when reacting to
	depends on MN10300_PROC_MN2WS0038 || MN10300_PROC_MN2WS0050
	  real-time or interactive events by allowing a low priority process to
	---help---
	  be preempted even if it is in kernel mode executing a system call.
	  This enables support for systems with more than one CPU. If you have
	  This allows applications to run more reliably even when the system is
	  a system with only one CPU, like most personal computers, say N. If
	  under load.
	  you have a system with more than one CPU, say Y.

	  If you say N here, the kernel will run on single and multiprocessor
	  machines, but will use only one CPU of a multiprocessor machine. If
	  you say Y here, the kernel will run on many, but not all,
	  singleprocessor machines. On a singleprocessor machine, the kernel
	  will run faster if you say N here.


	  Say Y here if you are building a kernel for a desktop, embedded
	  See also <file:Documentation/i386/IO-APIC.txt>,
	  or real-time system.  Say N if you are unsure.
	  <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
	  <http://www.tldp.org/docs.html#howto>.

	  If you don't know what to do here, say N.

config NR_CPUS
	int
	depends on SMP
	default "2"

config USE_GENERIC_SMP_HELPERS
	bool
	depends on SMP
	default y

source "kernel/Kconfig.preempt"


config MN10300_CURRENT_IN_E2
config MN10300_CURRENT_IN_E2
	bool "Hold current task address in E2 register"
	bool "Hold current task address in E2 register"
	depends on !SMP
	default y
	default y
	help
	help
	  This option removes the E2/R2 register from the set available to gcc
	  This option removes the E2/R2 register from the set available to gcc
@@ -209,12 +266,15 @@ config MN10300_USING_JTAG
	  suppresses the use of certain hardware debugging features, such as
	  suppresses the use of certain hardware debugging features, such as
	  single-stepping, which are taken over completely by the JTAG unit.
	  single-stepping, which are taken over completely by the JTAG unit.


source "kernel/Kconfig.hz"
source "kernel/time/Kconfig"

config MN10300_RTC
config MN10300_RTC
	bool "Using MN10300 RTC"
	bool "Using MN10300 RTC"
	depends on MN10300_PROC_MN103E010
	depends on MN10300_PROC_MN103E010 || MN10300_PROC_MN2WS0050
	select GENERIC_CMOS_UPDATE
	default n
	default n
	help
	help

	  This option enables support for the RTC, thus enabling time to be
	  This option enables support for the RTC, thus enabling time to be
	  tracked, even when system is powered down. This is available on-chip
	  tracked, even when system is powered down. This is available on-chip
	  on the MN103E010.
	  on the MN103E010.
@@ -306,14 +366,23 @@ config MN10300_TTYSM1


choice
choice
	prompt "Select the timer to supply the clock for SIF1"
	prompt "Select the timer to supply the clock for SIF1"
	default MN10300_TTYSM0_TIMER9
	default MN10300_TTYSM1_TIMER12 \
		if !(AM33_2 || AM33_3)
	default MN10300_TTYSM1_TIMER9 \
		if AM33_2 || AM33_3
	depends on MN10300_TTYSM1
	depends on MN10300_TTYSM1


config MN10300_TTYSM1_TIMER12
	bool "Use timer 12 (16-bit)"
	depends on !(AM33_2 || AM33_3)

config MN10300_TTYSM1_TIMER9
config MN10300_TTYSM1_TIMER9
	bool "Use timer 9 (16-bit)"
	bool "Use timer 9 (16-bit)"
	depends on AM33_2 || AM33_3


config MN10300_TTYSM1_TIMER3
config MN10300_TTYSM1_TIMER3
	bool "Use timer 3 (8-bit)"
	bool "Use timer 3 (8-bit)"
	depends on AM33_2 || AM33_3


endchoice
endchoice


@@ -328,17 +397,107 @@ config MN10300_TTYSM2


choice
choice
	prompt "Select the timer to supply the clock for SIF2"
	prompt "Select the timer to supply the clock for SIF2"
	default MN10300_TTYSM0_TIMER10
	default MN10300_TTYSM2_TIMER3 \
		if !(AM33_2 || AM33_3)
	default MN10300_TTYSM2_TIMER10 \
		if AM33_2 || AM33_3
	depends on MN10300_TTYSM2
	depends on MN10300_TTYSM2


config MN10300_TTYSM2_TIMER9
	bool "Use timer 9 (16-bit)"
	depends on !(AM33_2 || AM33_3)

config MN10300_TTYSM2_TIMER1
	bool "Use timer 1 (8-bit)"
	depends on !(AM33_2 || AM33_3)

config MN10300_TTYSM2_TIMER3
	bool "Use timer 3 (8-bit)"
	depends on !(AM33_2 || AM33_3)

config MN10300_TTYSM2_TIMER10
config MN10300_TTYSM2_TIMER10
	bool "Use timer 10 (16-bit)"
	bool "Use timer 10 (16-bit)"
	depends on AM33_2 || AM33_3


endchoice
endchoice


config MN10300_TTYSM2_CTS
config MN10300_TTYSM2_CTS
	bool "Enable the use of the CTS line /dev/ttySM2"
	bool "Enable the use of the CTS line /dev/ttySM2"
	depends on MN10300_TTYSM2
	depends on MN10300_TTYSM2 && AM33_2

endmenu

menu "Interrupt request priority options"

comment "[!] NOTE: A lower number/level indicates a higher priority (0 is highest, 6 is lowest)"

comment "____Non-maskable interrupt levels____"
comment "The following must be set to a higher priority than local_irq_disable() and on-chip serial"

config GDBSTUB_IRQ_LEVEL
	int "GDBSTUB interrupt priority"
	depends on GDBSTUB
	range 0 1 if LINUX_CLI_LEVEL = 2
	range 0 2 if LINUX_CLI_LEVEL = 3
	range 0 3 if LINUX_CLI_LEVEL = 4
	range 0 4 if LINUX_CLI_LEVEL = 5
	range 0 5 if LINUX_CLI_LEVEL = 6
	default 0

comment "The following must be set to a higher priority than local_irq_disable()"

config MN10300_SERIAL_IRQ_LEVEL
	int "MN10300 on-chip serial interrupt priority"
	depends on MN10300_TTYSM
	range 1 1 if LINUX_CLI_LEVEL = 2
	range 1 2 if LINUX_CLI_LEVEL = 3
	range 1 3 if LINUX_CLI_LEVEL = 4
	range 1 4 if LINUX_CLI_LEVEL = 5
	range 1 5 if LINUX_CLI_LEVEL = 6
	default 1

comment "-"
comment "____Maskable interrupt levels____"

config LINUX_CLI_LEVEL
	int "The highest interrupt priority excluded by local_irq_disable() (2-6)"
	range 2 6
	default 2
	help
	  local_irq_disable() doesn't actually disable maskable interrupts -
	  what it does is restrict the levels of interrupt which are permitted
	  (a lower level indicates a higher priority) by lowering the value in
	  EPSW.IM from 7.  Any interrupt is permitted for which the level is
	  lower than EPSW.IM.

	  Certain interrupts, such as GDBSTUB and virtual MN10300 on-chip
	  serial DMA interrupts are allowed to interrupt normal disabled
	  sections.

comment "The following must be set to a equal to or lower priority than LINUX_CLI_LEVEL"

config TIMER_IRQ_LEVEL
	int "Kernel timer interrupt priority"
	range LINUX_CLI_LEVEL 6
	default 4

config PCI_IRQ_LEVEL
	int "PCI interrupt priority"
	depends on PCI
	range LINUX_CLI_LEVEL 6
	default 5

config ETHERNET_IRQ_LEVEL
	int "Ethernet interrupt priority"
	depends on SMC91X || SMC911X || SMSC911X
	range LINUX_CLI_LEVEL 6
	default 6

config EXT_SERIAL_IRQ_LEVEL
	int "External serial port interrupt priority"
	depends on SERIAL_8250
	range LINUX_CLI_LEVEL 6
	default 6


endmenu
endmenu


+6 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,9 @@ endif
ifeq ($(CONFIG_MN10300_PROC_MN103E010),y)
ifeq ($(CONFIG_MN10300_PROC_MN103E010),y)
PROCESSOR	:= mn103e010
PROCESSOR	:= mn103e010
endif
endif
ifeq ($(CONFIG_MN10300_PROC_MN2WS0050),y)
PROCESSOR	:= mn2ws0050
endif


ifeq ($(CONFIG_MN10300_UNIT_ASB2303),y)
ifeq ($(CONFIG_MN10300_UNIT_ASB2303),y)
UNIT		:= asb2303
UNIT		:= asb2303
@@ -43,6 +46,9 @@ endif
ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y)
ifeq ($(CONFIG_MN10300_UNIT_ASB2305),y)
UNIT		:= asb2305
UNIT		:= asb2305
endif
endif
ifeq ($(CONFIG_MN10300_UNIT_ASB2364),y)
UNIT		:= asb2364
endif




head-y		:= arch/mn10300/kernel/head.o arch/mn10300/kernel/init_task.o
head-y		:= arch/mn10300/kernel/head.o arch/mn10300/kernel/init_task.o
+67 −2
Original line number Original line Diff line number Diff line
@@ -14,10 +14,29 @@


#include <linux/linkage.h>
#include <linux/linkage.h>
#include <asm/cpu-regs.h>
#include <asm/cpu-regs.h>
#include <asm/cache.h>
#ifdef CONFIG_SMP
#include <proc/smp-regs.h>
#endif


	.globl startup_32
	.globl startup_32
startup_32:
startup_32:
	# first save off parameters from bootloader
#ifdef CONFIG_SMP
	#
	# Secondary CPUs jump directly to the kernel entry point
	#
	# Must save primary CPU's D0-D2 registers as they hold boot parameters
	#
	mov	(CPUID), d3
	and	CPUID_MASK,d3
	beq	startup_primary
	mov	CONFIG_KERNEL_TEXT_ADDRESS,a0
	jmp	(a0)

startup_primary:
#endif /* CONFIG_SMP */

	# first save parameters from bootloader
	mov	param_save_area,a0
	mov	param_save_area,a0
	mov	d0,(a0)
	mov	d0,(a0)
	mov	d1,(4,a0)
	mov	d1,(4,a0)
@@ -37,8 +56,15 @@ startup_32:
	mov	(a0),d0
	mov	(a0),d0
	btst	CHCTR_ICBUSY|CHCTR_DCBUSY,d0		# wait till not busy
	btst	CHCTR_ICBUSY|CHCTR_DCBUSY,d0		# wait till not busy
	lne
	lne
	mov	CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD,d0	# writethru dcache

#ifdef CONFIG_MN10300_CACHE_ENABLED
#ifdef CONFIG_MN10300_CACHE_WBACK
	mov	CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0
#else
	mov	CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0
#endif /* WBACK */
	movhu	d0,(a0)					# enable
	movhu	d0,(a0)					# enable
#endif /* !ENABLED */


	# clear the BSS area
	# clear the BSS area
	mov	__bss_start,a0
	mov	__bss_start,a0
@@ -54,6 +80,9 @@ bssclear_end:


	# decompress the kernel
	# decompress the kernel
	call	decompress_kernel[],0
	call	decompress_kernel[],0
#ifdef CONFIG_MN10300_CACHE_WBACK
	call	mn10300_dcache_flush_inv[],0
#endif


	# disable caches again
	# disable caches again
	mov	CHCTR,a0
	mov	CHCTR,a0
@@ -69,10 +98,46 @@ bssclear_end:
	mov	(4,a0),d1
	mov	(4,a0),d1
	mov	(8,a0),d2
	mov	(8,a0),d2


	# jump to the kernel proper entry point
	mov	a3,sp
	mov	a3,sp
	mov	CONFIG_KERNEL_TEXT_ADDRESS,a0
	mov	CONFIG_KERNEL_TEXT_ADDRESS,a0
	jmp	(a0)
	jmp	(a0)



###############################################################################
#
# Cache flush routines
#
###############################################################################
#ifdef CONFIG_MN10300_CACHE_WBACK
mn10300_dcache_flush_inv:
	movhu	(CHCTR),d0
	btst	CHCTR_DCEN,d0
	beq	mn10300_dcache_flush_inv_end

	mov	L1_CACHE_NENTRIES,d1
	clr	a1

mn10300_dcache_flush_inv_loop:
	mov	(DCACHE_PURGE_WAY0(0),a1),d0	# unconditional purge
	mov	(DCACHE_PURGE_WAY1(0),a1),d0	# unconditional purge
	mov	(DCACHE_PURGE_WAY2(0),a1),d0	# unconditional purge
	mov	(DCACHE_PURGE_WAY3(0),a1),d0	# unconditional purge

	add	L1_CACHE_BYTES,a1
	add	-1,d1
	bne	mn10300_dcache_flush_inv_loop

mn10300_dcache_flush_inv_end:
	ret	[],0
#endif /* CONFIG_MN10300_CACHE_WBACK */


###############################################################################
#
# Data areas
#
###############################################################################
	.data
	.data
	.align		4
	.align		4
param_save_area:
param_save_area:
Loading