Skip to content

Commit af9db1d

Browse files
committed
Merge tag 'm68k-for-v5.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k updates from Geert Uytterhoeven: - Conversion of the Mac IDE driver to a platform driver - Minor cleanups and fixes * tag 'm68k-for-v5.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: ide/macide: Convert Mac IDE driver to platform driver m68k: Replace HTTP links with HTTPS ones m68k: mm: Remove superfluous memblock_alloc*() casts m68k: mm: Use PAGE_ALIGNED() helper m68k: Sort selects in main Kconfig m68k: amiga: Clean up Amiga hardware configuration m68k: Revive _TIF_* masks m68k: Correct some typos in comments m68k: Use get_kernel_nofault() in show_registers() zorro: Fix address space collision message with RAM expansion boards m68k: amiga: Fix Denise detection on OCS
2 parents 024fb66 + 50c5fee commit af9db1d

14 files changed

Lines changed: 184 additions & 118 deletions

File tree

arch/m68k/Kconfig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,32 @@ config M68K
66
select ARCH_HAS_BINFMT_FLAT
77
select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE
88
select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA
9+
select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
910
select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
1011
select ARCH_NO_PREEMPT if !COLDFIRE
12+
select ARCH_WANT_IPC_PARSE_VERSION
1113
select BINFMT_FLAT_ARGVP_ENVP_ON_STACK
1214
select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE
13-
select HAVE_IDE
14-
select HAVE_AOUT if MMU
15-
select HAVE_ASM_MODVERSIONS
16-
select HAVE_DEBUG_BUGVERBOSE
17-
select GENERIC_IRQ_SHOW
1815
select GENERIC_ATOMIC64
19-
select NO_DMA if !MMU && !COLDFIRE
20-
select HAVE_UID16
21-
select VIRT_TO_BUS
22-
select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
2316
select GENERIC_CPU_DEVICES
2417
select GENERIC_IOMAP
18+
select GENERIC_IRQ_SHOW
2519
select GENERIC_STRNCPY_FROM_USER if MMU
2620
select GENERIC_STRNLEN_USER if MMU
27-
select ARCH_WANT_IPC_PARSE_VERSION
21+
select HAVE_AOUT if MMU
22+
select HAVE_ASM_MODVERSIONS
23+
select HAVE_DEBUG_BUGVERBOSE
2824
select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
25+
select HAVE_IDE
2926
select HAVE_MOD_ARCH_SPECIFIC
27+
select HAVE_UID16
28+
select MMU_GATHER_NO_RANGE if MMU
3029
select MODULES_USE_ELF_REL
3130
select MODULES_USE_ELF_RELA
32-
select OLD_SIGSUSPEND3
31+
select NO_DMA if !MMU && !COLDFIRE
3332
select OLD_SIGACTION
34-
select MMU_GATHER_NO_RANGE if MMU
33+
select OLD_SIGSUSPEND3
34+
select VIRT_TO_BUS
3535

3636
config CPU_BIG_ENDIAN
3737
def_bool y

arch/m68k/amiga/config.c

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static void __init amiga_identify(void)
214214

