Re: pmac_set_rtc_time: got 3 byte reply
Geert Uytterhoeven wrote:
> On Thu, 4 Jan 2001, Adam C Powell IV wrote:
> > But even that doesn't work:
> >[snip]
> > Investigating...
>
> Add #include <asm/param.h> to the top of asm-ppc/delay.h. Just did the same for
> m68k :-)
That was the first thing I did. :-) Alpha does the same; it's in the first attached
patch.
But the build dies trying to link, it's missing a bunch of symbols:
* Pmac ide code is missing CONFIG_PBOOK #ifdefs resulting in missing symbols, see
second attached patch. (This patch worked in test12.)
* Somewhere in arch/ppc/mm/ (forgot where exactly) there's a call to set_pgdir, which
is missing on PPC. The third attached patch provides this in include/asm/pgalloc.h
based on the one in include/asm-mips. (This patch worked in test12.)
* An oversight in drivers/pci/makefile results in missing
`pci_assign_unassigned_resources'. Fourth attached patch.
* arch/ppc/kernel/prep_setup.c still has "loops_per_sec" instead of
"loops_per_jiffy". Fifth attached patch.
* In arch/ppc/mm/init.c, prep_find_end_of_memory() uses "res" which is defined in
arch/ppc/kernel/residual.c only if CONFIG_PREP_RESIDUAL is defined. Sixth attached
patch.
* In pmac_ide_default_irq() (in arch/ppc/kernel/pmac_setup.c), there's a call to
`pmac_ide_get_irq' which I can't find anywhere, nor anything like it. :-( But
I did notice that -ac5 turns a "return 0" into this call, so #if 0 makes it build.
Seventh attached patch.
I think a number of these had not been found because people are buliding generic kernels
for multiple subarches. With these patches, it builds; I'll test later whether it
boots. :-)
Share and enjoy.
Zeen,
-Adam P.
Welcome to the best software in the world today cafe!
--- 2.4.0-prerelease-ac5/include/asm-ppc/delay.h Thu Jan 4 09:45:46 2001
+++ linux/include/asm-ppc/delay.h Thu Jan 4 09:33:38 2001
@@ -11,6 +11,8 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <asm/param.h>
+
extern unsigned long loops_per_jiffy;
/* maximum permitted argument to udelay */
--- 2.4.0-prerelease-ac5/drivers/ide/ide-pmac.c Thu Jan 4 09:28:32 2001
+++ linux/drivers/ide/ide-pmac.c Thu Jan 4 10:44:34 2001
@@ -395,7 +395,9 @@
if (np->parent && np->parent->name
&& strcasecmp(np->parent->name, "media-bay") == 0) {
+#ifdef CONFIG_PMAC_PBOOK
media_bay_set_ide_infos(np->parent,base,irq,i);
+#endif
} else if (pmac_ide[i].kind == controller_ohare) {
/* The code below is having trouble on some ohare machines
* (timing related ?). Until I can put my hand on one of these
@@ -436,8 +438,12 @@
pmac_ide_init_hwif_ports(&hwif->hw, base, 0, &hwif->irq);
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
hwif->chipset = ide_pmac;
+#ifdef CONFIG_PMAC_PBOOK
hwif->noprobe = (!hwif->io_ports[IDE_DATA_OFFSET]) ||
(check_media_bay_by_base(base, MB_CD) == -EINVAL);
+#else
+ hwif->noprobe = (!hwif->io_ports[IDE_DATA_OFFSET]);
+#endif
#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
if (np->n_addrs >= 2) {
--- 2.4.0-prerelease-ac5/include/asm-ppc/pgalloc.h Thu Jan 4 09:41:42 2001
+++ linux/include/asm-ppc/pgalloc.h Thu Jan 4 10:52:32 2001
@@ -173,5 +173,32 @@
extern int do_check_pgt_cache(int, int);
+extern inline void set_pgdir(unsigned long address, pgd_t entry)
+{
+ struct task_struct * p;
+ pgd_t *pgd;
+#ifdef CONFIG_SMP
+ int i;
+#endif
+
+ read_lock(&tasklist_lock);
+ for_each_task(p) {
+ if (!p->mm)
+ continue;
+ *pgd_offset(p->mm,address) = entry;
+ }
+ read_unlock(&tasklist_lock);
+#ifndef CONFIG_SMP
+ for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd)
+ pgd[address >> PGDIR_SHIFT] = entry;
+#else
+ /* To pgd_alloc/pgd_free, one holds master kernel lock and so does our
+ callee, so we can modify pgd caches of other CPUs as well. -jj */
+ for (i = 0; i < NR_CPUS; i++)
+ for (pgd = (pgd_t *)cpu_data[i].pgd_quick; pgd; pgd = (pgd_t *)*(unsigned long *)pgd)
+ pgd[address >> PGDIR_SHIFT] = entry;
+#endif
+}
+
#endif /* _PPC_PGALLOC_H */
#endif /* __KERNEL__ */
--- 2.4.0-prerelease-ac5/drivers/pci/Makefile Thu Jan 4 09:44:21 2001
+++ linux/drivers/pci/Makefile Thu Jan 4 11:11:15 2001
@@ -21,6 +21,7 @@
#
obj-$(CONFIG_ALPHA) += setup-bus.o setup-irq.o
obj-$(CONFIG_ARM) += setup-bus.o setup-irq.o
+obj-$(CONFIG_PPC) += setup-bus.o
ifndef CONFIG_X86
obj-y += syscall.o
--- 2.4.0-prerelease-ac5/arch/ppc/kernel/prep_setup.c Thu Jan 4 09:45:15 2001
+++ linux/arch/ppc/kernel/prep_setup.c Thu Jan 4 11:19:45 2001
@@ -101,7 +101,7 @@
extern PTE *Hash, *Hash_end;
extern unsigned long Hash_size, Hash_mask;
extern int probingmem;
-extern unsigned long loops_per_sec;
+extern unsigned long loops_per_jiffy;
#ifdef CONFIG_BLK_DEV_RAM
extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */
@@ -218,7 +218,7 @@
unsigned char ucEquipPres1;
/* init to some ~sane value until calibrate_delay() runs */
- loops_per_sec = 50000000;
+ loops_per_jiffy = 50000000;
/* Lookup PCI host bridges */
prep_find_bridges();
--- 2.4.0-prerelease-ac5/arch/ppc/mm/init.c Thu Jan 4 09:45:16 2001
+++ linux/arch/ppc/mm/init.c Thu Jan 4 11:58:24 2001
@@ -971,7 +971,8 @@
#if defined(CONFIG_8260)
else
total_memory = m8260_find_end_of_memory();
-#else
+#endif
+#if defined(CONFIG_PREP_RESIDUAL)
else /* prep */
total_memory = prep_find_end_of_memory();
#endif
@@ -1320,7 +1321,7 @@
}
#endif /* CONFIG_ALL_PPC */
-#if defined(CONFIG_ALL_PPC)
+#if defined(CONFIG_PREP_RESIDUAL)
/*
* This finds the amount of physical ram and does necessary
* setup for prep. This is pretty architecture specific so
@@ -1347,7 +1348,7 @@
return (total);
}
-#endif /* defined(CONFIG_ALL_PPC) */
+#endif /* defined(CONFIG_PREP_RESIDUAL) */
#if defined(CONFIG_GEMINI)
--- 2.4.0-prerelease-ac5/arch/ppc/kernel/pmac_setup.c Thu Jan 4 09:45:15 2001
+++ linux/arch/ppc/kernel/pmac_setup.c Thu Jan 4 12:01:28 2001
@@ -570,7 +570,7 @@
int
pmac_ide_default_irq(ide_ioreg_t base)
{
-#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
+#if 0
extern int pmac_ide_get_irq(ide_ioreg_t base);
return pmac_ide_get_irq(base);
#else
Reply to: