aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/feature.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-12-13 02:01:21 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:53:55 -0500
commitcc5d0189b9ba95260857a5018a1c2fef90008507 (patch)
tree1202c94b6b3cb81a96d0a0e54424cad10eef68bb /arch/powerpc/platforms/powermac/feature.c
parent9cf84d7c97992dbe5360b241327341c07ce30fc9 (diff)
[PATCH] powerpc: Remove device_node addrs/n_addr
The pre-parsed addrs/n_addrs fields in struct device_node are finally gone. Remove the dodgy heuristics that did that parsing at boot and remove the fields themselves since we now have a good replacement with the new OF parsing code. This patch also fixes a bunch of drivers to use the new code instead, so that at least pmac32, pseries, iseries and g5 defconfigs build. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/feature.c')
-rw-r--r--arch/powerpc/platforms/powermac/feature.c75
1 files changed, 45 insertions, 30 deletions
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index b2928bbe922..b1f896952b1 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -1445,20 +1445,55 @@ static long g5_i2s_enable(struct device_node *node, long param, long value)
1445 /* Very crude implementation for now */ 1445 /* Very crude implementation for now */
1446 struct macio_chip *macio = &macio_chips[0]; 1446 struct macio_chip *macio = &macio_chips[0];
1447 unsigned long flags; 1447 unsigned long flags;
1448 1448 int cell;
1449 if (value == 0) 1449 u32 fcrs[3][3] = {
1450 return 0; /* don't disable yet */ 1450 { 0,
1451 K2_FCR1_I2S0_CELL_ENABLE |
1452 K2_FCR1_I2S0_CLK_ENABLE_BIT | K2_FCR1_I2S0_ENABLE,
1453 KL3_I2S0_CLK18_ENABLE
1454 },
1455 { KL0_SCC_A_INTF_ENABLE,
1456 K2_FCR1_I2S1_CELL_ENABLE |
1457 K2_FCR1_I2S1_CLK_ENABLE_BIT | K2_FCR1_I2S1_ENABLE,
1458 KL3_I2S1_CLK18_ENABLE
1459 },
1460 { KL0_SCC_B_INTF_ENABLE,
1461 SH_FCR1_I2S2_CELL_ENABLE |
1462 SH_FCR1_I2S2_CLK_ENABLE_BIT | SH_FCR1_I2S2_ENABLE,
1463 SH_FCR3_I2S2_CLK18_ENABLE
1464 },
1465 };
1466
1467 if (macio->type != macio_keylargo2 /* && macio->type != macio_shasta*/)
1468 return -ENODEV;
1469 if (strncmp(node->name, "i2s-", 4))
1470 return -ENODEV;
1471 cell = node->name[4] - 'a';
1472 switch(cell) {
1473 case 0:
1474 case 1:
1475 break;
1476#if 0
1477 case 2:
1478 if (macio->type == macio_shasta)
1479 break;
1480#endif
1481 default:
1482 return -ENODEV;
1483 }
1451 1484
1452 LOCK(flags); 1485 LOCK(flags);
1453 MACIO_BIS(KEYLARGO_FCR3, KL3_CLK45_ENABLE | KL3_CLK49_ENABLE | 1486 if (value) {
1454 KL3_I2S0_CLK18_ENABLE); 1487 MACIO_BIC(KEYLARGO_FCR0, fcrs[cell][0]);
1455 udelay(10); 1488 MACIO_BIS(KEYLARGO_FCR1, fcrs[cell][1]);
1456 MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_I2S0_CELL_ENABLE | 1489 MACIO_BIS(KEYLARGO_FCR3, fcrs[cell][2]);
1457 K2_FCR1_I2S0_CLK_ENABLE_BIT | K2_FCR1_I2S0_ENABLE); 1490 } else {
1491 MACIO_BIC(KEYLARGO_FCR3, fcrs[cell][2]);
1492 MACIO_BIC(KEYLARGO_FCR1, fcrs[cell][1]);
1493 MACIO_BIS(KEYLARGO_FCR0, fcrs[cell][0]);
1494 }
1458 udelay(10); 1495 udelay(10);
1459 MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_I2S0_RESET);
1460 UNLOCK(flags); 1496 UNLOCK(flags);
1461 udelay(10);
1462 1497
1463 return 0; 1498 return 0;
1464} 1499}
@@ -2960,26 +2995,6 @@ pmac_feature_init(void)
2960 set_initial_features(); 2995 set_initial_features();
2961} 2996}
2962 2997
2963int __init pmac_feature_late_init(void)
2964{
2965#if 0
2966 struct device_node *np;
2967
2968 /* Request some resources late */
2969 if (uninorth_node)
2970 request_OF_resource(uninorth_node, 0, NULL);
2971 np = find_devices("hammerhead");
2972 if (np)
2973 request_OF_resource(np, 0, NULL);
2974 np = find_devices("interrupt-controller");
2975 if (np)
2976 request_OF_resource(np, 0, NULL);
2977#endif
2978 return 0;
2979}
2980
2981device_initcall(pmac_feature_late_init);
2982
2983#if 0 2998#if 0
2984static void dump_HT_speeds(char *name, u32 cfg, u32 frq) 2999static void dump_HT_speeds(char *name, u32 cfg, u32 frq)
2985{ 3000{