215215
switch (amiga_model) {
216216
case AMI_UNKNOWN:
217-
goto Generic;
217+
break;
218218

219219
case AMI_600:
220220
case AMI_1200:
@@ -227,7 +227,7 @@ static void __init amiga_identify(void)
227227
case AMI_2000:
228228
case AMI_2500:
229229
AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
230-
goto Generic;
230+
break;
231231

232232
case AMI_3000:
233233
case AMI_3000T:
@@ -238,7 +238,7 @@ static void __init amiga_identify(void)
238238
AMIGAHW_SET(A3000_SCSI);
239239
AMIGAHW_SET(A3000_CLK);
240240
AMIGAHW_SET(ZORRO3);
241-
goto Generic;
241+
break;
242242

243243
case AMI_4000T:
244244
AMIGAHW_SET(A4000_SCSI);
@@ -247,68 +247,12 @@ static void __init amiga_identify(void)
247247
AMIGAHW_SET(A4000_IDE);
248248
AMIGAHW_SET(A3000_CLK);
249249
AMIGAHW_SET(ZORRO3);
250-
goto Generic;
250+
break;
251251

252252
case AMI_CDTV:
253253
case AMI_CD32:
254254
AMIGAHW_SET(CD_ROM);
255255
AMIGAHW_SET(A2000_CLK); /* Is this correct? */
256-
goto Generic;
257-
258-
Generic:
259-
AMIGAHW_SET(AMI_VIDEO);
260-
AMIGAHW_SET(AMI_BLITTER);
261-
AMIGAHW_SET(AMI_AUDIO);
262-
AMIGAHW_SET(AMI_FLOPPY);
263-
AMIGAHW_SET(AMI_KEYBOARD);
264-
AMIGAHW_SET(AMI_MOUSE);
265-
AMIGAHW_SET(AMI_SERIAL);
266-
AMIGAHW_SET(AMI_PARALLEL);
267-
AMIGAHW_SET(CHIP_RAM);
268-
AMIGAHW_SET(PAULA);
269-
270-
switch (amiga_chipset) {
271-
case CS_OCS:
272-
case CS_ECS:
273-
case CS_AGA:
274-
switch (amiga_custom.deniseid & 0xf) {
275-
case 0x0c:
276-
AMIGAHW_SET(DENISE_HR);
277-
break;
278-
case 0x08:
279-
AMIGAHW_SET(LISA);
280-
break;
281-
}
282-
break;
283-
default:
284-
AMIGAHW_SET(DENISE);
285-
break;
286-
}
287-
switch ((amiga_custom.vposr>>8) & 0x7f) {
288-
case 0x00:
289-
AMIGAHW_SET(AGNUS_PAL);
290-
break;
291-
case 0x10:
292-
AMIGAHW_SET(AGNUS_NTSC);
293-
break;
294-
case 0x20:
295-
case 0x21:
296-
AMIGAHW_SET(AGNUS_HR_PAL);
297-
break;
298-
case 0x30:
299-
case 0x31:
300-
AMIGAHW_SET(AGNUS_HR_NTSC);
301-
break;
302-
case 0x22:
303-
case 0x23:
304-
AMIGAHW_SET(ALICE_PAL);
305-
break;
306-
case 0x32:
307-
case 0x33:
308-
AMIGAHW_SET(ALICE_NTSC);
309-
break;
310-
}
311-
AMIGAHW_SET(ZORRO);
312256
break;
313257

314258
case AMI_DRACO:
@@ -318,6 +262,60 @@ static void __init amiga_identify(void)
318262
panic("Unknown Amiga Model");
319263
}
320264

265+
AMIGAHW_SET(AMI_VIDEO);
266+
AMIGAHW_SET(AMI_BLITTER);
267+
AMIGAHW_SET(AMI_AUDIO);
268+
AMIGAHW_SET(AMI_FLOPPY);
269+
AMIGAHW_SET(AMI_KEYBOARD);
270+
AMIGAHW_SET(AMI_MOUSE);
271+
AMIGAHW_SET(AMI_SERIAL);
272+
AMIGAHW_SET(AMI_PARALLEL);
273+
AMIGAHW_SET(CHIP_RAM);
274+
AMIGAHW_SET(PAULA);
275+
276+
switch (amiga_chipset) {
277+
case CS_OCS:
278+
case CS_ECS:
279+
case CS_AGA:
280+
switch (amiga_custom.deniseid & 0xf) {
281+
case 0x0c:
282+
AMIGAHW_SET(DENISE_HR);
283+
break;
284+
case 0x08:
285+
AMIGAHW_SET(LISA);
286+
break;
287+
default:
288+
AMIGAHW_SET(DENISE);
289+
break;
290+
}
291+
break;
292+
}
293+
switch ((amiga_custom.vposr>>8) & 0x7f) {
294+
case 0x00:
295+
AMIGAHW_SET(AGNUS_PAL);
296+
break;
297+
case 0x10:
298+
AMIGAHW_SET(AGNUS_NTSC);
299+
break;
300+
case 0x20:
301+
case 0x21:
302+
AMIGAHW_SET(AGNUS_HR_PAL);
303+
break;
304+
case 0x30:
305+
case 0x31:
306+
AMIGAHW_SET(AGNUS_HR_NTSC);
307+
break;
308+
case 0x22:
309+
case 0x23:
310+
AMIGAHW_SET(ALICE_PAL);
311+
break;
312+
case 0x32:
313+
case 0x33:
314+
AMIGAHW_SET(ALICE_NTSC);
315+
break;
316+
}
317+
AMIGAHW_SET(ZORRO);
318+
321319
#define AMIGAHW_ANNOUNCE(name, str) \
322320
if (AMIGAHW_PRESENT(name)) \
323321
pr_cont(str)

