Skip to content

Commit b430423

Browse files
Vikash jhaVikash jha
Vikash jha
authored and
Vikash jha
committed
First commit for making lesson1 compatible with rpi4
1 parent f8c49a8 commit b430423

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _P_BASE_H
22
#define _P_BASE_H
33

4-
#define PBASE 0x3F000000
4+
/* New raspberry pi-4 base address */
5+
#define PBASE 0xFE000000
56

67
#endif /*_P_BASE_H */

src/lesson01/src/config.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
kernel_old=1
2-
disable_commandline_tags=1
1+
# raspberry pi-4 lesson1
2+
arm_64bit=1

src/lesson01/src/mini_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void uart_init ( void )
4949
put32(AUX_MU_IER_REG,0); //Disable receive and transmit interrupts
5050
put32(AUX_MU_LCR_REG,3); //Enable 8 bit mode
5151
put32(AUX_MU_MCR_REG,0); //Set RTS line to be always high
52-
put32(AUX_MU_BAUD_REG,270); //Set baud rate to 115200
52+
put32(AUX_MU_BAUD_REG,541); //Set baud on raspberry pi-4 rate to 115200 (GPU clock rate is now 500Mhz)
5353

5454
put32(AUX_MU_CNTL_REG,3); //Finally, enable transmitter and receiver
5555
}

0 commit comments

Comments
 (0)