Skip to content

Commit c8618d1

Browse files
committed
Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x
* 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x: sh: use printk_ratelimited instead of printk_ratelimit sh: Fix up unmet dependency warnings with USB EHCI/OHCI selects. sh: fix the value of sh_dmae_slave_config in setup-sh7757 sh: fix the INTC vector for IRQ and IRL in setup-sh7757 sh: add to select the new configuration for USB EHCI/OHCI sh: add platform_device of EHCI/OHCI to setup-sh7757 sh: fix compile error using sh7757lcr_defconfig
2 parents 427e3df + 9ab3a15 commit c8618d1

File tree

5 files changed

+94
-40
lines changed

5 files changed

+94
-40
lines changed

arch/sh/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ config CPU_SUBTYPE_SH7720
348348
select SYS_SUPPORTS_CMT
349349
select ARCH_WANT_OPTIONAL_GPIOLIB
350350
select USB_ARCH_HAS_OHCI
351+
select USB_OHCI_SH if USB_OHCI_HCD
351352
help
352353
Select SH7720 if you have a SH3-DSP SH7720 CPU.
353354

@@ -357,6 +358,7 @@ config CPU_SUBTYPE_SH7721
357358
select CPU_HAS_DSP
358359
select SYS_SUPPORTS_CMT
359360
select USB_ARCH_HAS_OHCI
361+
select USB_OHCI_SH if USB_OHCI_HCD
360362
help
361363
Select SH7721 if you have a SH3-DSP SH7721 CPU.
362364

@@ -440,6 +442,7 @@ config CPU_SUBTYPE_SH7763
440442
bool "Support SH7763 processor"
441443
select CPU_SH4A
442444
select USB_ARCH_HAS_OHCI
445+
select USB_OHCI_SH if USB_OHCI_HCD
443446
help
444447
Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
445448

@@ -467,7 +470,9 @@ config CPU_SUBTYPE_SH7786
467470
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
468471
select ARCH_WANT_OPTIONAL_GPIOLIB
469472
select USB_ARCH_HAS_OHCI
473+
select USB_OHCI_SH if USB_OHCI_HCD
470474
select USB_ARCH_HAS_EHCI
475+
select USB_EHCI_SH if USB_EHCI_HCD
471476

472477
config CPU_SUBTYPE_SHX3
473478
bool "Support SH-X3 processor"

arch/sh/configs/sh7757lcr_defconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ CONFIG_TASK_XACCT=y
99
CONFIG_TASK_IO_ACCOUNTING=y
1010
CONFIG_LOG_BUF_SHIFT=14
1111
CONFIG_BLK_DEV_INITRD=y
12-
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
1312
# CONFIG_SYSCTL_SYSCALL is not set
1413
CONFIG_KALLSYMS_ALL=y
1514
CONFIG_SLAB=y
@@ -39,8 +38,6 @@ CONFIG_IPV6=y
3938
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
4039
# CONFIG_FW_LOADER is not set
4140
CONFIG_MTD=y
42-
CONFIG_MTD_CONCAT=y
43-
CONFIG_MTD_PARTITIONS=y
4441
CONFIG_MTD_CHAR=y
4542
CONFIG_MTD_BLOCK=y
4643
CONFIG_MTD_M25P80=y
@@ -56,18 +53,19 @@ CONFIG_SH_ETH=y
5653
# CONFIG_KEYBOARD_ATKBD is not set
5754
# CONFIG_MOUSE_PS2 is not set
5855
# CONFIG_SERIO is not set
56+
# CONFIG_LEGACY_PTYS is not set
5957
CONFIG_SERIAL_SH_SCI=y
6058
CONFIG_SERIAL_SH_SCI_NR_UARTS=3
6159
CONFIG_SERIAL_SH_SCI_CONSOLE=y
62-
# CONFIG_LEGACY_PTYS is not set
6360
# CONFIG_HW_RANDOM is not set
6461
CONFIG_SPI=y
6562
CONFIG_SPI_SH=y
6663
# CONFIG_HWMON is not set
67-
CONFIG_MFD_SH_MOBILE_SDHI=y
6864
CONFIG_USB=y
6965
CONFIG_USB_EHCI_HCD=y
66+
CONFIG_USB_EHCI_SH=y
7067
CONFIG_USB_OHCI_HCD=y
68+
CONFIG_USB_OHCI_SH=y
7169
CONFIG_USB_STORAGE=y
7270
CONFIG_MMC=y
7371
CONFIG_MMC_SDHI=y

arch/sh/kernel/cpu/sh4a/setup-sh7757.c