arch/m68k/configs/mac_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ CONFIG_DUMMY_IRQ=m
317317
CONFIG_IDE=y
318318
CONFIG_IDE_GD_ATAPI=y
319319
CONFIG_BLK_DEV_IDECD=y
320+
CONFIG_BLK_DEV_PLATFORM=y
320321
CONFIG_BLK_DEV_MAC_IDE=y
321322
CONFIG_RAID_ATTRS=m
322323
CONFIG_SCSI=y

arch/m68k/configs/multi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ CONFIG_DUMMY_IRQ=m
346346
CONFIG_IDE=y
347347
CONFIG_IDE_GD_ATAPI=y
348348
CONFIG_BLK_DEV_IDECD=y
349+
CONFIG_BLK_DEV_PLATFORM=y
349350
CONFIG_BLK_DEV_GAYLE=y
350351
CONFIG_BLK_DEV_BUDDHA=y
351352
CONFIG_BLK_DEV_FALCON_IDE=y

arch/m68k/include/asm/thread_info.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,12 @@ static inline struct thread_info *current_thread_info(void)
6868
#define TIF_MEMDIE 16 /* is terminating due to OOM killer */
6969
#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal */
7070

71+
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
72+
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
73+
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
74+
#define _TIF_DELAYED_TRACE (1 << TIF_DELAYED_TRACE)
75+
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
76+
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
77+
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
78+
7179
#endif /* _ASM_M68K_THREAD_INFO_H */

arch/m68k/kernel/head.S

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* Of course, readability is a subjective issue, so it will never be
5858
* argued that that goal was accomplished. It was merely a goal.
5959
* A key way to help make code more readable is to give good
60-
* documentation. So, the first thing you will find is exaustive
60+
* documentation. So, the first thing you will find is exhaustive
6161
* write-ups on the structure of the file, and the features of the
6262
* functional subroutines.
6363
*
@@ -1304,7 +1304,7 @@ L(mmu_fixup_done):
13041304
* mmu_engage
13051305
*
13061306
* This chunk of code performs the gruesome task of engaging the MMU.
1307-
* The reason its gruesome is because when the MMU becomes engaged it
1307+
* The reason it's gruesome is because when the MMU becomes engaged it
13081308
* maps logical addresses to physical addresses. The Program Counter
13091309
* register is then passed through the MMU before the next instruction
13101310
* is fetched (the instruction following the engage MMU instruction).
@@ -1369,7 +1369,7 @@ L(mmu_fixup_done):
13691369
/*
13701370
* After this point no new memory is allocated and
13711371
* the start of available memory is stored in availmem.
1372-
* (The bootmem allocator requires now the physicall address.)
1372+
* (The bootmem allocator requires now the physical address.)
13731373
*/
13741374

