Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34021
b: refs/heads/master
c: 26c5032
h: refs/heads/master
i:
  34019: 0659c94
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Jul 7, 2006
1 parent aaa84cd commit 6771ee7
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f704b8d1f080ee71b7a9a88bcf585e7dd4272f4b
refs/heads/master: 26c5032eaa64090b2a01973b0c6ea9e7f6a80fa7
10 changes: 8 additions & 2 deletions trunk/arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2033,16 +2033,22 @@ static void __init fixup_device_tree_maple(void)
#endif

#ifdef CONFIG_PPC_CHRP
/* Pegasos lacks the "ranges" property in the isa node */
/* Pegasos and BriQ lacks the "ranges" property in the isa node */
static void __init fixup_device_tree_chrp(void)
{
phandle isa;
u32 isa_ranges[6];
u32 rloc = 0x01006000; /* IO space; PCI device = 12 */
char *name;
int rc;

name = "/pci@80000000/isa@c";
isa = call_prom("finddevice", 1, 1, ADDR(name));
if (!PHANDLE_VALID(isa)) {
name = "/pci@ff500000/isa@6";
isa = call_prom("finddevice", 1, 1, ADDR(name));
rloc = 0x01003000; /* IO space; PCI device = 6 */
}
if (!PHANDLE_VALID(isa))
return;

Expand All @@ -2054,7 +2060,7 @@ static void __init fixup_device_tree_chrp(void)

isa_ranges[0] = 0x1;
isa_ranges[1] = 0x0;
isa_ranges[2] = 0x01006000;
isa_ranges[2] = rloc;
isa_ranges[3] = 0x0;
isa_ranges[4] = 0x0;
isa_ranges[5] = 0x00010000;
Expand Down
42 changes: 38 additions & 4 deletions trunk/arch/powerpc/platforms/chrp/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ chrp_find_bridges(void)
else
printk(KERN_INFO "PCI buses %d..%d",
bus_range[0], bus_range[1]);
printk(" controlled by %s", dev->type);
printk(" controlled by %s", dev->full_name);
if (!is_longtrail)
printk(" at %llx", (unsigned long long)r.start);
printk("\n");
Expand Down Expand Up @@ -289,6 +289,19 @@ chrp_find_bridges(void)
setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc);
} else if (is_pegasos == 2) {
setup_peg2(hose, dev);
} else if (!strncmp(model, "IBM,CPC710", 10)) {
setup_indirect_pci(hose,
r.start + 0x000f8000,
r.start + 0x000f8010);
if (index == 0) {
dma = get_property(dev, "system-dma-base",&len);
if (dma && len >= sizeof(*dma)) {
dma = (unsigned int *)
(((unsigned long)dma) +
len - sizeof(*dma));
pci_dram_offset = *dma;
}
}
} else {
printk("No methods for %s (model %s), using RTAS\n",
dev->full_name, model);
Expand All @@ -306,8 +319,29 @@ chrp_find_bridges(void)
printk("pci_dram_offset = %lx\n", pci_dram_offset);
}
}
}

/* SL82C105 IDE Control/Status Register */
#define SL82C105_IDECSR 0x40

/* Fixup for Winbond ATA quirk, required for briq */
void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
{
u8 progif;

/* Do not fixup interrupts from OF tree on pegasos */
if (is_pegasos)
ppc_md.pcibios_fixup = NULL;
/* If non-briq machines need that fixup too, please speak up */
if (!machine_is(chrp) || _chrp_type != _CHRP_briq)
return;

if ((sl82c105->class & 5) != 5) {
printk("W83C553: Switching SL82C105 IDE to PCI native mode\n");
/* Enable SL82C105 PCI native IDE mode */
pci_read_config_byte(sl82c105, PCI_CLASS_PROG, &progif);
pci_write_config_byte(sl82c105, PCI_CLASS_PROG, progif | 0x05);
sl82c105->class |= 0x05;
/* Disable SL82C105 second port */
pci_write_config_word(sl82c105, SL82C105_IDECSR, 0x0003);
}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
chrp_pci_fixup_winbond_ata);
27 changes: 26 additions & 1 deletion trunk/arch/powerpc/platforms/chrp/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ extern irqreturn_t xmon_irq(int, void *, struct pt_regs *);

extern unsigned long loops_per_jiffy;

/* To be replaced by RTAS when available */
static unsigned int *briq_SPOR;

#ifdef CONFIG_SMP
extern struct smp_ops_t chrp_smp_ops;
#endif
Expand All @@ -92,6 +95,15 @@ static const char *gg2_cachemodes[4] = {
"Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
};

static const char *chrp_names[] = {
"Unknown",
"","","",
"Motorola",
"IBM or Longtrail",
"Genesi Pegasos",
"Total Impact Briq"
};

void chrp_show_cpuinfo(struct seq_file *m)
{
int i, sdramen;
Expand Down Expand Up @@ -229,6 +241,14 @@ static void __init pegasos_set_l2cr(void)
}
}

static void briq_restart(char *cmd)
{
local_irq_disable();
if (briq_SPOR)
out_be32(briq_SPOR, 0);
for(;;);
}

void __init chrp_setup_arch(void)
{
struct device_node *root = find_path_device ("/");
Expand All @@ -245,11 +265,16 @@ void __init chrp_setup_arch(void)
_chrp_type = _CHRP_IBM;
} else if (machine && strncmp(machine, "MOT", 3) == 0) {
_chrp_type = _CHRP_Motorola;
} else if (machine && strncmp(machine, "TotalImpact,BRIQ-1", 18) == 0) {
_chrp_type = _CHRP_briq;
/* Map the SPOR register on briq and change the restart hook */
briq_SPOR = (unsigned int *)ioremap(0xff0000e8, 4);
ppc_md.restart = briq_restart;
} else {
/* Let's assume it is an IBM chrp if all else fails */
_chrp_type = _CHRP_IBM;
}
printk("chrp type = %x\n", _chrp_type);
printk("chrp type = %x [%s]\n", _chrp_type, chrp_names[_chrp_type]);

rtas_initialize();
if (rtas_token("display-character") >= 0)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */
#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */
#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */
#define _CHRP_briq 0x07 /* TotalImpact's briQ */

#if defined(__KERNEL__) && defined(CONFIG_PPC32)

Expand Down

0 comments on commit 6771ee7

Please sign in to comment.