Lines changed: 78 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
183183
{
184184
.slave_id = SHDMA_SLAVE_SCIF2_RX,
185185
.addr = 0x1f4b0014,
186-
.chcr = SM_INC | 0x800 | 0x40000000 |
186+
.chcr = DM_INC | 0x800 | 0x40000000 |
187187
TS_INDEX2VAL(XMIT_SZ_8BIT),
188188
.mid_rid = 0x22,
189189
},
@@ -197,7 +197,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
197197
{
198198
.slave_id = SHDMA_SLAVE_SCIF3_RX,
199199
.addr = 0x1f4c0014,
200-
.chcr = SM_INC | 0x800 | 0x40000000 |
200+
.chcr = DM_INC | 0x800 | 0x40000000 |
201201
TS_INDEX2VAL(XMIT_SZ_8BIT),
202202
.mid_rid = 0x2a,
203203
},
@@ -211,7 +211,7 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
211211
{
212212
.slave_id = SHDMA_SLAVE_SCIF4_RX,
213213
.addr = 0x1f4d0014,
214-
.chcr = SM_INC | 0x800 | 0x40000000 |
214+
.chcr = DM_INC | 0x800 | 0x40000000 |
215215
TS_INDEX2VAL(XMIT_SZ_8BIT),
216216
.mid_rid = 0x42,
217217
},
@@ -228,7 +228,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
228228
{
229229
.slave_id = SHDMA_SLAVE_RIIC0_RX,
230230
.addr = 0x1e500013,
231-
.chcr = SM_INC | 0x800 | 0x40000000 |
231+
.chcr = DM_INC | 0x800 | 0x40000000 |
232232
TS_INDEX2VAL(XMIT_SZ_8BIT),
233233
.mid_rid = 0x22,
234234
},
@@ -242,7 +242,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
242242
{
243243
.slave_id = SHDMA_SLAVE_RIIC1_RX,
244244
.addr = 0x1e510013,
245-
.chcr = SM_INC | 0x800 | 0x40000000 |
245+
.chcr = DM_INC | 0x800 | 0x40000000 |
246246
TS_INDEX2VAL(XMIT_SZ_8BIT),
247247
.mid_rid = 0x2a,
248248
},
@@ -256,7 +256,7 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
256256
{
257257
.slave_id = SHDMA_SLAVE_RIIC2_RX,
258258
.addr = 0x1e520013,
259-
.chcr = SM_INC | 0x800 | 0x40000000 |
259+
.chcr = DM_INC | 0x800 | 0x40000000 |
260260
TS_INDEX2VAL(XMIT_SZ_8BIT),
261261
.mid_rid = 0xa2,
262262
},
@@ -265,12 +265,12 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
265265
.addr = 0x1e530012,
266266
.chcr = SM_INC | 0x800 | 0x40000000 |
267267
TS_INDEX2VAL(XMIT_SZ_8BIT),
268-
.mid_rid = 0xab,
268+
.mid_rid = 0xa9,
269269
},
270270
{
271271
.slave_id = SHDMA_SLAVE_RIIC3_RX,
272272
.addr = 0x1e530013,
273-
.chcr = SM_INC | 0x800 | 0x40000000 |
273+
.chcr = DM_INC | 0x800 | 0x40000000 |
274274
TS_INDEX2VAL(XMIT_SZ_8BIT),
275275
.mid_rid = 0xaf,
276276
},
@@ -279,14 +279,14 @@ static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
279279
.addr = 0x1e540012,
280280
.chcr = SM_INC | 0x800 | 0x40000000 |
281281
TS_INDEX2VAL(XMIT_SZ_8BIT),
282-
.mid_rid = 0xc1,
282+
.mid_rid = 0xc5,
283283
},
284284
{
285285
.slave_id = SHDMA_SLAVE_RIIC4_RX,
286286
.addr = 0x1e540013,
287-
.chcr = SM_INC | 0x800 | 0x40000000 |
287+
.chcr = DM_INC | 0x800 | 0x40000000 |
288288
TS_INDEX2VAL(XMIT_SZ_8BIT),
289-
.mid_rid = 0xc2,
289+
.mid_rid = 0xc6,
290290
},
291291
};
292292

