mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Define oldworld property for oldworld hardware (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@371 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -193,10 +193,15 @@ ob_cuda_initialize (int *idx)
|
||||
props[1] = __cpu_to_be32(IO_CUDA_SIZE);
|
||||
|
||||
set_property(ph, "reg", (char *)&props, sizeof(props));
|
||||
set_int_property(ph, "interrupt-parent", pic_handle);
|
||||
// HEATHROW
|
||||
|
||||
set_int_property(ph, "interrupts", 0x12);
|
||||
|
||||
/* we emulate an oldworld hardware, so we must use
|
||||
* non-standard oldworld property (needed by linux 2.6.18)
|
||||
*/
|
||||
|
||||
set_int_property(ph, "AAPL,interrupts", 0x12);
|
||||
|
||||
bind_func("ppc32-reset-all", ppc32_reset_all);
|
||||
push_str("' ppc32-reset-all to reset-all");
|
||||
fword("eval");
|
||||
|
||||
@@ -137,26 +137,6 @@ ob_macio_init(const char *path, uint32_t addr)
|
||||
aliases = find_dev("/aliases");
|
||||
set_property(aliases, "mac-io", path, strlen(path) + 1);
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/interrupt-controller", path);
|
||||
REGISTER_NAMED_NODE(ob_intctrl_node, buf);
|
||||
|
||||
ph = find_dev(buf);
|
||||
set_property(ph, "device_type", "interrupt-controller", 21);
|
||||
set_property(ph, "compatible", "heathrow\0mac-risc", 18);
|
||||
set_int_property(ph, "#interrupt-cells", 1);
|
||||
props[0]= 0x00000010;
|
||||
props[1]= 0x00000020;
|
||||
set_property(ph, "reg", (char *)&props, 2 * sizeof(props));
|
||||
set_property(ph, "interrupt-controller", NULL, 0);
|
||||
|
||||
chosen = find_dev("/chosen");
|
||||
push_str(buf);
|
||||
fword("open-dev");
|
||||
ph = POP();
|
||||
set_int_property(chosen, "interrupt-controller", ph);
|
||||
|
||||
pic_handle = ph;
|
||||
|
||||
cuda_init(path, addr);
|
||||
macio_nvram_init(path, addr);
|
||||
}
|
||||
|
||||
@@ -267,52 +267,6 @@ int eth_config_cb (const pci_config_t *config)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pci_set_interrupt_map(const pci_config_t *config)
|
||||
{
|
||||
phandle_t parent, dev;
|
||||
cell props[4];
|
||||
cell *old_props, *new_props;
|
||||
int ncells;
|
||||
int retlen;
|
||||
|
||||
if (config->irq_line != -1) {
|
||||
dev = get_cur_dev();
|
||||
activate_device(config->path);
|
||||
activate_device("..");
|
||||
parent = get_cur_dev();
|
||||
|
||||
ncells = 0;
|
||||
if (get_property(parent, "interrupt-map-mask", NULL) == 0) {
|
||||
props[ncells++] = 0xF800;
|
||||
props[ncells++] = 0;
|
||||
props[ncells++] = 0;
|
||||
props[ncells++] = 0;
|
||||
set_property(parent, "interrupt-map-mask",
|
||||
(char*)props, ncells * sizeof(cell));
|
||||
}
|
||||
|
||||
old_props = (cell*)get_property(parent, "interrupt-map", &retlen);
|
||||
if (old_props) {
|
||||
new_props = malloc(retlen + 6 * 4);
|
||||
memcpy(new_props, old_props, retlen);
|
||||
} else {
|
||||
retlen = 0;
|
||||
new_props = malloc(6 * 4);
|
||||
}
|
||||
ncells = retlen / 4;
|
||||
new_props[ncells++] = config->dev & 0xf800; /* devfn */
|
||||
new_props[ncells++] = 0;
|
||||
new_props[ncells++] = 0;
|
||||
new_props[ncells++] = 0;
|
||||
new_props[ncells++] = 0;
|
||||
new_props[ncells++] = config->irq_line;
|
||||
set_property(parent, "interrupt-map",
|
||||
(char*)new_props, ncells * sizeof(cell));
|
||||
free(new_props);
|
||||
activate_dev(dev);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void pci_decode_pci_addr(pci_addr addr, int *flags,
|
||||
int *space_code, uint32_t *mask)
|
||||
{
|
||||
@@ -540,7 +494,6 @@ static void ob_pci_add_properties(pci_addr addr, const pci_dev_t *pci_dev,
|
||||
|
||||
pci_set_reg(config);
|
||||
pci_set_assigned_addresses(config);
|
||||
pci_set_interrupt_map(config);
|
||||
|
||||
#ifdef CONFIG_DEBUG_PCI
|
||||
printk("\n");
|
||||
|
||||
Reference in New Issue
Block a user