Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/21096
Change subject: soc/amd/stoneyridge: Check UART index ......................................................................
soc/amd/stoneyridge: Check UART index
Verify that the caller to uart_platform_base() sends a valid index. The Stoney Ridge APU has only two internal UARTs.
Change-Id: I9432571712bae15a604f4280ea5e0f81fd68604d Signed-off-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/soc/amd/stoneyridge/uart.c 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/21096/1
diff --git a/src/soc/amd/stoneyridge/uart.c b/src/soc/amd/stoneyridge/uart.c index 9cc0c94..016d77b 100644 --- a/src/soc/amd/stoneyridge/uart.c +++ b/src/soc/amd/stoneyridge/uart.c @@ -13,11 +13,13 @@ * GNU General Public License for more details. */
+#include <assert.h> #include <console/uart.h> #include <soc/southbridge.h>
uintptr_t uart_platform_base(int idx) { + assert(idx <= 1 && idx >= 0); return (uintptr_t)(APU_UART0_BASE + 0x2000 * (idx & 1)); }