Hi, all.
I have PCISA-LX-800 board (AMD LX800 + CS5536) http://www.ieiworld.com/en/product_IPC.asp?model=PCISA-LX.
With coreboot bios pc speaker not work on Linux. But with vendor BIOS pc speaker work on Linux OK.
The CS5536 datasheet say: Legacy PC/AT Speaker Beep is only available when GPIO1 is programmed to OUT_AUX1. The coreboot not enable pc speaker output on cs5536.
This patch enable pc speaker output on cs5536 based devices.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov at gmail.com>
On 11/03/08 15:53 +0500, Nikolay Petukhov wrote:
Hi, all.
I have PCISA-LX-800 board (AMD LX800 + CS5536) http://www.ieiworld.com/en/product_IPC.asp?model=PCISA-LX.
With coreboot bios pc speaker not work on Linux. But with vendor BIOS pc speaker work on Linux OK.
The CS5536 datasheet say: Legacy PC/AT Speaker Beep is only available when GPIO1 is programmed to OUT_AUX1. The coreboot not enable pc speaker output on cs5536.
This patch enable pc speaker output on cs5536 based devices.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov at gmail.com>
comments below.
-- Nikolay
diff -Nru coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536_early_setup.c coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536_early_setup.c --- coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536_early_setup.c 2008-01-18 15:35:56.000000000 +0500 +++ coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536_early_setup.c 2008-03-11 10:36:42.000000000 +0500 @@ -123,6 +123,15 @@ outl(val, GPIO_IO_BASE + GPIOL_INPUT_ENABLE); }
+static void cs5536_setup_beep(void) +{
- /* GPIO1 - BEEP */
- /* Set: Output Enable (0x4) */
- outl(GPIOL_1_SET, GPIO_IO_BASE + GPIOL_OUTPUT_ENABLE);
- /* Set: OUTAUX1 Select (0x10) */
- outl(GPIOL_1_SET, GPIO_IO_BASE + GPIOL_OUT_AUX1_SELECT);
+}
I think we should wrap this with a config option. Lots of platform designs these days are omitting the legacy speaker hardware and reclaiming GPIO1.
static void cs5536_disable_internal_uart(void) { msr_t msr; @@ -221,4 +230,5 @@ cs5536_enable_smbus(); //print_debug("Setup power button\r\n"); cs5536_setup_power_button();
- cs5536_setup_beep();
}
Jordan
OK, then it is easier to include in a mainboard.c.
2008/3/11, Jordan Crouse jordan.crouse@amd.com:
On 11/03/08 15:53 +0500, Nikolay Petukhov wrote:
Hi, all.
I have PCISA-LX-800 board (AMD LX800 + CS5536) http://www.ieiworld.com/en/product_IPC.asp?model=PCISA-LX.
With coreboot bios pc speaker not work on Linux. But with vendor BIOS pc speaker work on Linux OK.
The CS5536 datasheet say: Legacy PC/AT Speaker Beep is only available when GPIO1 is programmed to OUT_AUX1. The coreboot not enable pc speaker output on cs5536.
This patch enable pc speaker output on cs5536 based devices.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov at gmail.com>
comments below.
-- Nikolay
diff -Nru coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536_early_setup.c coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536_early_setup.c --- coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536_early_setup.c 2008-01-18 15:35:56.000000000 +0500 +++ coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536_early_setup.c 2008-03-11 10:36:42.000000000 +0500 @@ -123,6 +123,15 @@ outl(val, GPIO_IO_BASE + GPIOL_INPUT_ENABLE); }
+static void cs5536_setup_beep(void) +{
/* GPIO1 - BEEP */
/* Set: Output Enable (0x4) */
outl(GPIOL_1_SET, GPIO_IO_BASE + GPIOL_OUTPUT_ENABLE);
/* Set: OUTAUX1 Select (0x10) */
outl(GPIOL_1_SET, GPIO_IO_BASE + GPIOL_OUT_AUX1_SELECT);
+}
I think we should wrap this with a config option. Lots of platform designs these days are omitting the legacy speaker hardware and reclaiming GPIO1.
static void cs5536_disable_internal_uart(void) { msr_t msr; @@ -221,4 +230,5 @@ cs5536_enable_smbus(); //print_debug("Setup power button\r\n"); cs5536_setup_power_button();
cs5536_setup_beep();
}
Jordan
-- Jordan Crouse Systems Software Development Engineer Advanced Micro Devices, Inc.
On 13.03.2008 07:24, Nikolay Petukhov wrote:
OK, then it is easier to include in a mainboard.c.
Maybe call it from mainboard.c, but keep the function inside the cs5536 code.
2008/3/11, Jordan Crouse jordan.crouse@amd.com:
On 11/03/08 15:53 +0500, Nikolay Petukhov wrote:
Hi, all.
I have PCISA-LX-800 board (AMD LX800 + CS5536) http://www.ieiworld.com/en/product_IPC.asp?model=PCISA-LX.
With coreboot bios pc speaker not work on Linux. But with vendor BIOS pc speaker work on Linux OK.
The CS5536 datasheet say: Legacy PC/AT Speaker Beep is only available when GPIO1 is programmed to OUT_AUX1. The coreboot not enable pc speaker output on cs5536.
This patch enable pc speaker output on cs5536 based devices.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov at gmail.com>
comments below.
-- Nikolay
diff -Nru coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536_early_setup.c coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536_early_setup.c --- coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536_early_setup.c 2008-01-18 15:35:56.000000000 +0500 +++ coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536_early_setup.c 2008-03-11 10:36:42.000000000 +0500 @@ -123,6 +123,15 @@ outl(val, GPIO_IO_BASE + GPIOL_INPUT_ENABLE); }
+static void cs5536_setup_beep(void) +{
/* GPIO1 - BEEP */
/* Set: Output Enable (0x4) */
outl(GPIOL_1_SET, GPIO_IO_BASE + GPIOL_OUTPUT_ENABLE);
/* Set: OUTAUX1 Select (0x10) */
outl(GPIOL_1_SET, GPIO_IO_BASE + GPIOL_OUT_AUX1_SELECT);
+}
I think we should wrap this with a config option. Lots of platform designs these days are omitting the legacy speaker hardware and reclaiming GPIO1.
And it is debatable whether we want to have the function in cs5536_early_setup.c. Another cs5536 file would be better.
static void cs5536_disable_internal_uart(void) { msr_t msr; @@ -221,4 +230,5 @@ cs5536_enable_smbus(); //print_debug("Setup power button\r\n"); cs5536_setup_power_button();
cs5536_setup_beep();
}
Regards, Carl-Daniel
2008/3/13, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net:
Maybe call it from mainboard.c, but keep the function inside the cs5536 code.
Maybe then so.
diff -Nru coreboot-v2-3132/src/southbridge/amd/cs5536/chip.h coreboot-v2-3132-beep/src/southbridge/amd/cs5536/chip.h --- coreboot-v2-3132/src/southbridge/amd/cs5536/chip.h 2008-01-18 15:35:56.000000000 +0500 +++ coreboot-v2-3132-beep/src/southbridge/amd/cs5536/chip.h 2008-03-14 11:17:02.000000000 +0500 @@ -39,6 +39,7 @@ unsigned char com2_enable; /* enable COM2 */ unsigned int com2_address; /* e.g. 0x2F8 */ unsigned int com2_irq; /* e.g. 3 */ + unsigned char speaker_enable; /* enable speaker */ unsigned int unwanted_vpci[MAX_UNWANTED_VPCI]; /* the following allow you to disable unwanted virtualized PCI devices */
}; diff -Nru coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536.c coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536.c --- coreboot-v2-3132/src/southbridge/amd/cs5536/cs5536.c 2008-01-18 20:08:58.000000000 +0500 +++ coreboot-v2-3132-beep/src/southbridge/amd/cs5536/cs5536.c 2008-03-14 11:17:54.000000000 +0500 @@ -248,6 +248,26 @@ isa_dma_init(); }
+static void cs5536_enable_speaker(struct southbridge_amd_cs5536_config *sb) +{ + uint32_t gpio_addr; + device_t dev; + + dev = dev_find_device(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_CS5536_ISA, 0); + gpio_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1); + gpio_addr &= ~1; /* clear IO bit */ + + if (sb->speaker_enable) { + + /* GPIO1 - BEEP */ + /* Set: Output Enable (0x4) */ + outl(GPIOL_1_SET, gpio_addr + GPIOL_OUTPUT_ENABLE); + /* Set: OUTAUX1 Select (0x10) */ + outl(GPIOL_1_SET, gpio_addr + GPIOL_OUT_AUX1_SELECT); + } +} + static void uarts_init(struct southbridge_amd_cs5536_config *sb) { msr_t msr; @@ -580,6 +600,7 @@ setup_i8259(); lpc_init(sb); uarts_init(sb); + cs5536_enable_speaker(sb);
if (sb->enable_gpio_int_route) { vrWrite((VRC_MISCELLANEOUS << 8) + PCI_INT_AB,
On Fri, Mar 14, 2008 at 12:06:34PM +0500, Nikolay Petukhov wrote:
2008/3/13, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net:
Maybe call it from mainboard.c, but keep the function inside the cs5536 code.
Maybe then so.
Looks good, but please repost with a Signed-off-by, otherwise we cannot commit, see my other mail.
Also, you seem to create your patches manually with diff, which is fine, but doing 'svn diff > foo.patch' in the tree is usually faster and simpler.
Uwe.
Hi.
2008/3/14, Uwe Hermann uwe@hermann-uwe.de:
Looks good, but please repost with a Signed-off-by, otherwise we cannot commit, see my other mail.
I also attach beep_disable.patch for disable speaker on other AMD/LX boards by default.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov at gmail.com>
Nikolay Petukhov wrote:
2008/3/13, Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net:
Maybe call it from mainboard.c, but keep the function inside the cs5536 code.
Maybe then so.
diff -Nru coreboot-v2-3132/src/southbridge/amd/cs5536/chip.h coreboot-v2-3132-beep/src/southbridge/amd/cs5536/chip.h --- coreboot-v2-3132/src/southbridge/amd/cs5536/chip.h 2008-01-18 15:35:56.000000000 +0500 +++ coreboot-v2-3132-beep/src/southbridge/amd/cs5536/chip.h 2008-03-14 11:17:02.000000000 +0500 @@ -39,6 +39,7 @@ unsigned char com2_enable; /* enable COM2 */ unsigned int com2_address; /* e.g. 0x2F8 */ unsigned int com2_irq; /* e.g. 3 */
unsigned char speaker_enable; /* enable speaker */ unsigned int unwanted_vpci[MAX_UNWANTED_VPCI]; /* the
following allow you to disable unwanted virtualized PCI devices */
This is ok but it will break all the geode platforms. There will need to be a follow-on patch to add speaker_enable to each mainboard Config.lb.
If you (or someone else) are interested you could make this even more generic to do any mainboard specific GPIO setup. But, this is probably good enough for most if not all 5536 platforms.
Marc
On 11.03.2008 11:53, Nikolay Petukhov wrote:
Hi, all.
I have PCISA-LX-800 board (AMD LX800 + CS5536) http://www.ieiworld.com/en/product_IPC.asp?model=PCISA-LX.
With coreboot bios pc speaker not work on Linux. But with vendor BIOS pc speaker work on Linux OK.
The CS5536 datasheet say: Legacy PC/AT Speaker Beep is only available when GPIO1 is programmed to OUT_AUX1. The coreboot not enable pc speaker output on cs5536.
This patch enable pc speaker output on cs5536 based devices.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov at gmail.com>
By the way, once you have a patch which enables this feature based on a config variable, it would be nice to have it ported to v3.
Regards, Carl-Daniel