@@ -301,7 +301,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
301301
{
302302
.slave_id = SHDMA_SLAVE_RIIC5_RX,
303303
.addr = 0x1e550013,
304-
.chcr = SM_INC | 0x800 | 0x40000000 |
304+
.chcr = DM_INC | 0x800 | 0x40000000 |
305305
TS_INDEX2VAL(XMIT_SZ_8BIT),
306306
.mid_rid = 0x22,
307307
},
@@ -315,7 +315,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
315315
{
316316
.slave_id = SHDMA_SLAVE_RIIC6_RX,
317317
.addr = 0x1e560013,
318-
.chcr = SM_INC | 0x800 | 0x40000000 |
318+
.chcr = DM_INC | 0x800 | 0x40000000 |
319319
TS_INDEX2VAL(XMIT_SZ_8BIT),
320320
.mid_rid = 0x2a,
321321
},
@@ -329,7 +329,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
329329
{
330330
.slave_id = SHDMA_SLAVE_RIIC7_RX,
331331
.addr = 0x1e570013,
332-
.chcr = SM_INC | 0x800 | 0x40000000 |
332+
.chcr = DM_INC | 0x800 | 0x40000000 |
333333
TS_INDEX2VAL(XMIT_SZ_8BIT),
334334
.mid_rid = 0x42,
335335
},
@@ -343,7 +343,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
343343
{
344344
.slave_id = SHDMA_SLAVE_RIIC8_RX,
345345
.addr = 0x1e580013,
346-
.chcr = SM_INC | 0x800 | 0x40000000 |
346+
.chcr = DM_INC | 0x800 | 0x40000000 |
347347
TS_INDEX2VAL(XMIT_SZ_8BIT),
348348
.mid_rid = 0x46,
349349
},
@@ -357,7 +357,7 @@ static const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
357357
{
358358
.slave_id = SHDMA_SLAVE_RIIC9_RX,
359359
.addr = 0x1e590013,
360-
.chcr = SM_INC | 0x800 | 0x40000000 |
360+
.chcr = DM_INC | 0x800 | 0x40000000 |
361361
TS_INDEX2VAL(XMIT_SZ_8BIT),
362362
.mid_rid = 0x52,
363363
},
@@ -659,6 +659,54 @@ static struct platform_device spi0_device = {
659659
.resource = spi0_resources,
660660
};
661661

662+
static struct resource usb_ehci_resources[] = {
663+
[0] = {
664+
.start = 0xfe4f1000,
665+
.end = 0xfe4f10ff,
666+
.flags = IORESOURCE_MEM,
667+
},
668+
[1] = {
669+
.start = 57,
670+
.end = 57,
671+
.flags = IORESOURCE_IRQ,
672+
},
673+
};
674+
675+
static struct platform_device usb_ehci_device = {
676+
.name = "sh_ehci",
677+
.id = -1,
678+
.dev = {
679+
.dma_mask = &usb_ehci_device.dev.coherent_dma_mask,
680+
.coherent_dma_mask = DMA_BIT_MASK(32),
681+
},
682+
.num_resources = ARRAY_SIZE(usb_ehci_resources),
683+
.resource = usb_ehci_resources,
684+
};
685+
686+
static struct resource usb_ohci_resources[] = {
687+
[0] = {
688+
.start = 0xfe4f1800,
689+
.end = 0xfe4f18ff,
690+
.flags = IORESOURCE_MEM,
691+
},
692+
[1] = {
693+
.start = 57,
694+
.end = 57,
695+
.flags = IORESOURCE_IRQ,
696+
},
697+
};
698+
699+
static struct platform_device usb_ohci_device = {
700+
.name = "sh_ohci",
701+
.id = -1,
702+
.dev = {
703+
.dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
704+
.coherent_dma_mask = DMA_BIT_MASK(32),
705+
},
706+
.num_resources = ARRAY_SIZE(usb_ohci_resources),
707+
.resource = usb_ohci_resources,
708+
};
709+
662710
static struct platform_device *sh7757_devices[] __initdata = {
663711
&scif2_device,
664712
&scif3_device,
@@ -670,6 +718,8 @@ static struct platform_device *sh7757_devices[] __initdata = {
670718
&dma2_device,
671719
&dma3_device,
672720
&spi0_device,
721+
&usb_ehci_device,
722+
&usb_ohci_device,
673723
};
674724

675725
static int __init sh7757_devices_setup(void)
@@ -1039,13 +1089,13 @@ static DECLARE_INTC_DESC(intc_desc, "sh7757", vectors, groups,
10391089

10401090
/* Support for external interrupt pins in IRQ mode */
10411091
static struct intc_vect vectors_irq0123[] __initdata = {
1042-
INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280),
1043-
INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300),
1092+
INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
1093+
INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
10441094
};
10451095

10461096
static struct intc_vect vectors_irq4567[] __initdata = {
1047-
INTC_VECT(IRQ4, 0x340), INTC_VECT(IRQ5, 0x380),
1048-
INTC_VECT(IRQ6, 0x3c0), INTC_VECT(IRQ7, 0x200),
1097+
INTC_VECT(IRQ4, 0x300), INTC_VECT(IRQ5, 0x340),
1098+
INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
10491099
};
10501100

