Skip to content

Commit

Permalink
rpipico: early init fix
Browse files Browse the repository at this point in the history
  • Loading branch information
veremenko-y committed Oct 16, 2024
1 parent 0d73fbc commit 1a957f4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/platform/platform-rpipico/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Partition SD card on your computer using MBR partition scheme then create 32MB p
If using Linux or MacOS you can then copy `filesystem.img` onto the SD card using `dd` command.

```
dd if=filesystem.img of=/dev/sdN bs=512 seek=2048
dd if=filesystem.img of=/dev/sdXn oflag=direct bs=8192
```

The first thing you probably want to do is `stty erase '^?'` to make the DELETE
Expand Down
1 change: 1 addition & 0 deletions Kernel/platform/platform-rpipico/devtty.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static void devtty_defconfig(uint8_t drv, int count, int minor)
/* To be called right after startup to be able to print boot messages */
void devtty_early_init(void)
{
rawuart_early_init();
core1_init();
devtty_init();
}
Expand Down
6 changes: 6 additions & 0 deletions Kernel/platform/platform-rpipico/rawuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ static void rawuart_deinit(uart_inst_t * uart){
uart_deinit(uart);
}

void rawuart_early_init()
{
// init first uart for kprint
rawuart_init(0);
}

void rawuart_putc(uint8_t devn, uint8_t c)
{
uart_inst_t *uart = uart_get_instance(devn - 1);
Expand Down
1 change: 1 addition & 0 deletions Kernel/platform/platform-rpipico/rawuart.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <tty.h>

extern void rawuart_early_init();
extern void rawuart_putc(uint8_t devn, uint8_t c);
extern ttyready_t rawuart_ready(uint8_t devn);
extern void rawuart_sleeping(uint8_t devn);
Expand Down

0 comments on commit 1a957f4

Please sign in to comment.