13751375
movel L(memory_start),availmem
@@ -1547,7 +1547,7 @@ func_return get_bi_record
15471547
* seven bits of the logical address (LA) are used as an
15481548
* index into the "root table." Each entry in the root
15491549
* table has a bit which specifies if it's a valid pointer to a
1550-
* pointer table. Each entry defines a 32KMeg range of memory.
1550+
* pointer table. Each entry defines a 32Meg range of memory.
15511551
* If an entry is invalid then that logical range of 32M is
15521552
* invalid and references to that range of memory (when the MMU
15531553
* is enabled) will fault. If the entry is valid, then it does
@@ -1584,7 +1584,7 @@ func_return get_bi_record
15841584
* bits 17..12 - index into the Page Table
15851585
* bits 11..0 - offset into a particular 4K page
15861586
*
1587-
* The algorithms which follows do one thing: they abstract
1587+
* The algorithms which follow do one thing: they abstract
15881588
* the MMU hardware. For example, there are three kinds of
15891589
* cache settings that are relevant. Either, memory is
15901590
* being mapped in which case it is either Kernel Code (or
@@ -2082,7 +2082,7 @@ func_return mmu_map_tt
20822082
* mmu_map
20832083
*
20842084
* This routine will map a range of memory using a pointer
2085-
* table and allocating the pages on the fly from the kernel.
2085+
* table and allocate the pages on the fly from the kernel.
20862086
* The pointer table does not have to be already linked into
20872087
* the root table, this routine will do that if necessary.
20882088
*
@@ -2528,7 +2528,7 @@ func_start mmu_get_root_table_entry,%d0/%a1
25282528

25292529
/* Find the start of free memory, get_bi_record does this for us,
25302530
* as the bootinfo structure is located directly behind the kernel
2531-
* and and we simply search for the last entry.
2531+
* we simply search for the last entry.
25322532
*/
25332533
get_bi_record BI_LAST
25342534
addw #PAGESIZE-1,%a0
@@ -2654,7 +2654,7 @@ func_start mmu_get_page_table_entry,%d0/%a1
26542654
jne 2f
26552655

26562656
/* If the page table entry doesn't exist, we allocate a complete new
2657-
* page and use it as one continues big page table which can cover
2657+
* page and use it as one continuous big page table which can cover
26582658
* 4MB of memory, nearly almost all mappings have that alignment.
26592659
*/
26602660
get_new_page

arch/m68k/kernel/traps.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,6 @@ static void show_trace(unsigned long *stack, const char *loglvl)
845845
void show_registers(struct pt_regs *regs)
846846
{
847847
struct frame *fp = (struct frame *)regs;
848-
mm_segment_t old_fs = get_fs();
849848
u16 c, *cp;
850849
unsigned long addr;
851850
int i;
@@ -918,10 +917,9 @@ void show_registers(struct pt_regs *regs)
918917
show_stack(NULL, (unsigned long *)addr, KERN_INFO);
919918

920919
pr_info("Code:");
921-
set_fs(KERNEL_DS);
922920
cp = (u16 *)regs->pc;
923921
for (i = -8; i < 16; i++) {
924-
if (get_user(c, cp + i) && i >= 0) {
922+
if (get_kernel_nofault(c, cp + i) && i >= 0) {
925923
pr_cont(" Bad PC value.");
926924
break;
927925
}
@@ -930,7 +928,6 @@ void show_registers(struct pt_regs *regs)
930928
else
931929
pr_cont(" <%04x>", c);
932930
}
933-
set_fs(old_fs);
934931
pr_cont("\n");
935932
}
936933

arch/m68k/mac/config.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/init.h>
2525
#include <linux/vt_kern.h>
2626
#include <linux/platform_device.h>
27+
#include <linux/ata_platform.h>
2728
#include <linux/adb.h>
2829
#include <linux/cuda.h>
2930
#include <linux/pmu.h>
@@ -940,6 +941,26 @@ static const struct resource mac_scsi_ccl_rsrc[] __initconst = {
940941
},
941942
};
942943

944+
static const struct resource mac_ide_quadra_rsrc[] __initconst = {
945+
DEFINE_RES_MEM(0x50F1A000, 0x104),
946+
DEFINE_RES_IRQ(IRQ_NUBUS_F),
947+
};
948+
949+
static const struct resource mac_ide_pb_rsrc[] __initconst = {
950+
DEFINE_RES_MEM(0x50F1A000, 0x104),
951+
DEFINE_RES_IRQ(IRQ_NUBUS_C),
952+
};
953+
954+
static const struct resource mac_pata_baboon_rsrc[] __initconst = {
955+
DEFINE_RES_MEM(0x50F1A000, 0x38),
956+
DEFINE_RES_MEM(0x50F1A038, 0x04),
957+
DEFINE_RES_IRQ(IRQ_BABOON_1),
958+
};
959+
960+
static const struct pata_platform_info mac_pata_baboon_data __initconst = {
961+
.ioport_shift = 2,
962+
};
963+
943964
int __init mac_platform_init(void)
944965
{
945966
phys_addr_t swim_base = 0;
@@ -1048,6 +1069,26 @@ int __init mac_platform_init(void)
10481069
break;
10491070
}
10501071

1072+
/*
1073+
* IDE device
1074+
*/
1075+
1076+
switch (macintosh_config->ide_type) {
1077+
case MAC_IDE_QUADRA:
1078+
platform_device_register_simple("mac_ide", -1,
1079+
mac_ide_quadra_rsrc, ARRAY_SIZE(mac_ide_quadra_rsrc));
1080+
break;
1081+
case MAC_IDE_PB:
1082+
platform_device_register_simple("mac_ide", -1,
1083+
mac_ide_pb_rsrc, ARRAY_SIZE(mac_ide_pb_rsrc));
1084+
break;
1085+
case MAC_IDE_BABOON:
1086+
platform_device_register_resndata(NULL, "pata_platform", -1,
1087+
mac_pata_baboon_rsrc, ARRAY_SIZE(mac_pata_baboon_rsrc),
1088+
&mac_pata_baboon_data, sizeof(mac_pata_baboon_data));
1089+
break;
1090+
}
1091+
10511092
/*
10521093
* Ethernet device
10531094
*/

0 commit comments

Comments
 (0)