10511101
static struct intc_sense_reg sense_registers[] __initdata = {
@@ -1079,14 +1129,14 @@ static struct intc_vect vectors_irl0123[] __initdata = {
10791129
};
10801130

10811131
static struct intc_vect vectors_irl4567[] __initdata = {
1082-
INTC_VECT(IRL4_LLLL, 0xb00), INTC_VECT(IRL4_LLLH, 0xb20),
1083-
INTC_VECT(IRL4_LLHL, 0xb40), INTC_VECT(IRL4_LLHH, 0xb60),
1084-
INTC_VECT(IRL4_LHLL, 0xb80), INTC_VECT(IRL4_LHLH, 0xba0),
1085-
INTC_VECT(IRL4_LHHL, 0xbc0), INTC_VECT(IRL4_LHHH, 0xbe0),
1086-
INTC_VECT(IRL4_HLLL, 0xc00), INTC_VECT(IRL4_HLLH, 0xc20),
1087-
INTC_VECT(IRL4_HLHL, 0xc40), INTC_VECT(IRL4_HLHH, 0xc60),
1088-
INTC_VECT(IRL4_HHLL, 0xc80), INTC_VECT(IRL4_HHLH, 0xca0),
1089-
INTC_VECT(IRL4_HHHL, 0xcc0),
1132+
INTC_VECT(IRL4_LLLL, 0x200), INTC_VECT(IRL4_LLLH, 0x220),
1133+
INTC_VECT(IRL4_LLHL, 0x240), INTC_VECT(IRL4_LLHH, 0x260),
1134+
INTC_VECT(IRL4_LHLL, 0x280), INTC_VECT(IRL4_LHLH, 0x2a0),
1135+
INTC_VECT(IRL4_LHHL, 0x2c0), INTC_VECT(IRL4_LHHH, 0x2e0),
1136+
INTC_VECT(IRL4_HLLL, 0x300), INTC_VECT(IRL4_HLLH, 0x320),
1137+
INTC_VECT(IRL4_HLHL, 0x340), INTC_VECT(IRL4_HLHH, 0x360),
1138+
INTC_VECT(IRL4_HHLL, 0x380), INTC_VECT(IRL4_HHLH, 0x3a0),
1139+
INTC_VECT(IRL4_HHHL, 0x3c0),
10901140
};
10911141

10921142
static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7757-irl0123", vectors_irl0123,

arch/sh/kernel/irq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/seq_file.h>
1414
#include <linux/ftrace.h>
1515
#include <linux/delay.h>
16+
#include <linux/ratelimit.h>
1617
#include <asm/processor.h>
1718
#include <asm/machvec.h>
1819
#include <asm/uaccess.h>
@@ -268,9 +269,8 @@ void migrate_irqs(void)
268269
unsigned int newcpu = cpumask_any_and(data->affinity,
269270
cpu_online_mask);
270271
if (newcpu >= nr_cpu_ids) {
271-
if (printk_ratelimit())
272-
printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
273-
irq, cpu);
272+
pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n",
273+
irq, cpu);
274274

275275
cpumask_setall(data->affinity);
276276
newcpu = cpumask_any_and(data->affinity,

arch/sh/mm/alignment.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/seq_file.h>
1414
#include <linux/proc_fs.h>
1515
#include <linux/uaccess.h>
16+
#include <linux/ratelimit.h>
1617
#include <asm/alignment.h>
1718
#include <asm/processor.h>
1819

@@ -95,13 +96,13 @@ int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
9596
void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
9697
struct pt_regs *regs)
9798
{
98-
if (user_mode(regs) && (se_usermode & UM_WARN) && printk_ratelimit())
99-
pr_notice("Fixing up unaligned userspace access "
99+
if (user_mode(regs) && (se_usermode & UM_WARN))
100+
pr_notice_ratelimited("Fixing up unaligned userspace access "
100101
"in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
101102
tsk->comm, task_pid_nr(tsk),
102103
(void *)instruction_pointer(regs), insn);
103-
else if (se_kernmode_warn && printk_ratelimit())
104-
pr_notice("Fixing up unaligned kernel access "
104+
else if (se_kernmode_warn)
105+
pr_notice_ratelimited("Fixing up unaligned kernel access "
105106
"in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
106107
tsk->comm, task_pid_nr(tsk),
107108
(void *)instruction_pointer(regs), insn);

0 commit comments

Comments
 (0)