Re: [PATCH] m68k/mac: Revisit floppy disc controller base addresses

From: Geert Uytterhoeven
Date: Mon Jul 08 2019 - 03:27:06 EST


Hi Finn,

Thanks for your patch!

On Thu, Feb 14, 2019 at 11:22 PM Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx> wrote:
> Rename floppy_type macros to make them more consistent with the scsi_type
> macros, which are named after classes of models with similar memory maps.
>
> The documentation for LC-class machines has the IO devices at offsets
> from $50F0 0000. Use these addresses (consistent with mac_scsi resources)
> because they may not be aliased elsewhere in the memory map, e.g. at
> offsets from $5000 0000.

I guess the others do have aliases at 0x50000000? ...

>
> Add comments with controller type information from 'Designing Cards and
> Drivers for the Macintosh Family', relevant Developer Notes and
> http://mess.redump.net/mess/driver_info/mac_technical_notes
>
> Adopt phys_addr_t to avoid type casts.
>
> Cc: Laurent Vivier <lvivier@xxxxxxxxxx>
> Tested-by: Stan Johnson <userm57@xxxxxxxxx>
> Signed-off-by: Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx>
> Acked-by: Laurent Vivier <lvivier@xxxxxxxxxx>

> --- a/arch/m68k/mac/config.c
> +++ b/arch/m68k/mac/config.c

> @@ -973,22 +973,22 @@ int __init mac_platform_init(void)
> */
>
> switch (macintosh_config->floppy_type) {
> - case MAC_FLOPPY_SWIM_ADDR1:
> - swim_base = (u8 *)(VIA1_BASE + 0x1E000);
> + case MAC_FLOPPY_QUADRA:
> + swim_base = 0x5001E000;
> break;
> - case MAC_FLOPPY_SWIM_ADDR2:
> - swim_base = (u8 *)(VIA1_BASE + 0x16000);
> + case MAC_FLOPPY_OLD:
> + swim_base = 0x50016000;

... so that's why you change them from 0x50fxxxxx to 0x500xxxxx?

If that is correct, please mention that in the patch description.

Thanks!

> break;
> - default:
> - swim_base = NULL;
> + case MAC_FLOPPY_LC:
> + swim_base = 0x50F16000;
> break;
> }
>
> if (swim_base) {
> struct resource swim_rsrc = {
> .flags = IORESOURCE_MEM,
> - .start = (resource_size_t)swim_base,
> - .end = (resource_size_t)swim_base + 0x1FFF,
> + .start = swim_base,
> + .end = swim_base + 0x1FFF,
> };
>
> platform_device_register_simple("swim", -1, &swim_rsrc, 1);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds