pmac_pci.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:17k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * BK Id: %F% %I% %G% %U% %#%
  3.  */
  4. /*
  5.  * Support for PCI bridges found on Power Macintoshes.
  6.  * At present the "bandit" and "chaos" bridges are supported.
  7.  * Fortunately you access configuration space in the same
  8.  * way with either bridge.
  9.  *
  10.  * Copyright (C) 1997 Paul Mackerras (paulus@cs.anu.edu.au)
  11.  *
  12.  * This program is free software; you can redistribute it and/or
  13.  * modify it under the terms of the GNU General Public License
  14.  * as published by the Free Software Foundation; either version
  15.  * 2 of the License, or (at your option) any later version.
  16.  */
  17. #include <linux/kernel.h>
  18. #include <linux/pci.h>
  19. #include <linux/delay.h>
  20. #include <linux/string.h>
  21. #include <linux/init.h>
  22. #include <linux/bootmem.h>
  23. #include <asm/sections.h>
  24. #include <asm/io.h>
  25. #include <asm/prom.h>
  26. #include <asm/pci-bridge.h>
  27. #include <asm/machdep.h>
  28. #include <asm/pmac_feature.h>
  29. #undef DEBUG
  30. static void add_bridges(struct device_node *dev);
  31. /* XXX Could be per-controller, but I don't think we risk anything by
  32.  * assuming we won't have both UniNorth and Bandit */
  33. static int has_uninorth;
  34. /*
  35.  * Magic constants for enabling cache coherency in the bandit/PSX bridge.
  36.  */
  37. #define BANDIT_DEVID_2 8
  38. #define BANDIT_REVID 3
  39. #define BANDIT_DEVNUM 11
  40. #define BANDIT_MAGIC 0x50
  41. #define BANDIT_COHERENT 0x40
  42. static int __init
  43. fixup_one_level_bus_range(struct device_node *node, int higher)
  44. {
  45. for (; node != 0;node = node->sibling) {
  46. int * bus_range;
  47. unsigned int *class_code;
  48. int len;
  49. /* For PCI<->PCI bridges or CardBus bridges, we go down */
  50. class_code = (unsigned int *) get_property(node, "class-code", 0);
  51. if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
  52. (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
  53. continue;
  54. bus_range = (int *) get_property(node, "bus-range", &len);
  55. if (bus_range != NULL && len > 2 * sizeof(int)) {
  56. if (bus_range[1] > higher)
  57. higher = bus_range[1];
  58. }
  59. higher = fixup_one_level_bus_range(node->child, higher);
  60. }
  61. return higher;
  62. }
  63. /* This routine fixes the "bus-range" property of all bridges in the
  64.  * system since they tend to have their "last" member wrong on macs
  65.  * 
  66.  * Note that the bus numbers manipulated here are OF bus numbers, they
  67.  * are not Linux bus numbers.
  68.  */
  69. static void __init
  70. fixup_bus_range(struct device_node *bridge)
  71. {
  72. int * bus_range;
  73. int len;
  74. /* Lookup the "bus-range" property for the hose */
  75. bus_range = (int *) get_property(bridge, "bus-range", &len);
  76. if (bus_range == NULL || len < 2 * sizeof(int)) {
  77. printk(KERN_WARNING "Can't get bus-range for %sn",
  78.        bridge->full_name);
  79. return;
  80. }
  81. bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
  82. }
  83. /*
  84.  * Apple MacRISC (UniNorth, Bandit, Chaos) PCI controllers.
  85.  * 
  86.  * The "Bandit" version is present in all early PCI PowerMacs,
  87.  * and up to the first ones using Grackle. Some machines may
  88.  * have 2 bandit controllers (2 PCI busses).
  89.  * 
  90.  * "Chaos" is used in some "Bandit"-type machines as a bridge
  91.  * for the separate display bus. It is accessed the same
  92.  * way as bandit, but cannot be probed for devices. It therefore
  93.  * has its own config access functions.
  94.  *
  95.  * The "UniNorth" version is present in all Core99 machines
  96.  * (iBook, G4, new IMacs, and all the recent Apple machines).
  97.  * It contains 3 controllers in one ASIC.
  98.  */
  99. #define MACRISC_CFA0(devfn, off)
  100. ((1 << (unsigned long)PCI_SLOT(dev_fn)) 
  101. | (((unsigned long)PCI_FUNC(dev_fn)) << 8) 
  102. | (((unsigned long)(off)) & 0xFCUL))
  103. #define MACRISC_CFA1(bus, devfn, off)
  104. ((((unsigned long)(bus)) << 16) 
  105. |(((unsigned long)(devfn)) << 8) 
  106. |(((unsigned long)(off)) & 0xFCUL) 
  107. |1UL)
  108. static unsigned int __pmac
  109. macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset)
  110. {
  111. unsigned int caddr;
  112. if (bus == hose->first_busno) {
  113. if (dev_fn < (11 << 3))
  114. return 0;
  115. caddr = MACRISC_CFA0(dev_fn, offset);
  116. } else
  117. caddr = MACRISC_CFA1(bus, dev_fn, offset);
  118. /* Uninorth will return garbage if we don't read back the value ! */
  119. do {
  120. out_le32(hose->cfg_addr, caddr);
  121. } while(in_le32(hose->cfg_addr) != caddr);
  122. offset &= has_uninorth ? 0x07 : 0x03;
  123. return (unsigned int)(hose->cfg_data) + (unsigned int)offset;
  124. }
  125. #define cfg_read(val, addr, type, op, op2)
  126. *val = op((type)(addr))
  127. #define cfg_write(val, addr, type, op, op2)
  128. op((type *)(addr), (val)); (void) op2((type *)(addr))
  129. #define cfg_read_bad(val, size) *val = bad_##size;
  130. #define cfg_write_bad(val, size)
  131. #define bad_byte 0xff
  132. #define bad_word 0xffff
  133. #define bad_dword 0xffffffffU
  134. #define MACRISC_PCI_OP(rw, size, type, op, op2)     
  135. static int __pmac     
  136. macrisc_##rw##_config_##size(struct pci_dev *dev, int off, type val)     
  137. {     
  138. struct pci_controller *hose = dev->sysdata;     
  139. unsigned int addr;     
  140.     
  141. addr = macrisc_cfg_access(hose, dev->bus->number, dev->devfn, off); 
  142. if (!addr) {     
  143. cfg_##rw##_bad(val, size)     
  144. return PCIBIOS_DEVICE_NOT_FOUND;     
  145. }     
  146. cfg_##rw(val, addr, type, op, op2);     
  147. return PCIBIOS_SUCCESSFUL;     
  148. }
  149. MACRISC_PCI_OP(read, byte, u8 *, in_8, x)
  150. MACRISC_PCI_OP(read, word, u16 *, in_le16, x)
  151. MACRISC_PCI_OP(read, dword, u32 *, in_le32, x)
  152. MACRISC_PCI_OP(write, byte, u8, out_8, in_8)
  153. MACRISC_PCI_OP(write, word, u16, out_le16, in_le16)
  154. MACRISC_PCI_OP(write, dword, u32, out_le32, in_le32)
  155. static struct pci_ops macrisc_pci_ops =
  156. {
  157. macrisc_read_config_byte,
  158. macrisc_read_config_word,
  159. macrisc_read_config_dword,
  160. macrisc_write_config_byte,
  161. macrisc_write_config_word,
  162. macrisc_write_config_dword
  163. };
  164. /*
  165.  * Verifiy that a specific (bus, dev_fn) exists on chaos
  166.  */
  167. static int __pmac
  168. chaos_validate_dev(struct pci_dev *dev, int offset)
  169. {
  170. if(pci_device_to_OF_node(dev) == 0)
  171. return PCIBIOS_DEVICE_NOT_FOUND;
  172. if((dev->vendor == 0x106b) && (dev->device == 3) && (offset >= 0x10) &&
  173.     (offset != 0x14) && (offset != 0x18) && (offset <= 0x24)) {
  174. return PCIBIOS_BAD_REGISTER_NUMBER;
  175. }
  176. return PCIBIOS_SUCCESSFUL;
  177. }
  178. #define CHAOS_PCI_OP(rw, size, type)
  179. static int __pmac
  180. chaos_##rw##_config_##size(struct pci_dev *dev, int off, type val)
  181. {
  182. int result = chaos_validate_dev(dev, off);
  183. if(result == PCIBIOS_BAD_REGISTER_NUMBER) {
  184. cfg_##rw##_bad(val, size)
  185. return PCIBIOS_BAD_REGISTER_NUMBER;
  186. }
  187. if(result == PCIBIOS_SUCCESSFUL)
  188. return macrisc_##rw##_config_##size(dev, off, val);
  189. return result;
  190. }
  191. CHAOS_PCI_OP(read, byte, u8 *)
  192. CHAOS_PCI_OP(read, word, u16 *)
  193. CHAOS_PCI_OP(read, dword, u32 *)
  194. CHAOS_PCI_OP(write, byte, u8)
  195. CHAOS_PCI_OP(write, word, u16)
  196. CHAOS_PCI_OP(write, dword, u32) 
  197. static struct pci_ops chaos_pci_ops =
  198. {
  199. chaos_read_config_byte,
  200. chaos_read_config_word,
  201. chaos_read_config_dword,
  202. chaos_write_config_byte,
  203. chaos_write_config_word,
  204. chaos_write_config_dword
  205. };
  206. /*
  207.  * For a bandit bridge, turn on cache coherency if necessary.
  208.  * N.B. we could clean this up using the hose ops directly.
  209.  */
  210. static void __init
  211. init_bandit(struct pci_controller *bp)
  212. {
  213. unsigned int vendev, magic;
  214. int rev;
  215. /* read the word at offset 0 in config space for device 11 */
  216. out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + PCI_VENDOR_ID);
  217. udelay(2);
  218. vendev = in_le32((volatile unsigned int *)bp->cfg_data);
  219. if (vendev == (PCI_DEVICE_ID_APPLE_BANDIT << 16) + 
  220. PCI_VENDOR_ID_APPLE) {
  221. /* read the revision id */
  222. out_le32(bp->cfg_addr,
  223.  (1UL << BANDIT_DEVNUM) + PCI_REVISION_ID);
  224. udelay(2);
  225. rev = in_8(bp->cfg_data);
  226. if (rev != BANDIT_REVID)
  227. printk(KERN_WARNING
  228.        "Unknown revision %d for banditn", rev);
  229. } else if (vendev != (BANDIT_DEVID_2 << 16) + PCI_VENDOR_ID_APPLE) {
  230. printk(KERN_WARNING "bandit isn't? (%x)n", vendev);
  231. return;
  232. }
  233. /* read the word at offset 0x50 */
  234. out_le32(bp->cfg_addr, (1UL << BANDIT_DEVNUM) + BANDIT_MAGIC);
  235. udelay(2);
  236. magic = in_le32((volatile unsigned int *)bp->cfg_data);
  237. if ((magic & BANDIT_COHERENT) != 0)
  238. return;
  239. magic |= BANDIT_COHERENT;
  240. udelay(2);
  241. out_le32((volatile unsigned int *)bp->cfg_data, magic);
  242. printk(KERN_INFO "Cache coherency enabled for bandit/PSXn");
  243. }
  244. /*
  245.  * Tweak the PCI-PCI bridge chip on the blue & white G3s.
  246.  */
  247. static void __init
  248. init_p2pbridge(void)
  249. {
  250. struct device_node *p2pbridge;
  251. struct pci_controller* hose;
  252. u8 bus, devfn;
  253. u16 val;
  254. /* XXX it would be better here to identify the specific
  255.    PCI-PCI bridge chip we have. */
  256. if ((p2pbridge = find_devices("pci-bridge")) == 0
  257.     || p2pbridge->parent == NULL
  258.     || strcmp(p2pbridge->parent->name, "pci") != 0)
  259. return;
  260. if (pci_device_from_OF_node(p2pbridge, &bus, &devfn) < 0) {
  261. #ifdef DEBUG
  262. printk("Can't find PCI infos for PCI<->PCI bridgen");
  263. #endif
  264. return;
  265. }
  266. /* Warning: At this point, we have not yet renumbered all busses. 
  267.  * So we must use OF walking to find out hose
  268.  */
  269. hose = pci_find_hose_for_OF_device(p2pbridge);
  270. if (!hose) {
  271. #ifdef DEBUG
  272. printk("Can't find hose for PCI<->PCI bridgen");
  273. #endif
  274. return;
  275. }
  276. if (early_read_config_word(hose, bus, devfn,
  277.    PCI_BRIDGE_CONTROL, &val) < 0) {
  278. printk(KERN_ERR "init_p2pbridge: couldn't read bridge controln");
  279. return;
  280. }
  281. val &= ~PCI_BRIDGE_CTL_MASTER_ABORT;
  282. early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val);
  283. }
  284. void __init
  285. pmac_find_bridges(void)
  286. {
  287. add_bridges(find_devices("bandit"));
  288. add_bridges(find_devices("chaos"));
  289. add_bridges(find_devices("pci"));
  290. init_p2pbridge();
  291. }
  292. #define GRACKLE_CFA(b, d, o) (0x80 | ((b) << 8) | ((d) << 16) 
  293.  | (((o) & ~3) << 24))
  294. #define GRACKLE_PICR1_STG 0x00000040
  295. #define GRACKLE_PICR1_LOOPSNOOP 0x00000010
  296. /* N.B. this is called before bridges is initialized, so we can't
  297.    use grackle_pcibios_{read,write}_config_dword. */
  298. static inline void grackle_set_stg(struct pci_controller* bp, int enable)
  299. {
  300. unsigned int val;
  301. out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
  302. val = in_le32((volatile unsigned int *)bp->cfg_data);
  303. val = enable? (val | GRACKLE_PICR1_STG) :
  304. (val & ~GRACKLE_PICR1_STG);
  305. out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
  306. out_le32((volatile unsigned int *)bp->cfg_data, val);
  307. (void)in_le32((volatile unsigned int *)bp->cfg_data);
  308. }
  309. static inline void grackle_set_loop_snoop(struct pci_controller *bp, int enable)
  310. {
  311. unsigned int val;
  312. out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
  313. val = in_le32((volatile unsigned int *)bp->cfg_data);
  314. val = enable? (val | GRACKLE_PICR1_LOOPSNOOP) :
  315. (val & ~GRACKLE_PICR1_LOOPSNOOP);
  316. out_be32(bp->cfg_addr, GRACKLE_CFA(0, 0, 0xa8));
  317. out_le32((volatile unsigned int *)bp->cfg_data, val);
  318. (void)in_le32((volatile unsigned int *)bp->cfg_data);
  319. }
  320. static int __init
  321. setup_uninorth(struct pci_controller* hose, struct reg_property* addr)
  322. {
  323. pci_assign_all_busses = 1;
  324. has_uninorth = 1;
  325. hose->ops = &macrisc_pci_ops;
  326. hose->cfg_addr = ioremap(addr->address + 0x800000, 0x1000);
  327. hose->cfg_data = ioremap(addr->address + 0xc00000, 0x1000);
  328. /* We "know" that the bridge at f2000000 has the PCI slots. */
  329. return addr->address == 0xf2000000;
  330. }
  331. static void __init
  332. setup_bandit(struct pci_controller* hose, struct reg_property* addr)
  333. {
  334. hose->ops = &macrisc_pci_ops;
  335. hose->cfg_addr = (volatile unsigned int *)
  336. ioremap(addr->address + 0x800000, 0x1000);
  337. hose->cfg_data = (volatile unsigned char *)
  338. ioremap(addr->address + 0xc00000, 0x1000);
  339. init_bandit(hose);
  340. }
  341. static void __init
  342. setup_chaos(struct pci_controller* hose, struct reg_property* addr)
  343. {
  344. /* assume a `chaos' bridge */
  345. hose->ops = &chaos_pci_ops;
  346. hose->cfg_addr = (volatile unsigned int *)
  347. ioremap(addr->address + 0x800000, 0x1000);
  348. hose->cfg_data = (volatile unsigned char *)
  349. ioremap(addr->address + 0xc00000, 0x1000);
  350. }
  351. void __init
  352. setup_grackle(struct pci_controller *hose)
  353. {
  354. setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
  355. if (machine_is_compatible("AAPL,PowerBook1998"))
  356. grackle_set_loop_snoop(hose, 1);
  357. #if 0 /* Disabled for now, HW problems ??? */
  358. grackle_set_stg(hose, 1);
  359. #endif
  360. }
  361. /*
  362.  * We assume that if we have a G3 powermac, we have one bridge called
  363.  * "pci" (a MPC106) and no bandit or chaos bridges, and contrariwise,
  364.  * if we have one or more bandit or chaos bridges, we don't have a MPC106.
  365.  */
  366. static void __init
  367. add_bridges(struct device_node *dev)
  368. {
  369. int len;
  370. struct pci_controller *hose;
  371. struct reg_property *addr;
  372. char* disp_name;
  373. int *bus_range;
  374. int first = 1, primary;
  375. for (; dev != NULL; dev = dev->next) {
  376. addr = (struct reg_property *) get_property(dev, "reg", &len);
  377. if (addr == NULL || len < sizeof(*addr)) {
  378. printk(KERN_WARNING "Can't use %s: no addressn",
  379.        dev->full_name);
  380. continue;
  381. }
  382. bus_range = (int *) get_property(dev, "bus-range", &len);
  383. if (bus_range == NULL || len < 2 * sizeof(int)) {
  384. printk(KERN_WARNING "Can't get bus-range for %s, assume bus 0n",
  385.        dev->full_name);
  386. }
  387. hose = pcibios_alloc_controller();
  388. if (!hose)
  389. continue;
  390. hose->arch_data = dev;
  391. hose->first_busno = bus_range ? bus_range[0] : 0;
  392. hose->last_busno = bus_range ? bus_range[1] : 0xff;
  393. disp_name = NULL;
  394. primary = first;
  395. if (device_is_compatible(dev, "uni-north")) {
  396. primary = setup_uninorth(hose, addr);
  397. disp_name = "UniNorth";
  398. } else if (strcmp(dev->name, "pci") == 0) {
  399. /* XXX assume this is a mpc106 (grackle) */
  400. setup_grackle(hose);
  401. disp_name = "Grackle (MPC106)";
  402. } else if (strcmp(dev->name, "bandit") == 0) {
  403. setup_bandit(hose, addr);
  404. disp_name = "Bandit";
  405. } else if (strcmp(dev->name, "chaos") == 0) {
  406. setup_chaos(hose, addr);
  407. disp_name = "Chaos";
  408. primary = 0;
  409. }
  410. printk(KERN_INFO "Found %s PCI host bridge at 0x%08x. Firmware bus number: %d->%dn",
  411. disp_name, addr->address, hose->first_busno, hose->last_busno);
  412. #ifdef DEBUG
  413. printk(" ->Hose at 0x%08lx, cfg_addr=0x%08lx,cfg_data=0x%08lxn",
  414. hose, hose->cfg_addr, hose->cfg_data);
  415. #endif
  416. /* Interpret the "ranges" property */
  417. /* This also maps the I/O region and sets isa_io/mem_base */
  418. pci_process_bridge_OF_ranges(hose, dev, primary);
  419. /* Fixup "bus-range" OF property */
  420. fixup_bus_range(dev);
  421. first &= !primary;
  422. }
  423. }
  424. static void __init
  425. pcibios_fixup_OF_interrupts(void)
  426. {
  427. struct pci_dev* dev;
  428. /*
  429.  * Open Firmware often doesn't initialize the
  430.  * PCI_INTERRUPT_LINE config register properly, so we
  431.  * should find the device node and apply the interrupt
  432.  * obtained from the OF device-tree
  433.  */
  434. pci_for_each_dev(dev) {
  435. struct device_node* node = pci_device_to_OF_node(dev);
  436. /* this is the node, see if it has interrupts */
  437. if (node && node->n_intrs > 0)
  438. dev->irq = node->intrs[0].line;
  439. pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
  440. }
  441. }
  442. void __init
  443. pmac_pcibios_fixup(void)
  444. {
  445. /* Fixup interrupts according to OF tree */
  446. pcibios_fixup_OF_interrupts();
  447. }
  448. int __pmac
  449. pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
  450. {
  451. struct device_node* node;
  452. int updatecfg = 0;
  453. int uninorth_child;
  454. node = pci_device_to_OF_node(dev);
  455. /* We don't want to enable USB controllers absent from the OF tree
  456.  * (iBook second controller)
  457.  */
  458. if (dev->vendor == PCI_VENDOR_ID_APPLE
  459.     && dev->device == PCI_DEVICE_ID_APPLE_KL_USB && !node)
  460. return -EINVAL;
  461. if (!node)
  462. return 0;
  463. uninorth_child = node->parent &&
  464. device_is_compatible(node->parent, "uni-north");
  465. /* Firewire & GMAC were disabled after PCI probe, the driver is
  466.  * claiming them, we must re-enable them now.
  467.  */
  468. if (uninorth_child && !strcmp(node->name, "firewire") && 
  469.     (device_is_compatible(node, "pci106b,18") || 
  470.      device_is_compatible(node, "pci106b,30") ||
  471.      device_is_compatible(node, "pci11c1,5811"))) {
  472. pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, node, 0, 1);
  473. pmac_call_feature(PMAC_FTR_1394_ENABLE, node, 0, 1);
  474. updatecfg = 1;
  475. }
  476. if (uninorth_child && !strcmp(node->name, "ethernet") && 
  477.     device_is_compatible(node, "gmac")) {
  478. pmac_call_feature(PMAC_FTR_GMAC_ENABLE, node, 0, 1);
  479. updatecfg = 1;
  480. }
  481. if (updatecfg) {
  482. u16 cmd;
  483. /*
  484.  * Make sure PCI is correctly configured
  485.  *
  486.  * We use old pci_bios versions of the function since, by
  487.  * default, gmac is not powered up, and so will be absent
  488.  * from the kernel initial PCI lookup. 
  489.  * 
  490.  * Should be replaced by 2.4 new PCI mecanisms and really
  491.  * regiser the device.
  492.  */
  493. pci_read_config_word(dev, PCI_COMMAND, &cmd);
  494. cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
  495.      pci_write_config_word(dev, PCI_COMMAND, cmd);
  496.      pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
  497.      pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8);
  498. }
  499. return 0;
  500. }
  501. /* We power down some devices after they have been probed. They'll
  502.  * be powered back on later on
  503.  */
  504. void __init
  505. pmac_pcibios_after_init(void)
  506. {
  507. struct device_node* nd;
  508. #ifdef CONFIG_BLK_DEV_IDE
  509. struct pci_dev *dev;
  510. /* OF fails to initialize IDE controllers on macs
  511.  * (and maybe other machines)
  512.  * 
  513.  * Ideally, this should be moved to the IDE layer, but we need
  514.  * to check specifically with Andre Hedrick how to do it cleanly
  515.  * since the common IDE code seem to care about the fact that the
  516.  * BIOS may have disabled a controller.
  517.  * 
  518.  * -- BenH
  519.  */
  520. pci_for_each_dev(dev) {
  521. if ((dev->class >> 16) == PCI_BASE_CLASS_STORAGE)
  522. pci_enable_device(dev);
  523. }
  524. #endif /* CONFIG_BLK_DEV_IDE */
  525. nd = find_devices("firewire");
  526. while (nd) {
  527. if (nd->parent && (device_is_compatible(nd, "pci106b,18") ||
  528.    device_is_compatible(nd, "pci106b,30") ||
  529.    device_is_compatible(nd, "pci11c1,5811"))
  530.     && device_is_compatible(nd->parent, "uni-north")) {
  531. pmac_call_feature(PMAC_FTR_1394_ENABLE, nd, 0, 0);
  532. pmac_call_feature(PMAC_FTR_1394_CABLE_POWER, nd, 0, 0);
  533. }
  534. nd = nd->next;
  535. }
  536. nd = find_devices("ethernet");
  537. while (nd) {
  538. if (nd->parent && device_is_compatible(nd, "gmac")
  539.     && device_is_compatible(nd->parent, "uni-north"))
  540. pmac_call_feature(PMAC_FTR_GMAC_ENABLE, nd, 0, 0);
  541. nd = nd->next;
  542. }
  543. }