clean up
This commit is contained in:
@@ -30,10 +30,9 @@
|
|||||||
#include "broadcom/interrupts.h"
|
#include "broadcom/interrupts.h"
|
||||||
#include "broadcom/io.h"
|
#include "broadcom/io.h"
|
||||||
#include "broadcom/mmu.h"
|
#include "broadcom/mmu.h"
|
||||||
|
//#include "broadcom/caches.h"
|
||||||
#include "broadcom/vcmailbox.h"
|
#include "broadcom/vcmailbox.h"
|
||||||
|
|
||||||
uint32_t SystemCoreClock = 700 * 1000 * 1000;
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
@@ -49,11 +48,6 @@ void USB_IRQHandler(void)
|
|||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Board porting API
|
// Board porting API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
void print(const char* str) {
|
|
||||||
board_uart_write(str, strlen(str));
|
|
||||||
}
|
|
||||||
|
|
||||||
void board_init(void)
|
void board_init(void)
|
||||||
{
|
{
|
||||||
gpio_initOutputPinWithPullNone(18);
|
gpio_initOutputPinWithPullNone(18);
|
||||||
@@ -63,13 +57,14 @@ void board_init(void)
|
|||||||
gpio_setPinOutputBool(18, true);
|
gpio_setPinOutputBool(18, true);
|
||||||
gpio_initOutputPinWithPullNone(42);
|
gpio_initOutputPinWithPullNone(42);
|
||||||
setup_mmu_flat_map();
|
setup_mmu_flat_map();
|
||||||
|
// init_caches();
|
||||||
|
|
||||||
// gpio_initOutputPinWithPullNone(23);
|
// gpio_initOutputPinWithPullNone(23);
|
||||||
// gpio_initOutputPinWithPullNone(24);
|
// gpio_initOutputPinWithPullNone(24);
|
||||||
// gpio_initOutputPinWithPullNone(25);
|
// gpio_initOutputPinWithPullNone(25);
|
||||||
gpio_setPinOutputBool(18, false);
|
gpio_setPinOutputBool(18, false);
|
||||||
uart_init();
|
uart_init();
|
||||||
gpio_setPinOutputBool(18, true);
|
gpio_setPinOutputBool(18, true);
|
||||||
const char* greeting = "hello to gdb2\r\n";
|
|
||||||
gpio_setPinOutputBool(18, false);
|
gpio_setPinOutputBool(18, false);
|
||||||
for (size_t i = 0; i < 5; i++) {
|
for (size_t i = 0; i < 5; i++) {
|
||||||
// while (true) {
|
// while (true) {
|
||||||
@@ -92,7 +87,6 @@ void board_init(void)
|
|||||||
}
|
}
|
||||||
// uart_writeText("hello from io\n");
|
// uart_writeText("hello from io\n");
|
||||||
// gpio_setPinOutputBool(24, true);
|
// gpio_setPinOutputBool(24, true);
|
||||||
board_uart_write(greeting, strlen(greeting));
|
|
||||||
// gpio_setPinOutputBool(24, false);
|
// gpio_setPinOutputBool(24, false);
|
||||||
// gpio_setPinOutputBool(25, true);
|
// gpio_setPinOutputBool(25, true);
|
||||||
// print();
|
// print();
|
||||||
@@ -110,13 +104,8 @@ void board_init(void)
|
|||||||
// }
|
// }
|
||||||
// while (1) uart_update();
|
// while (1) uart_update();
|
||||||
|
|
||||||
printf("hello %d\r\n", 21);
|
|
||||||
|
|
||||||
// Turn on USB peripheral.
|
// Turn on USB peripheral.
|
||||||
print("Turning on USB power\r\n");
|
|
||||||
|
|
||||||
vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
|
vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
|
||||||
print("USB power on\r\n");
|
|
||||||
|
|
||||||
BP_SetPriority(USB_IRQn, 0x00);
|
BP_SetPriority(USB_IRQn, 0x00);
|
||||||
BP_ClearPendingIRQ(USB_IRQn);
|
BP_ClearPendingIRQ(USB_IRQn);
|
||||||
|
@@ -6,6 +6,7 @@ include $(TOP)/$(BOARD_PATH)/board.mk
|
|||||||
CC = clang
|
CC = clang
|
||||||
|
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
|
-mcpu=cortex-a72 \
|
||||||
-Wall \
|
-Wall \
|
||||||
-O0 \
|
-O0 \
|
||||||
-ffreestanding \
|
-ffreestanding \
|
||||||
@@ -26,6 +27,8 @@ SRC_C += \
|
|||||||
$(MCU_DIR)/broadcom/mmu.c \
|
$(MCU_DIR)/broadcom/mmu.c \
|
||||||
$(MCU_DIR)/broadcom/vcmailbox.c
|
$(MCU_DIR)/broadcom/vcmailbox.c
|
||||||
|
|
||||||
|
# $(MCU_DIR)/broadcom/caches.c \
|
||||||
|
|
||||||
CROSS_COMPILE = aarch64-none-elf-
|
CROSS_COMPILE = aarch64-none-elf-
|
||||||
|
|
||||||
SKIP_NANOLIB = 1
|
SKIP_NANOLIB = 1
|
||||||
|
@@ -32,11 +32,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "broadcom/interrupts.h"
|
#include "broadcom/interrupts.h"
|
||||||
|
//#include "broadcom/caches.h"
|
||||||
|
|
||||||
#define DWC2_REG_BASE 0xFE980000UL
|
#define DWC2_REG_BASE 0xFE980000UL
|
||||||
#define DWC2_EP_MAX 8
|
#define DWC2_EP_MAX 8
|
||||||
#define DWC2_EP_FIFO_SIZE 4096
|
#define DWC2_EP_FIFO_SIZE 4096
|
||||||
|
|
||||||
|
//#define dcache_clean(_addr, _size) data_clean(_addr, _size)
|
||||||
|
//#define dcache_invalidate(_addr, _size) data_invalidate(_addr, _size)
|
||||||
|
//#define dcache_clean_invalidate(_addr, _size) data_clean_and_invalidate(_addr, _size)
|
||||||
|
|
||||||
TU_ATTR_ALWAYS_INLINE
|
TU_ATTR_ALWAYS_INLINE
|
||||||
static inline void dwc2_dcd_int_enable(uint8_t rhport)
|
static inline void dwc2_dcd_int_enable(uint8_t rhport)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user