From e3941109af1d8203dddc2aa12e33170d6dca5c4b Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Thu, 18 Jun 2020 11:06:33 +1000 Subject: [PATCH] console: Cleanup console API Use a more generic console_init() instead of potato_uart_init(), and do the same for interrupt control. There should be no change in behaviour. Signed-off-by: Benjamin Herrenschmidt --- hello_world/hello_world.bin | Bin 4688 -> 4744 bytes hello_world/hello_world.c | 2 +- hello_world/hello_world.elf | Bin 79584 -> 80528 bytes hello_world/hello_world.hex | 105 +++++++++++++++-------------- include/console.h | 5 +- include/microwatt_soc.h | 2 + lib/console.c | 20 +++++- litedram/gen-src/sdram_init/main.c | 2 +- rust_lib_demo/hello_world.c | 2 +- tests/decrementer/decrementer.c | 2 +- tests/illegal/illegal.c | 2 +- tests/misc/misc.c | 2 +- tests/mmu/mmu.c | 2 +- tests/privileged/privileged.c | 2 +- tests/sc/sc.c | 2 +- tests/xics/xics.c | 12 ++-- 16 files changed, 93 insertions(+), 69 deletions(-) diff --git a/hello_world/hello_world.bin b/hello_world/hello_world.bin index ae4c4a8311b39e5cdef455ff1672da7b2cac9c4b..dda2b66b7468d5072bdb2f304390b821f4622ccb 100755 GIT binary patch delta 250 zcmcbh(xJLRLBL6Xf$_(~|B62}nHW467#I@%|4*{1C`z{IWrXm5GC*iMw&V~~sMwqT z|Gj}~L4dJ=VRDs#IWwDP<>UUw~nrg8_r01<()+ zfq(zKxftea^8m$of&50G^%cJ#*H;4R3zJ!etS8?Q;9!vfs+xR3Ktv$}$N*Xn2Og<8 PIr$3V`9(P?Tp&RJ+>T91 delta 210 zcmeBBy`Zu|K_KeK|A)W-|9@ofQ1stgfPwMH#s7*w0vQ-Q7#J85Dtu)t_>ZbIIB&pqedbAR{aT|Om`9=QACj@F8kqq>!;b$F5y+wl6$ zo{oe1h#FQ7zSpaDMz_i6RD4(ylRe())xr^$dV2T0RZ4|ebQQS`=PEQsMFw2&uGGRFrJhWDtLe$J$kSaNPbMz9Pn_#-SU3VEKNpO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7vnwc%0uN86v zxyi{ws&;nC^x1SFhp91Cm75y(X?pnJ!9C%7PfwJx#ge-d2ktAW-q5Fph9iSJ`&}sx zFjZRcy@Xl2^f**OPZcZdLKAetNEF&p+!Z`^#ul6}}E|=Ule0_G`J% zvwt3eynVc~?lJVad<38N@yfc7Dk-U#4*1QF@b9{7N>bTZ_8aHHWey*<_m+zgw2xQz zxj82;DS2f-n>b%k^2)w7*ERnE)IMIhF2>R4@(MofRN0^9>$K{QjEBa`iC%q_siEG3;Rr7jr)KkmW4KLJb%yxvq;A{#E;W(M6>%gN^R)-CIp)W33(OZu-I%I}(g(S@ zrPZkTUZ?MI6e*maDaI#I7xQjCZCZRkgM4x}PmyA3t_TwhRho^c!CcX@xOK$tEv3GK z?^LeFWUB2ngmMo_m9tQH=SV)sw|tchCqEP!rpQF05UEbd1)fYzl%{ZtpUhFjZO11j z@~N|?m&qkeGoFuUr&7qtwX5yni790?DxXAdW(G@RWRv;$OiJyN|NmDnLh$a!>uyhR z_q_M-UhkFA2d^6ckPf4NaP^)z?hgo+p+4a8H}{QB?QgCtwm)IZ|*}s(EjH7HDSE|PkQ{#{i>zSCAFIWC6B+k@9)$8=A2k*{1-g_=Kgm{`^Su< zuD$tRhP-?Qgb|R+rz( zxY3FJ0g3=V?(c1Agz-Tc)&8ujF5doiC{3(tJLCUjf3 -void potato_uart_init(void); -void potato_uart_irq_en(void); -void potato_uart_irq_dis(void); +void console_init(void); +void console_set_irq_en(bool rx_irq, bool tx_irq); int getchar(void); int putchar(int c); int puts(const char *str); diff --git a/include/microwatt_soc.h b/include/microwatt_soc.h index 77d5a58..8b69889 100644 --- a/include/microwatt_soc.h +++ b/include/microwatt_soc.h @@ -69,6 +69,8 @@ #define POTATO_CONSOLE_STATUS_TX_FULL 0x08 #define POTATO_CONSOLE_CLOCK_DIV 0x18 #define POTATO_CONSOLE_IRQ_EN 0x20 +#define POTATO_CONSOLE_IRQ_RX 0x01 +#define POTATO_CONSOLE_IRQ_TX 0x02 /* * Register definitionss for our standard (16550 style) UART diff --git a/lib/console.c b/lib/console.c index bce220e..892c76f 100644 --- a/lib/console.c +++ b/lib/console.c @@ -80,9 +80,15 @@ void potato_uart_init(void) potato_uart_reg_write(POTATO_CONSOLE_CLOCK_DIV, potato_uart_divisor(proc_freq, UART_FREQ)); } -void potato_uart_irq_en(void) +void potato_uart_set_irq_en(bool rx_irq, bool tx_irq) { - potato_uart_reg_write(POTATO_CONSOLE_IRQ_EN, 0xff); + uint64_t en = 0; + + if (rx_irq) + en |= POTATO_CONSOLE_IRQ_RX; + if (tx_irq) + en |= POTATO_CONSOLE_IRQ_TX; + potato_uart_reg_write(POTATO_CONSOLE_IRQ_EN, en); } void potato_uart_irq_dis(void) @@ -131,3 +137,13 @@ size_t strlen(const char *s) return len; } #endif + +void console_init(void) +{ + potato_uart_init(); +} + +void console_set_irq_en(bool rx_irq, bool tx_irq) +{ + potato_uart_set_irq_en(rx_irq, tx_irq); +} diff --git a/litedram/gen-src/sdram_init/main.c b/litedram/gen-src/sdram_init/main.c index dd3b507..19cc2ad 100644 --- a/litedram/gen-src/sdram_init/main.c +++ b/litedram/gen-src/sdram_init/main.c @@ -241,7 +241,7 @@ uint64_t main(void) bool try_flash = false; /* Init the UART */ - potato_uart_init(); + console_init(); printf("\n\nWelcome to Microwatt !\n\n"); diff --git a/rust_lib_demo/hello_world.c b/rust_lib_demo/hello_world.c index c8797fd..6c44be9 100644 --- a/rust_lib_demo/hello_world.c +++ b/rust_lib_demo/hello_world.c @@ -25,7 +25,7 @@ void init_bss() int main(void) { init_bss(); - potato_uart_init(); + console_init(); puts(HELLO_WORLD); diff --git a/tests/decrementer/decrementer.c b/tests/decrementer/decrementer.c index e6cff2c..7b1c345 100644 --- a/tests/decrementer/decrementer.c +++ b/tests/decrementer/decrementer.c @@ -25,7 +25,7 @@ int main(void) { int fail = 0; - potato_uart_init(); + console_init(); print_test_number(1); if (dec_test_1() != 0) { diff --git a/tests/illegal/illegal.c b/tests/illegal/illegal.c index af0c04b..fbd9634 100644 --- a/tests/illegal/illegal.c +++ b/tests/illegal/illegal.c @@ -23,7 +23,7 @@ int main(void) { int fail = 0; - potato_uart_init(); + console_init(); print_test_number(1); if (ill_test_1() != 0) { diff --git a/tests/misc/misc.c b/tests/misc/misc.c index 0b9079c..f96203e 100644 --- a/tests/misc/misc.c +++ b/tests/misc/misc.c @@ -24,7 +24,7 @@ int main(void) { int fail = 0; - potato_uart_init(); + console_init(); print_test_number(1); if (test_addpcis_1() != 0) { diff --git a/tests/mmu/mmu.c b/tests/mmu/mmu.c index a5d086b..b91a852 100644 --- a/tests/mmu/mmu.c +++ b/tests/mmu/mmu.c @@ -661,7 +661,7 @@ void do_test(int num, int (*test)(void)) int main(void) { - potato_uart_init(); + console_init(); init_mmu(); do_test(1, mmu_test_1); diff --git a/tests/privileged/privileged.c b/tests/privileged/privileged.c index 98c037c..154e9b4 100644 --- a/tests/privileged/privileged.c +++ b/tests/privileged/privileged.c @@ -228,7 +228,7 @@ void do_test(int num, int (*fn)(unsigned long)) int main(void) { - potato_uart_init(); + console_init(); init_mmu(); map(0x2000, 0x2000, REF | CHG | PERM_RD | PERM_EX); /* map code page */ map(0x7000, 0x7000, REF | CHG | PERM_RD | PERM_WR); /* map stack page */ diff --git a/tests/sc/sc.c b/tests/sc/sc.c index a705d19..94e17fa 100644 --- a/tests/sc/sc.c +++ b/tests/sc/sc.c @@ -23,7 +23,7 @@ int main(void) { int fail = 0; - potato_uart_init(); + console_init(); print_test_number(1); if (sc_test_1() != 0) { diff --git a/tests/xics/xics.c b/tests/xics/xics.c index a867744..97b6539 100644 --- a/tests/xics/xics.c +++ b/tests/xics/xics.c @@ -83,7 +83,7 @@ void ipi_isr(void) { void uart_isr(void) { debug_puts(UART); - potato_uart_irq_dis(); // disable interrupt to ack it + console_set_irq_en(false, false); isrs_run |= ISR_UART; } @@ -202,7 +202,7 @@ int xics_test_1(void) icp_write8(XICS_XIRR, 0x00); // mask all interrupts // trigger two interrupts - potato_uart_irq_en(); // cause serial interrupt + console_set_irq_en(true,true);// cause serial interrupt ics_write_xive(0x6, 0); // set source to prio 6 icp_write8(XICS_MFRR, 0x04); // cause ipi interrupt at prio 5 @@ -222,7 +222,7 @@ int xics_test_1(void) // cleanup icp_write8(XICS_XIRR, 0x00); // mask all interrupts - potato_uart_irq_dis(); + console_set_irq_en(false, false); ics_write_xive(0, 0xff); isrs_run = 0; @@ -242,7 +242,7 @@ int xics_test_2(void) assert(isrs_run == 0); // trigger both - potato_uart_irq_en(); // cause 0x500 interrupt + console_set_irq_en(true, true); icp_write8(XICS_MFRR, 0x05); // cause 0x500 interrupt delay(); @@ -250,7 +250,7 @@ int xics_test_2(void) // cleanup icp_write8(XICS_XIRR, 0x00); // mask all interrupts - potato_uart_irq_dis(); + console_set_irq_en(false, false); isrs_run = 0; return 0; @@ -307,7 +307,7 @@ int main(void) int i = 0; int (*t)(void); - potato_uart_init(); + console_init(); ipi_running = false; /* run the tests */ -- 2.30.2