mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-20 16:10:29 +00:00
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/stdint.h>
|
#include <base/stdint.h>
|
||||||
|
#include <cpu/memory_barrier.h>
|
||||||
|
|
||||||
namespace Genode { class X86_uart; }
|
namespace Genode { class X86_uart; }
|
||||||
|
|
||||||
@ -87,7 +88,7 @@ class Genode::X86_uart
|
|||||||
DLHI = (uint16_t)(_port + 1);
|
DLHI = (uint16_t)(_port + 1);
|
||||||
|
|
||||||
_outb(LCR, 0x80); /* select bank 1 */
|
_outb(LCR, 0x80); /* select bank 1 */
|
||||||
for (volatile int i = 10000000; i--; );
|
for (int i = 10000000; i; --i) memory_barrier();
|
||||||
_outb(DLLO, (uint8_t)((115200/_baud_rate) >> 0));
|
_outb(DLLO, (uint8_t)((115200/_baud_rate) >> 0));
|
||||||
_outb(DLHI, (uint8_t)((115200/_baud_rate) >> 8));
|
_outb(DLHI, (uint8_t)((115200/_baud_rate) >> 8));
|
||||||
_outb(LCR, 0x03); /* set 8,N,1 */
|
_outb(LCR, 0x03); /* set 8,N,1 */
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/env.h>
|
#include <base/env.h>
|
||||||
#include <io_port_session/connection.h>
|
#include <io_port_session/connection.h>
|
||||||
|
#include <cpu/memory_barrier.h>
|
||||||
|
|
||||||
enum { UARTS_NUM = 4 }; /* needed by base class definitions */
|
enum { UARTS_NUM = 4 }; /* needed by base class definitions */
|
||||||
|
|
||||||
@ -87,7 +88,7 @@ class Uart::Driver : public Uart::Driver_base
|
|||||||
void _init_comport(size_t baud)
|
void _init_comport(size_t baud)
|
||||||
{
|
{
|
||||||
_outb<LCR>(0x80u); /* select bank 1 */
|
_outb<LCR>(0x80u); /* select bank 1 */
|
||||||
for (volatile int i = 10000000; i--; );
|
for (int i = 10000000; i; i--) memory_barrier();
|
||||||
_outb<DLLO>(((115200/baud) >> 0) && 0xff);
|
_outb<DLLO>(((115200/baud) >> 0) && 0xff);
|
||||||
_outb<DLHI>(((115200/baud) >> 8) && 0xff);
|
_outb<DLHI>(((115200/baud) >> 8) && 0xff);
|
||||||
_outb<LCR>(0x03u); /* set 8,N,1 */
|
_outb<LCR>(0x03u); /* set 8,N,1 */
|
||||||
|
Reference in New Issue
Block a user