Commit Graph

61 Commits

Author SHA1 Message Date
Igor V. Kovalenko
1e5c4a8173 pci: assign relocatable address ranges
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@790 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-27 20:12:26 +00:00
Igor V. Kovalenko
33eabc0730 pci: allow BARs with zero assigned address
- consider only PCI BARs with non-zero region size when pupulating
  "reg" and "assigned-addresses" properties

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@789 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-27 20:12:23 +00:00
Igor V. Kovalenko
75d49e26b4 pci: add host memory base to pci_arch_t
- sparc64 has PCI memory space at offset, therefore "ranges" property
  of host bridge must have different PCI and host memory addresses

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@788 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-27 20:12:19 +00:00
Igor V. Kovalenko
317816c4ba pci: bus scan amendment
- refactor scan procedure to start with PCI host controller
- initiate scan of subordinate PCI bus from PCI host and PCI-to-PCI bridges
- find out PCI subordinate bus numbers and write them to bride devices
- automated assignment of "reg", "ranges", and "bus-range" properties

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@786 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-27 20:12:11 +00:00
Igor V. Kovalenko
3fb25ea5c6 pci: debug printk macros
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@785 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-27 20:12:05 +00:00
Igor V. Kovalenko
091947776c pci: property encoding helpers
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@784 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-27 20:12:02 +00:00
Blue Swirl
c0ee565d88 Sparc64: add upa-portid properties
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@768 f158a5a8-5612-0410-a976-696ce0be7e32
2010-05-02 20:08:43 +00:00
Blue Swirl
183f3f9b00 Fix dead variable assignment, spotted by clang analyzer
Fix clang warnings:
../kernel/dict.c:289:2: warning: Value stored to 'len' is never read
        len -= sizeof(dictionary_header_t);
../packages/cmdline.c:181:8: warning: Value stored to 'buf' during its
      initialization is never read
        char *buf = ci->buf;
../libopenbios/elf_info.c:126:2: warning: Value stored to 'name' is never read
        name = addr;
../libopenbios/elf_load.c:277:5: warning: Value stored to 'addr' is never read
    addr += pad;
../drivers/ide.c:209:3: warning: Value stored to 'err' is never read
                err = ob_ide_pio_readb(drive, IDEREG_ERROR);
../drivers/ide.c:219:17: warning: Value stored to 'old_cdb' during its initialization is never read
                unsigned char old_cdb = cmd->cdb[0];
../drivers/ide.c:222:4: warning: Value stored to 'old_cdb' is never read
                        old_cdb = cmd->old_cdb;
../drivers/pci.c:103:2: warning: Value stored to 'ss' is never read
        ss = 0;
../drivers/pci.c:100:2: warning: Value stored to 'dev' is never read
        dev = 0;
../drivers/pci.c:212:2: warning: Value stored to 'bus' is never read
        bus = (hi >> 16) & 0xFF;
../drivers/pci.c:953:4: warning: Value stored to 'rev' is never read
                        rev = pci_config_read8(addr, PCI_REVISION_ID);
../packages/video.c:331:2: warning: Value stored to 's' is never read
        s = video.fb.mphys - s;
../packages/video.c:330:2: warning: Value stored to 'size' is never read
        size = ((video.fb.h * video.fb.rb + s) + 0xfff) & ~0xfff;
../fs/hfsplus/btree.c:229:5: warning: Value stored to 'p' is never read
    p = btree_readhead(&bt->head, p);
../fs/hfsplus/volume.c:149:2: warning: Value stored to 'p' is never read
        p = volume_readfork(p, &vh->start_file );

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@751 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-25 12:53:37 +00:00
Mark Cave-Ayland
bf897f1619 Split video_subr.h into its separate components so that they can live in the right places, rather than placing the definitions
from lots of different C files into a single header.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@696 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 20:10:01 +00:00
Mark Cave-Ayland
1dbe55b8e4 Move the basic OpenBIOS configuration header files from include/openbios to include/.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@695 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 17:19:58 +00:00
Mark Cave-Ayland
da4cc1d0bd Move the driver header files into include/drivers to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@692 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:19:41 +00:00
Mark Cave-Ayland
4a2c065e4f Move the libopenbios header files into include/libopenbios to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@691 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:05:53 +00:00
Mark Cave-Ayland
c112720b01 Move the kernel header files into include/kernel to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@689 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:21:02 +00:00
Alexander Graf
81605d775a PPC: Create interrupt map for PCI
There is a draft spec that defines how interrupts are supposed to be mapped
from one bus to another, down to the PIC and CPU interrupt line.

