Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8011
-gerrit
commit 55722584a90e75f92b4c8244e253fe7712edff3c
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Tue May 27 18:03:38 2014 -0700
ipq806x: clean up UART driver tx_byte function
The driver as it was copied from u-boot provided a function to
transmit multiple characters in one invocation. This feature was not
ported to coreboot, there is no need to maintain the complexity when
only one character at a time is transmitted. It is also very desirable
to get rid of a 1024 byte array allocated on the stack.
The array was necessary to allow to convert multiple newline
characters in the transmit data flow into two character sequences
CRLF. Now just a single word is enough to keep one or two characters
to transmit.
BUG=chrome-os-partner:27784
TEST=verified that coreboot with the new code prints generates console
output.
Original-Change-Id: I73869c5f4ca87210b34811b583386554bafff1e7
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/201782
Original-Reviewed-by: Stefan Reinauer <reinauer(a)chromium.org>
Original-Reviewed-by: Trevor Bourget <tbourget(a)codeaurora.org>
(cherry picked from commit eab3dc9d30c7e8355a2563e18ada78e4070e6151)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I4274b8f7188bf9636906b39bcd9ec7adf0e1222e
---
src/soc/qualcomm/ipq806x/include/ipq_uart.h | 9 ---
src/soc/qualcomm/ipq806x/uart.c | 121 +++++-----------------------
2 files changed, 18 insertions(+), 112 deletions(-)
diff --git a/src/soc/qualcomm/ipq806x/include/ipq_uart.h b/src/soc/qualcomm/ipq806x/include/ipq_uart.h
index da943b9..90ca704 100644
--- a/src/soc/qualcomm/ipq806x/include/ipq_uart.h
+++ b/src/soc/qualcomm/ipq806x/include/ipq_uart.h
@@ -38,15 +38,6 @@
((value << (32 - end_pos))\
>> (32 - (end_pos - start_pos)))
-
-#define PACK_CHARS_INTO_WORDS(a, cnt, word) { \
- word = 0; \
- int j; \
- for(j=0; j < (int)cnt; j++) { \
- word |= (a[j] & 0xff)<< (j * 8);\
- } \
- }
-
extern void __udelay(unsigned long usec);
diff --git a/src/soc/qualcomm/ipq806x/uart.c b/src/soc/qualcomm/ipq806x/uart.c
index f7b5d02..e09bd0f 100644
--- a/src/soc/qualcomm/ipq806x/uart.c
+++ b/src/soc/qualcomm/ipq806x/uart.c
@@ -192,108 +192,32 @@ msm_boot_uart_dm_read(unsigned int *data, int *count, int wait)
}
#endif
-/**
- * msm_boot_uart_replace_lr_with_cr - replaces "\n" with "\r\n"
- * @data_in: characters to be converted
- * @num_of_chars: no. of characters
- * @data_out: location where converted chars are stored
- *
- * Replace linefeed char "\n" with carriage return + linefeed
- * "\r\n". Currently keeping it simple than efficient.
- */
-static unsigned int
-msm_boot_uart_replace_lr_with_cr(unsigned char *data_in,
- int num_of_chars,
- char *data_out, int *num_of_chars_out)
+void uart_tx_byte(int idx, unsigned char data)
{
- int i = 0, j = 0;
-
- if ((data_in == NULL) || (data_out == NULL) || (num_of_chars < 0))
- return MSM_BOOT_UART_DM_E_INVAL;
-
- for (i = 0, j = 0; i < num_of_chars; i++, j++) {
- if (data_in[i] == '\n')
- data_out[j++] = '\r';
-
- data_out[j] = data_in[i];
- }
-
- *num_of_chars_out = j;
-
- return MSM_BOOT_UART_DM_E_SUCCESS;
-}
-
-/**
- * msm_boot_uart_dm_write - transmit data
- * @data: data to transmit
- * @num_of_chars: no. of bytes to transmit
- *
- * Writes the data to the TX FIFO. If no space is available blocks
- * till space becomes available.
- */
-static unsigned int
-msm_boot_uart_dm_write(unsigned char *data, unsigned int num_of_chars)
-{
- unsigned int tx_word_count = 0;
- unsigned int tx_char_left = 0, tx_char = 0;
- unsigned int tx_word = 0;
- int i = 0;
- char *tx_data = NULL;
- char new_data[1024];
+ int num_of_chars = 1;
+ unsigned tx_data = 0;
unsigned int base = uart_board_param.uart_dm_base;
- if ((data == NULL) || (num_of_chars <= 0))
- return MSM_BOOT_UART_DM_E_INVAL;
-
- /* Replace line-feed (/n) with carriage-return + line-feed (/r/n) */
- msm_boot_uart_replace_lr_with_cr(data, num_of_chars, new_data, &i);
-
- tx_data = new_data;
- num_of_chars = i;
-
- /* Write to NO_CHARS_FOR_TX register number of characters
- * to be transmitted. However, before writing TX_FIFO must
- * be empty as indicated by TX_READY interrupt in IMR register
- */
- /* Check if transmit FIFO is empty.
- * If not we'll wait for TX_READY interrupt. */
-
- if (!(readl_i(MSM_BOOT_UART_DM_SR(base)) & MSM_BOOT_UART_DM_SR_TXEMT)) {
- while (!(readl_i(MSM_BOOT_UART_DM_ISR(base)) &
- MSM_BOOT_UART_DM_TX_READY))
- udelay(1);
+ /* Add CR to every LF. */
+ if (data == '\n') {
+ num_of_chars++;
+ tx_data = '\r' | ('\n' << 8);
+ } else {
+ tx_data = data;
}
- /* We are here. FIFO is ready to be written. */
- /* Write number of characters to be written */
- writel_i(num_of_chars, MSM_BOOT_UART_DM_NO_CHARS_FOR_TX(base));
-
- /* Clear TX_READY interrupt */
- writel_i(MSM_BOOT_UART_DM_GCMD_RES_TX_RDY_INT,
- MSM_BOOT_UART_DM_CR(base));
-
- /* We use four-character word FIFO. So we need to divide data into
- * four characters and write in UART_DM_TF register */
- tx_word_count = (num_of_chars % 4) ? ((num_of_chars / 4) + 1) :
- (num_of_chars / 4);
- tx_char_left = num_of_chars;
-
- for (i = 0; i < (int)tx_word_count; i++) {
- tx_char = (tx_char_left < 4) ? tx_char_left : 4;
- PACK_CHARS_INTO_WORDS(tx_data, tx_char, tx_word);
-
- /* Wait till TX FIFO has space */
+ /* Wait until transmit FIFO is empty. */
while (!(readl_i(MSM_BOOT_UART_DM_SR(base)) &
- MSM_BOOT_UART_DM_SR_TXRDY))
+ MSM_BOOT_UART_DM_SR_TXEMT))
udelay(1);
+ /*
+ * TX FIFO is ready to accept new character(s). First write number of
+ * characters to be transmitted.
+ */
+ writel_i(num_of_chars, MSM_BOOT_UART_DM_NO_CHARS_FOR_TX(base));
- /* TX FIFO has space. Write the chars */
- writel_i(tx_word, MSM_BOOT_UART_DM_TF(base, 0));
- tx_char_left = num_of_chars - (i + 1) * 4;
- tx_data = tx_data + 4;
- }
-
- return MSM_BOOT_UART_DM_E_SUCCESS;
+ /* And now write the character(s) */
+ writel_i(tx_data, MSM_BOOT_UART_DM_TF(base, 0));
}
/*
@@ -419,15 +343,6 @@ uint32_t uartmem_getbaseaddr(void)
#endif
/**
- * uart_tx_byte - transmits a character
- * @c: character to transmit
- */
-void uart_tx_byte(int idx, unsigned char c)
-{
- msm_boot_uart_dm_write(&c, 1);
-}
-
-/**
* uart_tx_flush - transmits a string of data
* @s: string to transmit
*/
Marc Jones (marc.jones(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7911
-gerrit
commit 3d0bc98be804f581d867b0357d2dee368e991c37
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Thu May 15 14:12:54 2014 -0700
libpayload: Do not tolerate compilation warnings when building
Make sure the build breaks in case of warnings.
BUG=none
TEST= All builds succeed with the restored patch and fail when a
compilation warning is thrown.
Original-Change-Id: I9bdcd8938f59913e4ba86df5e4921b3f821ef920
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/200110
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
(cherry picked from commit 16dde875950d6806cc770cdbee4d3ff456ed6f02)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I86988f8d3f1acaa6ceeabdcbfa3cede1e67c28fe
---
payloads/libpayload/Makefile.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc
index ffe8371..dd83f88 100644
--- a/payloads/libpayload/Makefile.inc
+++ b/payloads/libpayload/Makefile.inc
@@ -57,7 +57,7 @@ CFLAGS = $(EXTRA_CFLAGS) $(INCLUDES) -Os -pipe -nostdinc -ggdb3
CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
-CFLAGS += -Wstrict-aliasing -Wshadow
+CFLAGS += -Wstrict-aliasing -Wshadow -Werror
$(obj)/libpayload-config.h: $(KCONFIG_AUTOHEADER)
cmp $@ $< 2>/dev/null || cp $< $@
the following patch was just integrated into master:
commit 79a591fb3879a663208e5e3fb29886e0fe735f7e
Author: Furquan Shaikh <furquan(a)google.com>
Date: Tue May 13 13:47:32 2014 -0700
libpayload: Fix pointer related casts
Fix pointer related casts since this can create a problem for 64-bit systems.
BUG=None
BRANCH=None
TEST=Compiled successfully for link, nyan using emerge-* libpayload
Original-Change-Id: I4cbd2d9f1efaaac87c3eba69204337fd6893ed66
Original-Reviewed-on: https://chromium-review.googlesource.com/199564
Original-Reviewed-by: Furquan Shaikh <furquan(a)chromium.org>
Original-Commit-Queue: Furquan Shaikh <furquan(a)chromium.org>
Original-Tested-by: Furquan Shaikh <furquan(a)chromium.org>
(cherry picked from commit 914b118a64b0691aeca463dff24252db9c24109e)
Signed-off-by: Marc Jones <marc.jones(a)se-eng.com>
Change-Id: I11f070ed5d3eddd8b9be30c428cb24c8439e617b
Reviewed-on: http://review.coreboot.org/7905
Reviewed-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/7905 for details.
-gerrit
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8017
-gerrit
commit 4c581692819249d030bdd5f009f5dceb46603fd1
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Thu Jan 1 04:09:04 2015 +1100
northbridge/amd/agesa/family1{4,5}: Remove cruff from dimmSpd.c
Remove useless comment pretaining to abusing pragma's for old
GCC/GDB interaction issues.
Change-Id: Ic83a0285ac947a23699a81a82b89de08a47ab052
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/northbridge/amd/agesa/family14/dimmSpd.c | 3 ---
src/northbridge/amd/agesa/family15/dimmSpd.c | 3 ---
2 files changed, 6 deletions(-)
diff --git a/src/northbridge/amd/agesa/family14/dimmSpd.c b/src/northbridge/amd/agesa/family14/dimmSpd.c
index 6ca2ce1..bee2c7e 100644
--- a/src/northbridge/amd/agesa/family14/dimmSpd.c
+++ b/src/northbridge/amd/agesa/family14/dimmSpd.c
@@ -30,9 +30,6 @@
#include <northbridge/amd/agesa/dimmSpd.h>
-/* uncomment for source level debug - GDB gets really confused otherwise. */
-//#pragma optimize ("", off)
-
/**
* Gets the SMBus address for an SPD from the array in devicetree.cb
* then read the SPD into the supplied buffer.
diff --git a/src/northbridge/amd/agesa/family15/dimmSpd.c b/src/northbridge/amd/agesa/family15/dimmSpd.c
index bf8e59e..201f293 100644
--- a/src/northbridge/amd/agesa/family15/dimmSpd.c
+++ b/src/northbridge/amd/agesa/family15/dimmSpd.c
@@ -30,9 +30,6 @@
#include <northbridge/amd/agesa/dimmSpd.h>
-/* uncomment for source level debug - GDB gets really confused otherwise. */
-//#pragma optimize ("", off)
-
/**
* Gets the SMBus address for an SPD from the array in devicetree.cb
* then read the SPD into the supplied buffer.
Mono Moosbart (mono(a)posteo.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7990
-gerrit
commit e574f12bfe12d109e140e8d6ae86c3d76a4bc500
Author: Axel Holewa <mono(a)posteo.de>
Date: Wed Dec 31 01:52:27 2014 +0100
i82801gx: remove wrong code from pci bridge init
This code uses missleading register name PCI_MIN_GNT defined in
pci_def.h with 0x3e. However this device has no register with
this name. Moreover, this device's register at offset 0x3e has
the name BCTRL defined in i82801gx.h. Right above this removed
code, in line 41-44, bits 0 and 1 at offset 0x3e (BCTRL) are
cleared disabling Parity Error Response and SERR#. The removed
code then enables SERR# and ISA.
Tested with printk and lspci.
Other southbridges maybe use the same wrong code (lynxpoint, bd82x6x).
Change-Id: I61270441a56067e4255c75d39428258dc39ffaef
Signed-off-by: Axel Holewa <mono(a)posteo.de>
---
src/southbridge/intel/i82801gx/pci.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/southbridge/intel/i82801gx/pci.c b/src/southbridge/intel/i82801gx/pci.c
index 0f372e7..90d9107 100644
--- a/src/southbridge/intel/i82801gx/pci.c
+++ b/src/southbridge/intel/i82801gx/pci.c
@@ -49,9 +49,6 @@ static void pci_init(struct device *dev)
reg8 |= (0x04 << 3);
pci_write_config8(dev, SMLT, reg8);
- /* Will this improve throughput of bus masters? */
- pci_write_config8(dev, PCI_MIN_GNT, 0x06);
-
/* Clear errors in status registers */
reg16 = pci_read_config16(dev, PSTS);
//reg16 |= 0xf900;