j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: Sat May 19 12:38:26 2012 New Revision: 1059 URL: http://tracker.coreboot.org/trac/openbios/changeset/1059
Log: Sparc64: fix interrupt properties
Add interrupt-map and interrupt-mask properties to host and ebus bridges and sprinkle interrupt properties to various devices. Based on hacks by Artyom Tarasenko.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/drivers/ide.c trunk/openbios-devel/drivers/pc_serial.c trunk/openbios-devel/drivers/pci.c trunk/openbios-devel/drivers/pci_database.c trunk/openbios-devel/drivers/pci_database.h
Modified: trunk/openbios-devel/drivers/ide.c ============================================================================== --- trunk/openbios-devel/drivers/ide.c Sat May 19 12:38:24 2012 (r1058) +++ trunk/openbios-devel/drivers/ide.c Sat May 19 12:38:26 2012 (r1059) @@ -1432,6 +1432,8 @@ props[0]=14; props[1]=0; set_property(dnode, "interrupts", (char *)&props, 2*sizeof(props[0])); +#elif defined(CONFIG_SPARC64) + set_int_property(get_cur_dev(), "interrupts", 0); #endif
props[0] = __cpu_to_be32(chan->io_regs[0]);
Modified: trunk/openbios-devel/drivers/pc_serial.c ============================================================================== --- trunk/openbios-devel/drivers/pc_serial.c Sat May 19 12:38:24 2012 (r1058) +++ trunk/openbios-devel/drivers/pc_serial.c Sat May 19 12:38:26 2012 (r1059) @@ -190,6 +190,9 @@ fword("encode+"); push_str("reg"); fword("property"); +#if defined(CONFIG_SPARC64) + set_int_property(get_cur_dev(), "interrupts", 1); +#endif
aliases = find_dev("/aliases"); set_property(aliases, "ttya", nodebuff, strlen(nodebuff) + 1);
Modified: trunk/openbios-devel/drivers/pci.c ============================================================================== --- trunk/openbios-devel/drivers/pci.c Sat May 19 12:38:24 2012 (r1058) +++ trunk/openbios-devel/drivers/pci.c Sat May 19 12:38:26 2012 (r1059) @@ -401,6 +401,21 @@ props[PCI_INT_MAP_PCI_INT] = 0x7;
set_property(dev, "interrupt-map-mask", (char *)props, 4 * sizeof(props[0])); +#elif defined(CONFIG_SPARC64) + phandle_t dev = get_cur_dev(); + uint32_t props[5]; + + props[0] = 0x000001fe; + props[1] = 0x020003f8; + props[2] = 1; + props[3] = find_dev("/"); + props[4] = 0x2b; + set_property(dev, "interrupt-map", (char *)props, 5 * sizeof(props[0])); + + props[0] = 0x000001ff; + props[1] = 0xffffffff; + props[2] = 3; + set_property(dev, "interrupt-map-mask", (char *)props, 3 * sizeof(props[0])); #endif }
@@ -522,6 +537,14 @@ return 0; }
+int virtio_config_cb(const pci_config_t *config) +{ +#if defined(CONFIG_SPARC64) + set_int_property(get_cur_dev(), "interrupts", 0); +#endif + return 0; +} + int ide_config_cb2 (const pci_config_t *config) { ob_ide_init(config->path, @@ -756,6 +779,21 @@ int ebus_config_cb(const pci_config_t *config) { #ifdef CONFIG_DRIVER_EBUS + phandle_t dev = get_cur_dev(); + uint32_t props[5]; + + props[0] = 0x000001fe; + props[1] = 0x020003f8; + props[2] = 1; + props[3] = find_dev("/"); + props[4] = 0x2b; + set_property(dev, "interrupt-map", (char *)props, 5 * sizeof(props[0])); + + props[0] = 0x000001ff; + props[1] = 0xffffffff; + props[2] = 3; + set_property(dev, "interrupt-map-mask", (char *)props, 3 * sizeof(props[0])); + #ifdef CONFIG_DRIVER_FLOPPY ob_floppy_init(config->path, "fdthree", 0x3f0ULL, 0); #endif
Modified: trunk/openbios-devel/drivers/pci_database.c ============================================================================== --- trunk/openbios-devel/drivers/pci_database.c Sat May 19 12:38:24 2012 (r1058) +++ trunk/openbios-devel/drivers/pci_database.c Sat May 19 12:38:26 2012 (r1059) @@ -52,7 +52,7 @@ NULL, "virtio-scsi", NULL, "pci1af4,1001\0pci1af4,1001\0pciclass,01018f\0", 0, 0, 0, - NULL, NULL, + virtio_config_cb, NULL, }, { 0xFFFF, 0xFFFF,
Modified: trunk/openbios-devel/drivers/pci_database.h ============================================================================== --- trunk/openbios-devel/drivers/pci_database.h Sat May 19 12:38:24 2012 (r1058) +++ trunk/openbios-devel/drivers/pci_database.h Sat May 19 12:38:26 2012 (r1059) @@ -28,6 +28,7 @@ const void *private; };
+extern int virtio_config_cb(const pci_config_t *config); extern int ide_config_cb2(const pci_config_t *config); extern int eth_config_cb(const pci_config_t *config); extern int macio_heathrow_config_cb(const pci_config_t *config);