hrev44155 adds 3 changesets to branch 'master' old head: 78af90d4946bd94e78ceaec1eefdd02e5649e515 new head: a5a89915fcf5d931f934cc6cbe125aaaf13288ef ---------------------------------------------------------------------------- 4ffe10c: rpi gpio: Remove alt0 mode on serial pins * Confirmed this places pins in miniUART mode (we don't want this mode however) * We do need to fully understand *which* mode the pins need to be in for PL011 mode.. however the boot state of the Pi is PL011 fd52e77: PL011 uart: Disable "fluff" code * Once I can confirm it works will re-enable * Not needed for basic functionality a5a8991: PL011 uart: rename UART -> uart * Left over var name from my test code * This should be pretty close to functional (if not already working) * Any more uart experimentation will not reach upstream until working. [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- 2 files changed, 5 insertions(+), 11 deletions(-) src/system/boot/platform/raspberrypi_arm/gpio.cpp | 9 --------- src/system/kernel/arch/arm/uart_pl011.cpp | 7 +++++-- ############################################################################ Commit: 4ffe10ca3302ba55ae1bc8d95386c13b2f28a5b6 URL: http://cgit.haiku-os.org/haiku/commit/?id=4ffe10c Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Mon May 14 18:54:02 2012 UTC rpi gpio: Remove alt0 mode on serial pins * Confirmed this places pins in miniUART mode (we don't want this mode however) * We do need to fully understand *which* mode the pins need to be in for PL011 mode.. however the boot state of the Pi is PL011 ---------------------------------------------------------------------------- diff --git a/src/system/boot/platform/raspberrypi_arm/gpio.cpp b/src/system/boot/platform/raspberrypi_arm/gpio.cpp index 24a380b..e3bcadc 100644 --- a/src/system/boot/platform/raspberrypi_arm/gpio.cpp +++ b/src/system/boot/platform/raspberrypi_arm/gpio.cpp @@ -99,13 +99,4 @@ gpio_init() int pin = 0; for (pin = 16; pin <= 25; pin++) gpio_mode(GPIO_BASE, pin, GPIO_OUT); - - // ** Prepare UART pins for serial communication - // Set alternate function 0 on UART pins - gpio_mode(GPIO_BASE, 14, GPIO_ALT0); - gpio_mode(GPIO_BASE, 15, GPIO_ALT0); - - // Pull UART pins to initial state low - gpio_write(GPIO_BASE, 14, 0); - gpio_write(GPIO_BASE, 15, 0); } ############################################################################ Commit: fd52e77cda54c50cb4403e27de29ec1416ce264c URL: http://cgit.haiku-os.org/haiku/commit/?id=fd52e77 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Mon May 14 18:58:00 2012 UTC PL011 uart: Disable "fluff" code * Once I can confirm it works will re-enable * Not needed for basic functionality ---------------------------------------------------------------------------- diff --git a/src/system/kernel/arch/arm/uart_pl011.cpp b/src/system/kernel/arch/arm/uart_pl011.cpp index 88baed3..b46a4df 100644 --- a/src/system/kernel/arch/arm/uart_pl011.cpp +++ b/src/system/kernel/arch/arm/uart_pl011.cpp @@ -19,6 +19,8 @@ UartPL011::UartPL011(addr_t base) fUARTEnabled(true), fUARTBase(base) { + // TODO: Nice, but not required + #if 0 // ** Loopback test uint32 cr = PL01x_CR_UARTEN; // Enable UART @@ -51,6 +53,7 @@ UartPL011::UartPL011(addr_t base) // Set Rx timeout interrupt mask and Rx interrput mask WriteUart(PL011_IMSC, PL011_RTIM | PL011_RXIM); + #endif } ############################################################################ Revision: hrev44155 Commit: a5a89915fcf5d931f934cc6cbe125aaaf13288ef URL: http://cgit.haiku-os.org/haiku/commit/?id=a5a8991 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Mon May 14 19:07:08 2012 UTC PL011 uart: rename UART -> uart * Left over var name from my test code * This should be pretty close to functional (if not already working) * Any more uart experimentation will not reach upstream until working. ---------------------------------------------------------------------------- diff --git a/src/system/kernel/arch/arm/uart_pl011.cpp b/src/system/kernel/arch/arm/uart_pl011.cpp index b46a4df..3bcab84 100644 --- a/src/system/kernel/arch/arm/uart_pl011.cpp +++ b/src/system/kernel/arch/arm/uart_pl011.cpp @@ -82,8 +82,8 @@ UartPL011::InitPort(uint32 baud) // Calculate baud divisor uint32 baudDivisor = BOARD_UART_CLOCK / (16 * baud); uint32 remainder = BOARD_UART_CLOCK % (16 * baud); - uint32 baudFractional = ((8 * remainder) / BAUD >> 1) - + ((8 * remainder) / BAUD & 1); + uint32 baudFractional = ((8 * remainder) / baud >> 1) + + ((8 * remainder) / baud & 1); // Disable UART Disable();