Skip to content

Commit 9287d95

Browse files
htakataLinus Torvalds
authored andcommitted
[PATCH] m32r: Support M32104UT target platform
This patch is for supporting a new target platform, Renesas M32104UT evaluation board. The M32104UT is an eval board based on an uT-Engine specification. This board has an MMU-less M32R family processor, M32104. http://www-wa0.personal-media.co.jp/pmc/archive/te/te_m32104_e.pdf This board is one of the most popular M32R platform, so we have ported Linux/M32R to it. Signed-off-by: Naoto Sugai <Sugai.Naoto@ak.MitsubishiElectric.co.jp> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 60c83c7 commit 9287d95

18 files changed

Lines changed: 1407 additions & 29 deletions

File tree

‎arch/m32r/Kconfig‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ config PLAT_MAPPI2
8181
config PLAT_MAPPI3
8282
bool "Mappi-III(M3A-2170)"
8383

84+
config PLAT_M32104UT
85+
bool "M32104UT"
86+
help
87+
The M3T-M32104UT is an reference board based on uT-Engine
88+
specification. This board has a M32104 chip.
89+
8490
endchoice
8591

8692
choice
@@ -93,6 +99,10 @@ config CHIP_M32700
9399
config CHIP_M32102
94100
bool "M32102"
95101

102+
config CHIP_M32104
103+
bool "M32104"
104+
depends on PLAT_M32104UT
105+
96106
config CHIP_VDEC2
97107
bool "VDEC2"
98108

@@ -115,7 +125,7 @@ config TLB_ENTRIES
115125

116126
config ISA_M32R
117127
bool
118-
depends on CHIP_M32102
128+
depends on CHIP_M32102 || CHIP_M32104
119129
default y
120130

121131
config ISA_M32R2
@@ -140,6 +150,7 @@ config BUS_CLOCK
140150
default "50000000" if PLAT_MAPPI3
141151
default "50000000" if PLAT_M32700UT
142152
default "50000000" if PLAT_OPSPUT
153+
default "54000000" if PLAT_M32104UT
143154
default "33333333" if PLAT_OAKS32R
144155
default "20000000" if PLAT_MAPPI2
145156

@@ -157,6 +168,7 @@ config MEMORY_START
157168
default "08000000" if PLAT_USRV
158169
default "08000000" if PLAT_M32700UT
159170
default "08000000" if PLAT_OPSPUT
171+
default "04000000" if PLAT_M32104UT
160172
default "01000000" if PLAT_OAKS32R
161173

162174
config MEMORY_SIZE
@@ -166,6 +178,7 @@ config MEMORY_SIZE
166178
default "02000000" if PLAT_USRV
167179
default "01000000" if PLAT_M32700UT
168180
default "01000000" if PLAT_OPSPUT
181+
default "01000000" if PLAT_M32104UT
169182
default "00800000" if PLAT_OAKS32R
170183

171184
config NOHIGHMEM
@@ -174,21 +187,22 @@ config NOHIGHMEM
174187

175188
config ARCH_DISCONTIGMEM_ENABLE
176189
bool "Internal RAM Support"
177-
depends on CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP
190+
depends on CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104
178191
default y
179192

180193
source "mm/Kconfig"
181194

182195
config IRAM_START
183196
hex "Internal memory start address (hex)"
184-
default "00f00000"
185-
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP) && DISCONTIGMEM
197+
default "00f00000" if !CHIP_M32104
198+
default "00700000" if CHIP_M32104
199+
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM
186200

187201
config IRAM_SIZE
188202
hex "Internal memory size (hex)"
189-
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP) && DISCONTIGMEM
203+
depends on (CHIP_M32700 || CHIP_M32102 || CHIP_VDEC2 || CHIP_OPSP || CHIP_M32104) && DISCONTIGMEM
190204
default "00080000" if CHIP_M32700
191-
default "00010000" if CHIP_M32102 || CHIP_OPSP
205+
default "00010000" if CHIP_M32102 || CHIP_OPSP || CHIP_M32104
192206
default "00008000" if CHIP_VDEC2
193207

