[coreboot] alix2c3 LEDs and mode switch

Roman Yeryomin leroi.lists at gmail.com
Sat Nov 8 17:25:54 CET 2008


On Fri, Nov 7, 2008 at 11:47 PM, Marc Jones <marcj303 at yahoo.com> wrote:
>> On Fri, Nov 7, 2008 at 8:47 PM, Marc Jones wrote:
>> > I think I came into this discussion late with getting my email switched over.
>> > What are you trying to accomplish and where/what do you want to control the
>> LED from?
>>
>> There is fully functional linux kernel driver (see attachment) which
>> works flawlessly with tinybios (alix factory bios).
>> I want to indicate software status events (for example network is up
>> or down) using custom scripts and driver I've mentioned.
>
>
>>#define ALIX_LED1_PORT        (0x6100)
>
> The scripts and driver should get the GPIO IO address from the 5536 PCI cfg header instead of hard coding the address.
> coreboot can allocate the GPIO space to any address. A quick try could be made by checking lspci.
> GPIO is BAR1 (offset 0x14) in the 5536.

hmm.. I din't think the address could change. So is it this? wrong
address? Here is my lspci

00:01.0 Host bridge: Advanced Micro Devices [AMD] CS5536 [Geode
companion] Host Bridge (rev 33)
        Subsystem: Advanced Micro Devices [AMD] CS5536 [Geode
companion] Host Bridge
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64
        Region 0: I/O ports at ac1c [size=4]

00:01.2 Entertainment encryption device: Advanced Micro Devices [AMD]
Geode LX AES Security Block
        Subsystem: Advanced Micro Devices [AMD] Geode LX AES Security Block
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 9
        Region 0: Memory at febf0000 (32-bit, non-prefetchable) [size=16K]

00:09.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
        Subsystem: VIA Technologies, Inc. Device 0106
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr+ Stepping+ SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64 (750ns min, 2000ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 10
        Region 0: I/O ports at 1000 [size=256]
        Region 1: Memory at febfa000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: via-rhine

00:0a.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
        Subsystem: VIA Technologies, Inc. Device 0106
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr+ Stepping+ SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64 (750ns min, 2000ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at 1400 [size=256]
        Region 1: Memory at febfb000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: via-rhine

00:0b.0 Ethernet controller: VIA Technologies, Inc. VT6105M [Rhine-III] (rev 96)
        Subsystem: VIA Technologies, Inc. Device 0106
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr+ Stepping+ SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64 (750ns min, 2000ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at 1800 [size=256]
        Region 1: Memory at febfc000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: via-rhine

00:0f.0 ISA bridge: Advanced Micro Devices [AMD] CS5536 [Geode
companion] ISA (rev 03)
        Subsystem: Advanced Micro Devices [AMD] CS5536 [Geode companion] ISA
        Control: I/O+ Mem- BusMaster- SpecCycle+ MemWINV- VGASnoop-
ParErr+ Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Region 0: I/O ports at 24b0 [size=8]
        Region 1: I/O ports at 1c00 [size=256]
        Region 2: I/O ports at 2400 [size=64]
        Region 3: I/O ports at 2480 [size=32]
        Region 4: I/O ports at 2000 [size=128]
        Region 5: I/O ports at 2440 [size=64]

00:0f.2 IDE interface: Advanced Micro Devices [AMD] CS5536 [Geode
companion] IDE (rev 01) (prog-if 80 [Master])
        Subsystem: Advanced Micro Devices [AMD] CS5536 [Geode companion] IDE
        Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr+ Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Region 0: [virtual] Memory at 000001f0 (32-bit,
non-prefetchable) [disabled] [size=8]
        Region 1: [virtual] Memory at 000003f0 (type 3,
non-prefetchable) [disabled] [size=1]
        Region 2: [virtual] Memory at 00000170 (32-bit,
non-prefetchable) [disabled] [size=8]
        Region 3: [virtual] Memory at 00000370 (type 3,
non-prefetchable) [disabled] [size=1]
        Region 4: I/O ports at 24a0 [size=16]

00:0f.3 Multimedia audio controller: Advanced Micro Devices [AMD]
CS5536 [Geode companion] Audio (rev 01)
        Subsystem: Advanced Micro Devices [AMD] CS5536 [Geode companion] Audio
        Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr+ Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin B routed to IRQ 10
        Region 0: I/O ports at 2080 [size=128]

00:0f.4 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode
companion] OHC (rev 02) (prog-if 10 [OHCI])
        Subsystem: Advanced Micro Devices [AMD] CS5536 [Geode companion] OHC
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin D routed to IRQ 11
        Region 0: Memory at febf7000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0f.5 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode
companion] EHC (rev 02) (prog-if 20 [EHCI])
        Subsystem: Advanced Micro Devices [AMD] CS5536 [Geode companion] EHC
        Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin D routed to IRQ 11
        Region 0: Memory at febf8000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [40] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-



> You can find some example GPIO setup in coreboot at src/southbridge/amd/cs5536/cs5536.c. It uses GPIOs for UARTs.

Yes, this is where I looked when trying this (this is for LED1):

   outl(GPIOL_6_SET, GPIO_IO_BASE + GPIOL_OUT_AUX1_SELECT);
   outl(GPIOL_6_SET, GPIO_IO_BASE + GPIOL_OUTPUT_ENABLE);
   outl(GPIOL_6_SET, GPIO_IO_BASE + GPIOL_IN_AUX1_SELECT);
   outl(GPIOL_6_SET, GPIO_IO_BASE + GPIOL_INPUT_ENABLE);


Roman




More information about the coreboot mailing list