So far we don't implement that spec. But PPC64 Linux requires us to for PCI
devices. So let's create a map here.

Draft: http://playground.sun.com/1275/practice/imap/imap0_9d.pdf

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@679 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:26 +00:00
Blue Swirl
dec920ff08 Sparc64: Add interrupt properties to Sabre
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@672 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-30 20:58:40 +00:00
Blue Swirl
2478d67d9e Sparc64: fix Sabre properties
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@664 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-10 18:26:34 +00:00
Blue Swirl
2b5a61fc6c Map VGA buffer only during PCI probe
Also pass physical addresses instead of bus addresses to VGA init.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@648 f158a5a8-5612-0410-a976-696ce0be7e32
2009-12-28 10:15:33 +00:00
Michael S. Tsirkin
1f94ed5998 VGA adapters need to claim memory and i/o
transactions even if they do not have any
i/o or memory bars. E.g. PCI spec, page 297,
gives an example of such a device:

    Programming interface 0000 0000b
    VGA-compatible controller. Memory
    addresses 0A 0000h through 0B
    FFFFh. I/O addresses 3B0h to 3BBh
    and 3C0h to 3DFh and all aliases of
    these addresses.

While bios could check for these devices and special-case them, it is
easier to fix this by enabling i/o and memory space unconditionally:
devices that do not support it will just ignore this setting.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@643 f158a5a8-5612-0410-a976-696ce0be7e32
2009-12-10 00:17:17 +00:00
Laurent Vivier
d6365bca24 Fully decode PCI unit name attribute.
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@603 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-10 21:39:42 +00:00
igor.v.kovalenko
11bb993385 Do not call close-deblocker since ob_pci_open did not open it.
Fix an issue with ob_pci_close; it calls close-deblocker method without
deblocker being open. This leads to multiple references to wrong cells,
including ones in zero page.

Signed-off-by: igor.v.kovalenko@gmail.com
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@553 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-13 19:11:02 +00:00
igor.v.kovalenko
853aec9291 Improve PCI BAR handling (Igor Kovalenko)
Signed-off-by: igor.v.kovalenko@gmail.com


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@507 f158a5a8-5612-0410-a976-696ce0be7e32
2009-07-11 12:23:24 +00:00
Blue Swirl
c83135ba7a Revert r505
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@506 f158a5a8-5612-0410-a976-696ce0be7e32
2009-07-11 12:20:20 +00:00
Blue Swirl
11adcd5539 Don't try to configure non-existent BARs of bridge devices
QEMU commit b7ee1603c16c1feb0d439d2ddf6cf824119d0aab improved the PCI bridge
device handling. PCI bridges use different header format from ordinary PCI
devices, especially BAR registers do not exist. OpenBIOS tried to configure
the bridges based on the non-BAR data which was assumed to be BARs.


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@505 f158a5a8-5612-0410-a976-696ce0be7e32
2009-07-05 18:32:50 +00:00
Igor Kovalenko
02130e8240 Fix regprop int encoding (Igor Kovalenko)
Wrong encoding of "#address-cells" property can lead to a failure
fetching correct value in my-#acells method. According to docs
properties must be encoded with "encode-int". I spent some time
looking at the docs and it is clear that encode-int produces
quad-sized result (of size /l bytes).

This patch fixes pci helpers to encode to 32bit instead of 64bit values,
and correctes my-address and my-unit methods to read 32bit data
to match encode-int rules
modules/bindings.c: also fixed set_int_property and get_int_property
to match encode-int rules

