misc. PPC patches for 2.3.45

From: Hadess (hadess@writeme.com)
Date: Wed Feb 16 2000 - 02:33:22 EST


Hi,

I tweaked this little patch this night, it _should_ fix problems with:
        - pmac-ide when not using PMAC_PBOOK
        - flush_icache_page not being defined
        - a temporary fix for asm-ppc/vga.h (vga initialization code only in
prep_setup.c)
        - atyfb.c fix when not using Powerbook sleep mode

btw, drivers/video/macmodes.o is not included in drivers/video/video.o
(it's not even built...)

However chances are that I broke something else because my computer
stops on:
request_module[block-major-3]: Root fs not mounted

just after the usb init. I must be missing something.

Could you please tell me why it doesn't work ? And if my code gets
rejected (well, it will get rejected), please tell me why, that's my
first kernel patch ever, so...

Ciao

-- 
/Hadess

--- include/asm-ppc/pgtable.h.orig Wed Feb 16 05:28:06 2000 +++ include/asm-ppc/pgtable.h Wed Feb 16 05:27:03 2000 @@ -65,6 +65,7 @@ #define flush_cache_mm(mm) do { } while (0) #define flush_cache_range(mm, a, b) do { } while (0) #define flush_cache_page(vma, p) do { } while (0) +#define flush_icache_page(vma,pg) do { } while (0) extern void flush_icache_range(unsigned long, unsigned long); extern void __flush_page_to_ram(unsigned long page_va); --- include/asm-ppc/vga.h.orig Wed Feb 16 06:33:33 2000 +++ include/asm-ppc/vga.h Wed Feb 16 07:38:23 2000 @@ -35,10 +35,13 @@ #define scr_memcpyw memcpy #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */ - +/* Only the PReP machines seem to have code for initialization of this + * so we disable it on other types of PPC */ +#if defined(CONFIG_PREP) extern unsigned long vgacon_remap_base; #define VGA_MAP_MEM(x) (x + vgacon_remap_base) #define vga_readb(x) (*(x)) #define vga_writeb(x,y) (*(y) = (x)) +#endif /* CONFIG_PREP */ #endif --- drivers/block/ide-pmac.c.orig Wed Feb 16 05:43:01 2000 +++ drivers/block/ide-pmac.c Wed Feb 16 06:03:37 2000 @@ -33,9 +33,9 @@ #include <asm/io.h> #include <asm/dbdma.h> #include <asm/ide.h> -#include <asm/mediabay.h> #include <asm/feature.h> #ifdef CONFIG_PMAC_PBOOK +#include <asm/mediabay.h> #include <linux/adb.h> #include <linux/pmu.h> #include <asm/irq.h> @@ -154,6 +154,7 @@ return; } +#ifdef CONFIG_PMAC_PBOOK /* we check only for -EINVAL meaning that we have found a matching bay but with the wrong device type */ i = check_media_bay_by_base(data_port, MB_CD); @@ -165,6 +166,7 @@ for (i = 0; i < 8; ++i) hw->io_ports[i] = data_port + i * 0x10; hw->io_ports[8] = data_port + 0x160; +#endif /* CONFIG_PMAC_PBOOK */ if (irq != NULL) *irq = pmac_ide[ix].irq; @@ -375,7 +377,7 @@ pmac_ide[i].kind = controller_heathrow; else pmac_ide[i].kind = controller_ohare; - +#ifdef CONFIG_PMAC_PBOOK if (np->parent && np->parent->name && strcasecmp(np->parent->name, "media-bay") == 0) { media_bay_set_ide_infos(np->parent,base,irq,i); @@ -386,6 +388,9 @@ */ feature_set(np, FEATURE_IDE0_enable); } else { +#else + if (1) { +#endif /* CONFIG_PMAC_PBOOK */ /* This is necessary to enable IDE when net-booting */ int *bidp = (int *)get_property(np, "AAPL,bus-id", NULL); int bid = bidp ? *bidp : 0; @@ -416,7 +421,6 @@ } mdelay(1000); } - hwif = &ide_hwifs[i]; pmac_ide_init_hwif_ports(&hwif->hw, base, 0, &hwif->irq); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); @@ -937,10 +941,14 @@ continue; /* Disable irq during sleep */ disable_irq(pmac_ide[i].irq); +#ifdef CONFIG_PMAC_PBOOK ret = check_media_bay_by_base(base, MB_CD); if (ret == -ENODEV) /* not media bay - put the disk to sleep */ idepmac_sleep_disk(i, base); +#else + idepmac_sleep_disk(i, base); +#endif /* CONFIG_PMAC_PBOOK */ } break; case PBOOK_WAKE: @@ -950,11 +958,15 @@ continue; hwif = &ide_hwifs[i]; /* We don't handle media bay devices this way */ +#ifdef CONFIG_PMAC_PBOOK ret = check_media_bay_by_base(base, MB_CD); if (ret == -ENODEV) idepmac_wake_disk(i, base); else if (ret == 0) idepmac_wake_bay(i, base); +#else + idepmac_wake_bay(i, base); +#endif /* CONFIG_PMAC_PBOOK */ enable_irq(pmac_ide[i].irq); #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC --- drivers/video/atyfb.c.orig Wed Feb 16 06:20:13 2000 +++ drivers/video/atyfb.c Wed Feb 16 06:48:00 2000 @@ -63,11 +63,13 @@ #ifdef __powerpc__ #include <linux/adb.h> -#include <linux/pmu.h> #include <asm/prom.h> #include <asm/pci-bridge.h> #include <video/macmodes.h> #endif +#ifdef CONFIG_PMAC_PBOOK +#include <linux/pmu.h> +#endif /* CONFIG_PMAC_PBOOK */ #ifdef CONFIG_NVRAM #include <linux/nvram.h> #endif @@ -4186,7 +4188,7 @@ struct fb_info_aty *info = (struct fb_info_aty *)fb; u8 gen_cntl; -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) && defined(CONFIG_PMAC_POOK) if ((_machine == _MACH_Pmac) && blank) pmu_enable_backlight(0); #endif @@ -4211,7 +4213,7 @@ gen_cntl &= ~(0x4c); aty_st_8(CRTC_GEN_CNTL, gen_cntl, info); -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) && defined(CONFIG_PMAC_POOK) if ((_machine == _MACH_Pmac) && !blank) pmu_enable_backlight(1); #endif --- drivers/macintosh/mac_keyb.c.orig Wed Feb 16 06:10:38 2000 +++ drivers/macintosh/mac_keyb.c Wed Feb 16 06:15:48 2000 @@ -585,8 +585,10 @@ } #endif /* CONFIG_ADBMOUSE */ +#ifdef CONFIG_PMAC_PBOOK /* XXX Needs to get rid of this, see comments in pmu.c */ extern int backlight_level; +#endif /* CONFIG_PMAC_PBOOK */ static void buttons_input(unsigned char *data, int nb, struct pt_regs *regs, int autopoll) @@ -627,7 +629,7 @@ /* brightness decrease */ case 0xa: /* down event */ -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) && defined(CONFIG_PMAC_PBOOK) if ( data[1] == (data[1]&0xf) ) { if (backlight_level > 2) pmu_set_brightness(backlight_level-2); @@ -639,7 +641,7 @@ /* brightness increase */ case 0x9: /* down event */ -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) && defined(CONFIG_PMAC_PBOOK) if ( data[1] == (data[1]&0xf) ) { if (backlight_level < 0x1e) pmu_set_brightness(backlight_level+2);

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:14 EST