HAOUAS Elyes (ehaouas(a)noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16916
-gerrit
commit d0044e0c5625d90cb2af11fac4147a4c3632adc2
Author: Elyes HAOUAS <ehaouas(a)noos.fr>
Date: Fri Oct 7 13:02:31 2016 +0200
mainboard/emulation: Use C89 comments style & remove commented code
Change-Id: I627338505fe1273366bc8f6f528d829b3162b371
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
---
src/mainboard/emulation/qemu-i440fx/romstage.c | 3 ---
src/mainboard/emulation/qemu-power8/bootblock.c | 4 ++--
src/mainboard/emulation/qemu-power8/mainboard.c | 2 +-
src/mainboard/emulation/qemu-q35/acpi_tables.c | 2 +-
src/mainboard/emulation/qemu-q35/romstage.c | 3 ---
src/mainboard/emulation/qemu-riscv/bootblock.c | 4 ++--
src/mainboard/emulation/qemu-riscv/qemu_util.c | 18 +++++++-----------
src/mainboard/emulation/spike-riscv/bootblock.c | 4 ++--
src/mainboard/emulation/spike-riscv/spike_util.c | 5 ++---
9 files changed, 17 insertions(+), 28 deletions(-)
diff --git a/src/mainboard/emulation/qemu-i440fx/romstage.c b/src/mainboard/emulation/qemu-i440fx/romstage.c
index bc23929..1676fb0 100644
--- a/src/mainboard/emulation/qemu-i440fx/romstage.c
+++ b/src/mainboard/emulation/qemu-i440fx/romstage.c
@@ -40,9 +40,6 @@ void * asmlinkage romstage_main(unsigned long bist)
/* Halt if there was a built in self test failure */
report_bist_failure(bist);
- //print_pci_devices();
- //dump_pci_devices();
-
cbmem_was_initted = !cbmem_recovery(0);
timestamp_init(timestamp_get());
diff --git a/src/mainboard/emulation/qemu-power8/bootblock.c b/src/mainboard/emulation/qemu-power8/bootblock.c
index d92c169..9927fdc 100644
--- a/src/mainboard/emulation/qemu-power8/bootblock.c
+++ b/src/mainboard/emulation/qemu-power8/bootblock.c
@@ -17,8 +17,8 @@
#include <console/console.h>
#include <program_loading.h>
-// the qemu part of all this is very, very non-hardware like.
-// so it gets its own bootblock.
+/* the qemu part of all this is very, very non-hardware like. */
+/* so it gets its own bootblock. */
void main(void)
{
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
diff --git a/src/mainboard/emulation/qemu-power8/mainboard.c b/src/mainboard/emulation/qemu-power8/mainboard.c
index 102f54c..41df2ca 100644
--- a/src/mainboard/emulation/qemu-power8/mainboard.c
+++ b/src/mainboard/emulation/qemu-power8/mainboard.c
@@ -26,7 +26,7 @@ static void mainboard_enable(device_t dev)
;
}
- // Where does RAM live?
+ /* Where does RAM live? */
ram_resource(dev, 0, 2048, 32768);
cbmem_recovery(0);
}
diff --git a/src/mainboard/emulation/qemu-q35/acpi_tables.c b/src/mainboard/emulation/qemu-q35/acpi_tables.c
index 07589e1..1b32c02 100644
--- a/src/mainboard/emulation/qemu-q35/acpi_tables.c
+++ b/src/mainboard/emulation/qemu-q35/acpi_tables.c
@@ -204,7 +204,7 @@ unsigned long acpi_fill_mcfg(unsigned long current)
return current;
reg = pci_read_config32(dev, 0x60);
- if ((reg & 0x07) != 0x01) // require enabled + 256MB size
+ if ((reg & 0x07) != 0x01) /* require enabled + 256MB size */
return current;
current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current,
diff --git a/src/mainboard/emulation/qemu-q35/romstage.c b/src/mainboard/emulation/qemu-q35/romstage.c
index 1bb51da..870dd07 100644
--- a/src/mainboard/emulation/qemu-q35/romstage.c
+++ b/src/mainboard/emulation/qemu-q35/romstage.c
@@ -42,9 +42,6 @@ void * asmlinkage romstage_main(unsigned long bist)
/* Halt if there was a built in self test failure */
report_bist_failure(bist);
- //print_pci_devices();
- //dump_pci_devices();
-
cbmem_was_initted = !cbmem_recovery(0);
timestamp_init(timestamp_get());
diff --git a/src/mainboard/emulation/qemu-riscv/bootblock.c b/src/mainboard/emulation/qemu-riscv/bootblock.c
index 3e88620..14286e3 100644
--- a/src/mainboard/emulation/qemu-riscv/bootblock.c
+++ b/src/mainboard/emulation/qemu-riscv/bootblock.c
@@ -18,8 +18,8 @@
#include <console/console.h>
#include <program_loading.h>
-// the qemu part of all this is very, very non-hardware like.
-// so it gets its own bootblock.
+/* the qemu part of all this is very, very non-hardware like. */
+/* so it gets its own bootblock. */
void main(void)
{
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
diff --git a/src/mainboard/emulation/qemu-riscv/qemu_util.c b/src/mainboard/emulation/qemu-riscv/qemu_util.c
index 216eea9..01a4c61 100644
--- a/src/mainboard/emulation/qemu-riscv/qemu_util.c
+++ b/src/mainboard/emulation/qemu-riscv/qemu_util.c
@@ -33,8 +33,7 @@
#include <string.h>
uintptr_t translate_address(uintptr_t vAddr) {
- // TODO: implement the page table translation algorithm
- //uintptr_t pageTableRoot = read_csr(sptbr);
+ /* TODO: implement the page table translation algorithm */
uintptr_t physAddrMask = 0xfffffff;
uintptr_t translationResult = vAddr & physAddrMask;
printk(BIOS_DEBUG, "Translated virtual address 0x%llx to physical address 0x%llx\n", vAddr, translationResult);
@@ -46,7 +45,7 @@ uintptr_t mcall_query_memory(uintptr_t id, memory_block_info *p)
uintptr_t physicalAddr = translate_address((uintptr_t) p);
memory_block_info *info = (memory_block_info*) physicalAddr;
if (id == 0) {
- info->base = 0x1000000; // hard coded for now, but we can put these values somewhere later
+ info->base = 0x1000000; /* hard coded for now, but we can put these values somewhere later */
info->size = 0x7F000000 - info->base;
return 0;
}
@@ -62,7 +61,7 @@ uintptr_t mcall_send_ipi(uintptr_t recipient)
uintptr_t mcall_clear_ipi(void)
{
- // only clear SSIP if no other events are pending
+ /* only clear SSIP if no other events are pending */
if (HLS()->device_response_queue_head == NULL) {
clear_csr(mip, MIP_SSIP);
mb();
@@ -104,13 +103,12 @@ uintptr_t mcall_dev_resp(void)
sbi_device_message* m = HLS()->device_response_queue_head;
if (m) {
- //printm("resp %p\n", m);
sbi_device_message* next = (void*)atomic_read(&m->sbi_private_data);
HLS()->device_response_queue_head = next;
if (!next) {
HLS()->device_response_queue_tail = 0;
- // only clear SSIP if no other events are pending
+ /* only clear SSIP if no other events are pending */
clear_csr(mip, MIP_SSIP);
mb();
if (HLS()->ipi_pending) set_csr(mip, MIP_SSIP);
@@ -153,7 +151,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
if (m->dev == dev && m->cmd == cmd) {
m->data = data;
- // dequeue from request queue
+ /* dequeue from request queue */
if (prev)
prev->sbi_private_data = (uintptr_t)next;
else
@@ -161,7 +159,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
HLS()->device_request_queue_size = n-1;
m->sbi_private_data = 0;
- // enqueue to response queue
+ /* enqueue to response queue */
if (HLS()->device_response_queue_tail)
{
HLS()->device_response_queue_tail->sbi_private_data = (uintptr_t)m;
@@ -172,7 +170,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
}
HLS()->device_response_queue_tail = m;
- // signal software interrupt
+ /* signal software interrupt */
set_csr(mip, MIP_SSIP);
return 0;
}
@@ -180,9 +178,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
prev = m;
m = (void*)atomic_read(&m->sbi_private_data);
}
- //HLT();
return 0;
- //panic("htif: no record");
}
uintptr_t mcall_console_putchar(uint8_t ch)
diff --git a/src/mainboard/emulation/spike-riscv/bootblock.c b/src/mainboard/emulation/spike-riscv/bootblock.c
index 40a7de1..c4c886c 100644
--- a/src/mainboard/emulation/spike-riscv/bootblock.c
+++ b/src/mainboard/emulation/spike-riscv/bootblock.c
@@ -18,8 +18,8 @@
#include <console/console.h>
#include <program_loading.h>
-// the qemu part of all this is very, very non-hardware like.
-// so it gets its own bootblock.
+/* the qemu part of all this is very, very non-hardware like. */
+/* so it gets its own bootblock. */
void main(void)
{
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
diff --git a/src/mainboard/emulation/spike-riscv/spike_util.c b/src/mainboard/emulation/spike-riscv/spike_util.c
index 7ddf16b..26789b4 100644
--- a/src/mainboard/emulation/spike-riscv/spike_util.c
+++ b/src/mainboard/emulation/spike-riscv/spike_util.c
@@ -34,8 +34,7 @@
#include <vm.h>
uintptr_t translate_address(uintptr_t vAddr) {
- // TODO: implement the page table translation algorithm
- //uintptr_t pageTableRoot = read_csr(sptbr);
+ /* TODO: implement the page table translation algorithm */
uintptr_t physAddrMask = 0xfffffff;
uintptr_t translationResult = vAddr & physAddrMask;
printk(BIOS_DEBUG, "Translated virtual address 0x%llx to physical address 0x%llx\n", vAddr, translationResult);
@@ -63,7 +62,7 @@ uintptr_t mcall_send_ipi(uintptr_t recipient)
uintptr_t mcall_clear_ipi(void)
{
- // only clear SSIP if no other events are pending
+ /* only clear SSIP if no other events are pending */
if (HLS()->device_response_queue_head == NULL) {
clear_csr(mip, MIP_SSIP);
mb();
HAOUAS Elyes (ehaouas(a)noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16913
-gerrit
commit 9f44fc02f254f4a8be088281dc6ca5922e485e97
Author: Elyes HAOUAS <ehaouas(a)noos.fr>
Date: Fri Oct 7 12:46:28 2016 +0200
mainboard/apple: Use C89 comments style & remove commented code
Change-Id: I81c32c618627507cc3a83f60f565a73e5e6d7a13
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
---
src/mainboard/apple/macbook21/romstage.c | 200 ++++++++++++++++---------------
src/mainboard/apple/macbookair4_2/gnvs.c | 2 +-
2 files changed, 103 insertions(+), 99 deletions(-)
diff --git a/src/mainboard/apple/macbook21/romstage.c b/src/mainboard/apple/macbook21/romstage.c
index 695f1cd..391b09f 100644
--- a/src/mainboard/apple/macbook21/romstage.c
+++ b/src/mainboard/apple/macbook21/romstage.c
@@ -15,7 +15,7 @@
* GNU General Public License for more details.
*/
-// __PRE_RAM__ means: use "unsigned" for device, not a struct.
+/* __PRE_RAM__ means: use "unsigned" for device, not a struct. */
#include <stdint.h>
#include <string.h>
@@ -89,110 +89,116 @@ void setup_ich7_gpios(void)
static void ich7_enable_lpc(void)
{
- // Enable Serial IRQ
+ /* Enable Serial IRQ */
pci_write_config8(PCI_DEV(0, 0x1f, 0), 0x64, 0xd0);
- // I/O Decode Ranges
- // X60: 0x0210 == 00000010 00010000
- // Macbook21: 0x0010 == 00000000 00010000
- // Bit 9:8 LPT Decode Range. This field determines which range to
- // decode for the LPT Port.
- // 00 = 378h - 37Fh and 778h - 77Fh
- // 10 = 3BCh - 3BEh and 7BCh - 7BEh
+ /* I/O Decode Ranges
+ * X60: 0x0210 == 00000010 00010000
+ * Macbook21: 0x0010 == 00000000 00010000
+ * Bit 9:8 LPT Decode Range. This field determines which range to
+ * decode for the LPT Port.
+ * 00 = 378h - 37Fh and 778h - 77Fh
+ * 10 = 3BCh - 3BEh and 7BCh - 7BEh
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0010);
- // LPC_EN--LPC I/F Enables Register
- // X60: 0x1f0d == 00011111 00001101
- // Macbook21: 0x3807 == 00111000 00000111
- // Bit 13 CNF2_LPC_EN -- R/W. Microcontroller Enable # 2.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 4Eh and 4Fh
- // to the LPC interface. This range is used for a
- // microcontroller.
- // Bit 12 CNF1_LPC_EN -- R/W. Super I/O Enable.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 2Eh and 2Fh
- // to the LPC interface. This range is used for
- // Super I/O devices.
- // Bit 11 MC_LPC_EN -- R/W. Microcontroller Enable # 1.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 62h and 66h
- // to the LPC interface. This range is used for a
- // microcontroller.
- // Bit 10 KBC_LPC_EN -- R/W. Keyboard Enable.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 60h and 64h
- // to the LPC interface. This range is used for a
- // microcontroller.
- // Bit 9 GAMEH_LPC_EN -- R/W. High Gameport Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 208h to 20Fh
- // to the LPC interface. This range is used for a gameport.
- // Bit 8 GAMEL_LPC_EN -- R/W. Low Gameport Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 200h to 207h
- // to the LPC interface. This range is used for a gameport.
- // Bit 3 FDD_LPC_EN -- R/W. Floppy Drive Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the FDD range to the LPC
- // interface. This range is selected in the LPC_FDD/LPT
- // Decode Range Register (D31:F0:80h, bit 12).
- // Bit 2 LPT_LPC_EN -- R/W. Parallel Port Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the LPT range to the LPC
- // interface. This range is selected in the LPC_FDD/LPT
- // Decode Range Register (D31:F0:80h, bit 9:8).
- // Bit 1 COMB_LPC_EN -- R/W. Com Port B Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the COMB range to the LPC
- // interface. This range is selected in the LPC_COM Decode
- // Range Register (D31:F0:80h, bits 6:4).
- // Bit 0 COMA_LPC_EN -- R/W. Com Port A Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the COMA range to the LPC
- // interface. This range is selected in the LPC_COM Decode
- // Range Register (D31:F0:80h, bits 3:2).
+ /* LPC_EN--LPC I/F Enables Register
+ * X60: 0x1f0d == 00011111 00001101
+ * Macbook21: 0x3807 == 00111000 00000111
+ * Bit 13 CNF2_LPC_EN -- R/W. Microcontroller Enable # 2.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 4Eh and 4Fh
+ * to the LPC interface. This range is used for a
+ * microcontroller.
+ * Bit 12 CNF1_LPC_EN -- R/W. Super I/O Enable.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 2Eh and 2Fh
+ * to the LPC interface. This range is used for
+ * Super I/O devices.
+ * Bit 11 MC_LPC_EN -- R/W. Microcontroller Enable # 1.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 62h and 66h
+ * to the LPC interface. This range is used for a
+ * microcontroller.
+ * Bit 10 KBC_LPC_EN -- R/W. Keyboard Enable.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 60h and 64h
+ * to the LPC interface. This range is used for a
+ * microcontroller.
+ * Bit 9 GAMEH_LPC_EN -- R/W. High Gameport Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 208h to 20Fh
+ * to the LPC interface. This range is used for a gameport.
+ * Bit 8 GAMEL_LPC_EN -- R/W. Low Gameport Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 200h to 207h
+ * to the LPC interface. This range is used for a gameport.
+ * Bit 3 FDD_LPC_EN -- R/W. Floppy Drive Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the FDD range to the LPC
+ * interface. This range is selected in the LPC_FDD/LPT
+ * Decode Range Register (D31:F0:80h, bit 12).
+ * Bit 2 LPT_LPC_EN -- R/W. Parallel Port Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the LPT range to the LPC
+ * interface. This range is selected in the LPC_FDD/LPT
+ * Decode Range Register (D31:F0:80h, bit 9:8).
+ * Bit 1 COMB_LPC_EN -- R/W. Com Port B Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the COMB range to the LPC
+ * interface. This range is selected in the LPC_COM Decode
+ * Range Register (D31:F0:80h, bits 6:4).
+ * Bit 0 COMA_LPC_EN -- R/W. Com Port A Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the COMA range to the LPC
+ * interface. This range is selected in the LPC_COM Decode
+ * Range Register (D31:F0:80h, bits 3:2).
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3807);
- /* GEN1_DEC, LPC Interface Generic Decode Range 1 */
- // X60: 0x1601 0x007c == 00000000 01111100 00010110 00000001
- // Macbook21: 0x0681 0x000c == 00000000 00001100 00000110 10000001
- // Bit 31:24 Reserved.
- // Bit 23:18 Generic I/O Decode Range Address[7:2] Mask: A `1' in any
- // bit position indicates that any value in the corresponding
- // address bit in a received cycle will be treated as a
- // match. The corresponding bit in the Address field, below,
- // is ignored. The mask is only provided for the lower 6 bits
- // of the DWord address, allowing for decoding blocks up to
- // 256 bytes in size.
- // Bit 17:16 Reserved.
- // Bit 15:2 Generic I/O Decode Range 1 Base Address (GEN1_BASE). This
- // address is aligned on a 128-byte boundary, and must have
- // address lines 31:16 as 0. NOTE: The Intel ICH7 does not
- // provide decode down to the word or byte level.
- // Bit 1 Reserved.
- // Bit 0 Generic Decode Range 1 Enable (GEN1_EN) -- R/W.
- // 0 = Disable.
- // 1 = Enable the GEN1 I/O range to be forwarded to the LPC
- // I/F
+ /* GEN1_DEC, LPC Interface Generic Decode Range 1
+ * X60: 0x1601 0x007c == 00000000 01111100 00010110 00000001
+ * Macbook21: 0x0681 0x000c == 00000000 00001100 00000110 10000001
+ * Bit 31:24 Reserved.
+ * Bit 23:18 Generic I/O Decode Range Address[7:2] Mask: A `1' in any
+ * bit position indicates that any value in the corresponding
+ * address bit in a received cycle will be treated as a
+ * match. The corresponding bit in the Address field, below,
+ * is ignored. The mask is only provided for the lower 6 bits
+ * of the DWord address, allowing for decoding blocks up to
+ * 256 bytes in size.
+ * Bit 17:16 Reserved.
+ * Bit 15:2 Generic I/O Decode Range 1 Base Address (GEN1_BASE). This
+ * address is aligned on a 128-byte boundary, and must have
+ * address lines 31:16 as 0. NOTE: The Intel ICH7 does not
+ * provide decode down to the word or byte level.
+ * Bit 1 Reserved.
+ * Bit 0 Generic Decode Range 1 Enable (GEN1_EN) -- R/W.
+ * 0 = Disable.
+ * 1 = Enable the GEN1 I/O range to be forwarded to the LPC
+ * I/F
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x84, 0x0681);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x86, 0x000c);
- /* GEN2_DEC, LPC Interface Generic Decode Range 2 */
- // X60: 0x15e1 0x000c == 00000000 00001100 00010101 11100001
- // Macbook21: 0x1641 0x000c == 00000000 00001100 00010110 01000001
+ /* GEN2_DEC, LPC Interface Generic Decode Range 2
+ * X60: 0x15e1 0x000c == 00000000 00001100 00010101 11100001
+ * Macbook21: 0x1641 0x000c == 00000000 00001100 00010110 01000001
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x88, 0x1641);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8a, 0x000c);
- /* GEN3_DEC, LPC Interface Generic Decode Range 3 */
- // X60: 0x1681 0x001c == 00000000 00011100 00010110 10000001
- // Macbook21: 0x0000 0x0000
- pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8c, 0x0000); // obsolete, because it writes zeros?
+ /* GEN3_DEC, LPC Interface Generic Decode Range 3
+ * X60: 0x1681 0x001c == 00000000 00011100 00010110 10000001
+ * Macbook21: 0x0000 0x0000
+ */
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8c, 0x0000); /* obsolete, because it writes zeros? */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8e, 0x0000);
- /* GEN4_DEC, LPC Interface Generic Decode Range 4 */
- // X60: 0x0000 0x0000
- // Macbook21: 0x0301 0x001c == 00000000 00011100 00000011 00000001
+ /* GEN4_DEC, LPC Interface Generic Decode Range 4
+ * X60: 0x0000 0x0000
+ * Macbook21: 0x0301 0x001c == 00000000 00011100 00000011 00000001
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x90, 0x0301);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x92, 0x001c);
}
@@ -225,11 +231,9 @@ static void rcba_config(void)
/* Disable unused devices */
RCBA32(0x3418) = FD_PCIE6 | FD_PCIE5 | FD_PCIE4 | FD_PCIE3 | FD_INTLAN | FD_ACMOD | FD_ACAUD;
- RCBA32(0x3418) |= (1 << 0); // Required.
+ RCBA32(0x3418) |= (1 << 0); /* Required. */
/* Set up I/O Trap #0 for 0xfe00 (SMIC) */
- // RCBA32(0x1e84) = 0x00020001;
- // RCBA32(0x1e80) = 0x0000fe01;
/* Set up I/O Trap #3 for 0x800-0x80c (Trap) */
RCBA32(0x1e9c) = 0x000200f0;
@@ -241,15 +245,15 @@ static void early_ich7_init(void)
uint8_t reg8;
uint32_t reg32;
- // program secondary mlt XXX byte?
+ /* program secondary mlt XXX byte? */
pci_write_config8(PCI_DEV(0, 0x1e, 0), 0x1b, 0x20);
- // reset rtc power status
+ /* reset rtc power status */
reg8 = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xa4);
reg8 &= ~(1 << 2);
pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xa4, reg8);
- // usb transient disconnect
+ /* usb transient disconnect */
reg8 = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xad);
reg8 |= (3 << 0);
pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xad, reg8);
@@ -283,7 +287,7 @@ static void early_ich7_init(void)
RCBA32(0x3e0e) |= (1 << 7);
RCBA32(0x3e4e) |= (1 << 7);
- // next step only on ich7m b0 and later:
+ /* next step only on ich7m b0 and later: */
reg32 = RCBA32(0x2034);
reg32 &= ~(0x0f << 16);
reg32 |= (5 << 16);
diff --git a/src/mainboard/apple/macbookair4_2/gnvs.c b/src/mainboard/apple/macbookair4_2/gnvs.c
index 06f47cd..def9e5f 100644
--- a/src/mainboard/apple/macbookair4_2/gnvs.c
+++ b/src/mainboard/apple/macbookair4_2/gnvs.c
@@ -23,7 +23,7 @@ void acpi_create_gnvs(global_nvs_t *gnvs)
gnvs->s5u0 = 0;
gnvs->s5u1 = 0;
- // the lid is open by default.
+ /* the lid is open by default. */
gnvs->lids = 1;
gnvs->tcrt = 100;
HAOUAS Elyes (ehaouas(a)noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16913
-gerrit
commit 5a2b00c0b412fe619bccfe13a44c64151e03bf7f
Author: Elyes HAOUAS <ehaouas(a)noos.fr>
Date: Fri Oct 7 12:46:28 2016 +0200
mainboard/apple: Use C89 comments style & remove commented code
Change-Id: I81c32c618627507cc3a83f60f565a73e5e6d7a13
Signed-off-by: Elyes HAOUAS <ehaouas(a)noos.fr>
---
src/mainboard/apple/macbook21/romstage.c | 199 ++++++++++++++++---------------
src/mainboard/apple/macbookair4_2/gnvs.c | 2 +-
2 files changed, 102 insertions(+), 99 deletions(-)
diff --git a/src/mainboard/apple/macbook21/romstage.c b/src/mainboard/apple/macbook21/romstage.c
index 695f1cd..ae8b45a 100644
--- a/src/mainboard/apple/macbook21/romstage.c
+++ b/src/mainboard/apple/macbook21/romstage.c
@@ -15,7 +15,7 @@
* GNU General Public License for more details.
*/
-// __PRE_RAM__ means: use "unsigned" for device, not a struct.
+/* __PRE_RAM__ means: use "unsigned" for device, not a struct. */
#include <stdint.h>
#include <string.h>
@@ -89,110 +89,115 @@ void setup_ich7_gpios(void)
static void ich7_enable_lpc(void)
{
- // Enable Serial IRQ
+ /* Enable Serial IRQ */
pci_write_config8(PCI_DEV(0, 0x1f, 0), 0x64, 0xd0);
- // I/O Decode Ranges
- // X60: 0x0210 == 00000010 00010000
- // Macbook21: 0x0010 == 00000000 00010000
- // Bit 9:8 LPT Decode Range. This field determines which range to
- // decode for the LPT Port.
- // 00 = 378h - 37Fh and 778h - 77Fh
- // 10 = 3BCh - 3BEh and 7BCh - 7BEh
+ /* I/O Decode Ranges
+ * X60: 0x0210 == 00000010 00010000
+ * Macbook21: 0x0010 == 00000000 00010000
+ * Bit 9:8 LPT Decode Range. This field determines which range to
+ * decode for the LPT Port.
+ * 00 = 378h - 37Fh and 778h - 77Fh
+ * 10 = 3BCh - 3BEh and 7BCh - 7BEh
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0010);
- // LPC_EN--LPC I/F Enables Register
- // X60: 0x1f0d == 00011111 00001101
- // Macbook21: 0x3807 == 00111000 00000111
- // Bit 13 CNF2_LPC_EN -- R/W. Microcontroller Enable # 2.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 4Eh and 4Fh
- // to the LPC interface. This range is used for a
- // microcontroller.
- // Bit 12 CNF1_LPC_EN -- R/W. Super I/O Enable.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 2Eh and 2Fh
- // to the LPC interface. This range is used for
- // Super I/O devices.
- // Bit 11 MC_LPC_EN -- R/W. Microcontroller Enable # 1.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 62h and 66h
- // to the LPC interface. This range is used for a
- // microcontroller.
- // Bit 10 KBC_LPC_EN -- R/W. Keyboard Enable.
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 60h and 64h
- // to the LPC interface. This range is used for a
- // microcontroller.
- // Bit 9 GAMEH_LPC_EN -- R/W. High Gameport Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 208h to 20Fh
- // to the LPC interface. This range is used for a gameport.
- // Bit 8 GAMEL_LPC_EN -- R/W. Low Gameport Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the I/O locations 200h to 207h
- // to the LPC interface. This range is used for a gameport.
- // Bit 3 FDD_LPC_EN -- R/W. Floppy Drive Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the FDD range to the LPC
- // interface. This range is selected in the LPC_FDD/LPT
- // Decode Range Register (D31:F0:80h, bit 12).
- // Bit 2 LPT_LPC_EN -- R/W. Parallel Port Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the LPT range to the LPC
- // interface. This range is selected in the LPC_FDD/LPT
- // Decode Range Register (D31:F0:80h, bit 9:8).
- // Bit 1 COMB_LPC_EN -- R/W. Com Port B Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the COMB range to the LPC
- // interface. This range is selected in the LPC_COM Decode
- // Range Register (D31:F0:80h, bits 6:4).
- // Bit 0 COMA_LPC_EN -- R/W. Com Port A Enable
- // 0 = Disable.
- // 1 = Enables the decoding of the COMA range to the LPC
- // interface. This range is selected in the LPC_COM Decode
- // Range Register (D31:F0:80h, bits 3:2).
+ /* LPC_EN--LPC I/F Enables Register
+ * X60: 0x1f0d == 00011111 00001101
+ * Macbook21: 0x3807 == 00111000 00000111
+ * Bit 13 CNF2_LPC_EN -- R/W. Microcontroller Enable # 2.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 4Eh and 4Fh
+ * to the LPC interface. This range is used for a
+ * microcontroller.
+ * Bit 12 CNF1_LPC_EN -- R/W. Super I/O Enable.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 2Eh and 2Fh
+ * to the LPC interface. This range is used for
+ * Super I/O devices.
+ * Bit 11 MC_LPC_EN -- R/W. Microcontroller Enable # 1.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 62h and 66h
+ * to the LPC interface. This range is used for a
+ * microcontroller.
+ * Bit 10 KBC_LPC_EN -- R/W. Keyboard Enable.
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 60h and 64h
+ * to the LPC interface. This range is used for a
+ * microcontroller.
+ * Bit 9 GAMEH_LPC_EN -- R/W. High Gameport Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 208h to 20Fh
+ * to the LPC interface. This range is used for a gameport.
+ * Bit 8 GAMEL_LPC_EN -- R/W. Low Gameport Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the I/O locations 200h to 207h
+ * to the LPC interface. This range is used for a gameport.
+ * Bit 3 FDD_LPC_EN -- R/W. Floppy Drive Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the FDD range to the LPC
+ * interface. This range is selected in the LPC_FDD/LPT
+ * Decode Range Register (D31:F0:80h, bit 12).
+ * Bit 2 LPT_LPC_EN -- R/W. Parallel Port Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the LPT range to the LPC
+ * interface. This range is selected in the LPC_FDD/LPT
+ * Decode Range Register (D31:F0:80h, bit 9:8).
+ * Bit 1 COMB_LPC_EN -- R/W. Com Port B Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the COMB range to the LPC
+ * interface. This range is selected in the LPC_COM Decode
+ * Range Register (D31:F0:80h, bits 6:4).
+ * Bit 0 COMA_LPC_EN -- R/W. Com Port A Enable
+ * 0 = Disable.
+ * 1 = Enables the decoding of the COMA range to the LPC
+ * interface. This range is selected in the LPC_COM Decode
+ * Range Register (D31:F0:80h, bits 3:2).
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x3807);
- /* GEN1_DEC, LPC Interface Generic Decode Range 1 */
- // X60: 0x1601 0x007c == 00000000 01111100 00010110 00000001
- // Macbook21: 0x0681 0x000c == 00000000 00001100 00000110 10000001
- // Bit 31:24 Reserved.
- // Bit 23:18 Generic I/O Decode Range Address[7:2] Mask: A `1' in any
- // bit position indicates that any value in the corresponding
- // address bit in a received cycle will be treated as a
- // match. The corresponding bit in the Address field, below,
- // is ignored. The mask is only provided for the lower 6 bits
- // of the DWord address, allowing for decoding blocks up to
- // 256 bytes in size.
- // Bit 17:16 Reserved.
- // Bit 15:2 Generic I/O Decode Range 1 Base Address (GEN1_BASE). This
- // address is aligned on a 128-byte boundary, and must have
- // address lines 31:16 as 0. NOTE: The Intel ICH7 does not
- // provide decode down to the word or byte level.
- // Bit 1 Reserved.
- // Bit 0 Generic Decode Range 1 Enable (GEN1_EN) -- R/W.
- // 0 = Disable.
- // 1 = Enable the GEN1 I/O range to be forwarded to the LPC
- // I/F
+ /* GEN1_DEC, LPC Interface Generic Decode Range 1
+ * X60: 0x1601 0x007c == 00000000 01111100 00010110 00000001
+ * Macbook21: 0x0681 0x000c == 00000000 00001100 00000110 10000001
+ * Bit 31:24 Reserved.
+ * Bit 23:18 Generic I/O Decode Range Address[7:2] Mask: A `1' in any
+ * bit position indicates that any value in the corresponding
+ * address bit in a received cycle will be treated as a
+ * match. The corresponding bit in the Address field, below,
+ * is ignored. The mask is only provided for the lower 6 bits
+ * of the DWord address, allowing for decoding blocks up to
+ * 256 bytes in size.
+ * Bit 17:16 Reserved.
+ * Bit 15:2 Generic I/O Decode Range 1 Base Address (GEN1_BASE). This
+ * address is aligned on a 128-byte boundary, and must have
+ * address lines 31:16 as 0. NOTE: The Intel ICH7 does not
+ * provide decode down to the word or byte level.
+ * Bit 1 Reserved.
+ * Bit 0 Generic Decode Range 1 Enable (GEN1_EN) -- R/W.
+ * 0 = Disable.
+ * 1 = Enable the GEN1 I/O range to be forwarded to the LPC
+ */ I/F
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x84, 0x0681);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x86, 0x000c);
- /* GEN2_DEC, LPC Interface Generic Decode Range 2 */
- // X60: 0x15e1 0x000c == 00000000 00001100 00010101 11100001
- // Macbook21: 0x1641 0x000c == 00000000 00001100 00010110 01000001
+ /* GEN2_DEC, LPC Interface Generic Decode Range 2
+ * X60: 0x15e1 0x000c == 00000000 00001100 00010101 11100001
+ * Macbook21: 0x1641 0x000c == 00000000 00001100 00010110 01000001
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x88, 0x1641);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8a, 0x000c);
- /* GEN3_DEC, LPC Interface Generic Decode Range 3 */
- // X60: 0x1681 0x001c == 00000000 00011100 00010110 10000001
- // Macbook21: 0x0000 0x0000
- pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8c, 0x0000); // obsolete, because it writes zeros?
+ /* GEN3_DEC, LPC Interface Generic Decode Range 3
+ * X60: 0x1681 0x001c == 00000000 00011100 00010110 10000001
+ * Macbook21: 0x0000 0x0000
+ */
+ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8c, 0x0000); /* obsolete, because it writes zeros? */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x8e, 0x0000);
- /* GEN4_DEC, LPC Interface Generic Decode Range 4 */
- // X60: 0x0000 0x0000
- // Macbook21: 0x0301 0x001c == 00000000 00011100 00000011 00000001
+ /* GEN4_DEC, LPC Interface Generic Decode Range 4
+ * X60: 0x0000 0x0000
+ * Macbook21: 0x0301 0x001c == 00000000 00011100 00000011 00000001
+ */
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x90, 0x0301);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x92, 0x001c);
}
@@ -225,11 +230,9 @@ static void rcba_config(void)
/* Disable unused devices */
RCBA32(0x3418) = FD_PCIE6 | FD_PCIE5 | FD_PCIE4 | FD_PCIE3 | FD_INTLAN | FD_ACMOD | FD_ACAUD;
- RCBA32(0x3418) |= (1 << 0); // Required.
+ RCBA32(0x3418) |= (1 << 0); /* Required. */
/* Set up I/O Trap #0 for 0xfe00 (SMIC) */
- // RCBA32(0x1e84) = 0x00020001;
- // RCBA32(0x1e80) = 0x0000fe01;
/* Set up I/O Trap #3 for 0x800-0x80c (Trap) */
RCBA32(0x1e9c) = 0x000200f0;
@@ -241,15 +244,15 @@ static void early_ich7_init(void)
uint8_t reg8;
uint32_t reg32;
- // program secondary mlt XXX byte?
+ /* program secondary mlt XXX byte? */
pci_write_config8(PCI_DEV(0, 0x1e, 0), 0x1b, 0x20);
- // reset rtc power status
+ /* reset rtc power status */
reg8 = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xa4);
reg8 &= ~(1 << 2);
pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xa4, reg8);
- // usb transient disconnect
+ /* usb transient disconnect */
reg8 = pci_read_config8(PCI_DEV(0, 0x1f, 0), 0xad);
reg8 |= (3 << 0);
pci_write_config8(PCI_DEV(0, 0x1f, 0), 0xad, reg8);
@@ -283,7 +286,7 @@ static void early_ich7_init(void)
RCBA32(0x3e0e) |= (1 << 7);
RCBA32(0x3e4e) |= (1 << 7);
- // next step only on ich7m b0 and later:
+ /* next step only on ich7m b0 and later: */
reg32 = RCBA32(0x2034);
reg32 &= ~(0x0f << 16);
reg32 |= (5 << 16);
diff --git a/src/mainboard/apple/macbookair4_2/gnvs.c b/src/mainboard/apple/macbookair4_2/gnvs.c
index 06f47cd..def9e5f 100644
--- a/src/mainboard/apple/macbookair4_2/gnvs.c
+++ b/src/mainboard/apple/macbookair4_2/gnvs.c
@@ -23,7 +23,7 @@ void acpi_create_gnvs(global_nvs_t *gnvs)
gnvs->s5u0 = 0;
gnvs->s5u1 = 0;
- // the lid is open by default.
+ /* the lid is open by default. */
gnvs->lids = 1;
gnvs->tcrt = 100;
the following patch was just integrated into master:
commit 0b1a90da76cc1e81b6a1a43a8ffc2ddd97b84377
Author: Kevin Chiu <Kevin.Chiu(a)quantatw.com>
Date: Mon Oct 3 17:15:15 2016 +0800
mainboard/google/reef: add pyro variant.
Create the initial Pyro variant which refers to the Reef.
Pyro is APL Chrome board that deviate from reference board Reef.
BRANCH=master
BUG=None
TEST=Build
Signed-off-by: Kevin Chiu <Kevin.Chiu(a)quantatw.com>
Change-Id: I9beed1f6895e8891d3d51b563edfe172f566718b
Reviewed-on: https://review.coreboot.org/16855
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Tested-by: build bot (Jenkins)
See https://review.coreboot.org/16855 for details.
-gerrit
Daisuke Nojiri (dnojiri(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16912
-gerrit
commit 8c02db4345928901708e44d7dbca65f6b31239dc
Author: Daisuke Nojiri <dnojiri(a)chromium.org>
Date: Thu Oct 6 13:21:17 2016 -0700
gitconfig: Allow user name and email to be in includes
This patch adds '--includes' option to 'git config --global' command
to allow user name and email to be defined in a file included from
the global gitconfig (~/.gitconfig) file.
BUG=none
BRANCH=none
TEST=make gitconfig with ~/.gitconfig including another file which
defines user.name and email.
Change-Id: I4fe61078b143c3a2e26b0be69c3ca8e6f069d8b0
Signed-off-by: Daisuke Nojiri <dnojiri(a)chromium.org>
---
Makefile.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.inc b/Makefile.inc
index d6c7476..24f99cb 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -573,7 +573,7 @@ gitconfig:
git config remote.origin.push HEAD:refs/for/master
git config alias.sup '!git submodule update --remote --rebase && git submodule update --init --checkout'
git config alias.sup-destroy '!git submodule deinit --force "$$(git rev-parse --show-toplevel)"; git submodule init && git submodule update --checkout'
- (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email(a)example.com\n'; exit 1)
+ (git config --global --includes user.name >/dev/null && git config --global --includes user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email(a)example.com\n'; exit 1)
include util/crossgcc/Makefile.inc