Signed-off-by: Igor Kovalenko <igor.v.kovalenko@gmail.com>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@493 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-22 17:14:10 +00:00
Blue Swirl
57733636ae Fix typo (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@487 f158a5a8-5612-0410-a976-696ce0be7e32
2009-05-12 18:38:03 +00:00
Blue Swirl
e44d994605 Fix PPC nographic mode
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@481 f158a5a8-5612-0410-a976-696ce0be7e32
2009-03-22 16:49:34 +00:00
Blue Swirl
c6040cb8a0 Add basic Mac99 machine support
git-svn-id: svn://coreboot.org/openbios/openbios-devel@449 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-08 12:22:04 +00:00
Blue Swirl
7fbbf2d6eb Add #defines for PCI classes and subclasses
git-svn-id: svn://coreboot.org/openbios/openbios-devel@439 f158a5a8-5612-0410-a976-696ce0be7e32
2009-02-02 17:40:29 +00:00
Blue Swirl
3fae06cd81 Add support for floppy boot on Sparc32
git-svn-id: svn://coreboot.org/openbios/openbios-devel@425 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-25 09:56:08 +00:00
Blue Swirl
0560ab5941 Fix PCI I/O ports allocation (Aurelien Jarno)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@416 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-17 19:02:38 +00:00
Laurent Vivier
358bee9e5d Create properties for an oldworld machine if needed.
If arch is ppc and machine arch id is heathrow, we create:

- properties in root node for a powermac beige
  (Linux says "Powermac G3 (Silk)")

- "AAPL,interrupts" and "AAPL,address" properties in PCI device tree.



git-svn-id: svn://coreboot.org/openbios/openbios-devel@388 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-11 01:03:16 +00:00
Blue Swirl
cbbf8e81a9 Remove accidental debug printk
git-svn-id: svn://coreboot.org/openbios/openbios-devel@378 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-10 11:41:04 +00:00
Blue Swirl
91a9c7865a Add EBUS bridge, refactor PC serial and keyboard, generalize floppy
git-svn-id: svn://coreboot.org/openbios/openbios-devel@377 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-10 11:37:34 +00:00
Blue Swirl
32a9122790 Define oldworld property for oldworld hardware (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@371 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 17:54:25 +00:00
Blue Swirl
e781dea8c6 Don't hang if we discover an unknown device (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@369 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:57:07 +00:00
Blue Swirl
96a43ab78e Create special properties for host and bridge (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@368 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:55:19 +00:00
Blue Swirl
7986b6ac9d Create "ranges" property (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@367 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:53:14 +00:00
Blue Swirl
525283b17f Correctly create "reg" property for PCI devices (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@366 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:51:40 +00:00
Blue Swirl
02a709c6bc Create "assigned-addresses" property (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@365 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:50:03 +00:00
Blue Swirl
8a4aadc9b8 Create PCI properties "interrupts", "interrupt-map" and "interrupt-map-mask" (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@363 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:45:26 +00:00
Blue Swirl
2742ea5723 Really create a tree for PCI devices (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@362 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-07 15:43:10 +00:00
Blue Swirl
49d3954458 Mac-io cleanup (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@356 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-05 20:30:39 +00:00
Blue Swirl
7d6c9b0e78 Use field compat from pci_dev_t to fill "compatible" property. (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@353 f158a5a8-5612-0410-a976-696ce0be7e32
2009-01-05 20:14:07 +00:00
Blue Swirl
2f9b4b37d4 Move PCI database part from pci.c to its own file pci_database.c
(Laurent Vivier)


git-svn-id: svn://coreboot.org/openbios/openbios-devel@334 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-31 16:21:08 +00:00
Blue Swirl
58d21fb1c2 Change part_length to a define
git-svn-id: svn://coreboot.org/openbios/openbios-devel@312 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-23 10:15:14 +00:00
Blue Swirl
4369f590b2 Add copyright
git-svn-id: svn://coreboot.org/openbios/openbios-devel@309 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-23 10:09:04 +00:00
Laurent Vivier
cd90eca8ce remove useless printk
This patch removes useless printk()

Signed-off-by: Laurent Vivier <Laurent@lvivier.info>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@300 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 20:23:55 +00:00
Blue Swirl
37c1cdbe41 Fix the last remaining warning
git-svn-id: svn://coreboot.org/openbios/openbios-devel@295 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 17:29:20 +00:00
Blue Swirl
7e21fc929d Fix almost all remaining warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@294 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 17:15:47 +00:00
Blue Swirl
edafcf6e86 IDE fixes for PPC (Laurent Vivier)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@292 f158a5a8-5612-0410-a976-696ce0be7e32
2008-12-20 14:48:40 +00:00