194208
#

‎arch/m32r/boot/compressed/head.S‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ startup:
143143
ldi r0, -2
144144
ldi r1, 0x0100 ; invalidate
145145
stb r1, @r0
146+
#elif defined(CONFIG_CHIP_M32104)
147+
/* Cache flush */
148+
ldi r0, -2
149+
ldi r1, 0x0700 ; invalidate i-cache, copy back d-cache
150+
sth r1, @r0
146151
#else
147152
#error "put your cache flush function, please"
148153
#endif

‎arch/m32r/boot/setup.S‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ ENTRY(boot)
8080
ldi r1, #0x101 ; cache on (with invalidation)
8181
; ldi r1, #0x00 ; cache off
8282
st r1, @r0
83+
#elif defined(CONFIG_CHIP_M32104)
84+
ldi r0, #-4 ;LDIMM (r0, M32R_MCCR)
85+
ldi r1, #0x703 ; cache on (with invalidation)
86+
st r1, @r0
8387
#else
8488
#error unknown chip configuration
8589
#endif
@@ -115,10 +119,15 @@ mmu_on:
115119
st r1, @(MATM_offset,r0) ; Set MATM (T bit ON)
116120
ld r0, @(MATM_offset,r0) ; Check
117121
#else
122+
#if defined(CONFIG_CHIP_M32700)
118123
seth r0,#high(M32R_MCDCAR)
119124
or3 r0,r0,#low(M32R_MCDCAR)
120125
ld24 r1,#0x8080
121126
st r1,@r0
127+
#elif defined(CONFIG_CHIP_M32104)
128+
LDIMM (r2, eit_vector) ; set EVB(cr5)
129+
mvtc r2, cr5
130+
#endif
122131
#endif /* CONFIG_MMU */
123132
jmp r13
124133
nop

‎arch/m32r/kernel/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ obj-$(CONFIG_PLAT_M32700UT) += setup_m32700ut.o io_m32700ut.o
1616
obj-$(CONFIG_PLAT_OPSPUT) += setup_opsput.o io_opsput.o
1717
obj-$(CONFIG_MODULES) += module.o
1818
obj-$(CONFIG_PLAT_OAKS32R) += setup_oaks32r.o io_oaks32r.o
19+
obj-$(CONFIG_PLAT_M32104UT) += setup_m32104ut.o io_m32104ut.o
1920

2021
EXTRA_AFLAGS := -traditional

‎arch/m32r/kernel/entry.S‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ ENTRY(ei_handler)
315315
mv r1, sp ; arg1(regs)
316316
#if defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_XNUX2) \
317317
|| defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_M32102) \
318-
|| defined(CONFIG_CHIP_OPSP)
318+
|| defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104)
319319

320320
; GET_ICU_STATUS;
321321
seth r0, #shigh(M32R_ICU_ISTS_ADDR)
@@ -541,7 +541,20 @@ check_int2:
541541
bra check_end
542542
.fillinsn
543543
check_end:
544-
#endif /* CONFIG_PLAT_OPSPUT */
544+
#elif defined(CONFIG_PLAT_M32104UT)
545+
add3 r2, r0, #-(M32R_IRQ_INT1) ; INT1# interrupt
546+
bnez r2, check_end
547+
; read ICU status register of PLD
548+
seth r0, #high(PLD_ICUISTS)
549+
or3 r0, r0, #low(PLD_ICUISTS)
550+
lduh r0, @r0
551+
slli r0, #21
552+
srli r0, #27 ; ISN
553+
addi r0, #(M32104UT_PLD_IRQ_BASE)
554+
bra check_end
555+
.fillinsn
556+
check_end:
557+
#endif /* CONFIG_PLAT_M32104UT */
545558
bl do_IRQ
546559
#endif /* CONFIG_SMP */
547560
ld r14, @sp+

0 commit comments

Comments
 (0)