Skip to content

Commit

Permalink
Try to fix lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvan Tortorella committed Dec 13, 2023
1 parent ad8513e commit c8cd65a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
22 changes: 11 additions & 11 deletions sw/include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,30 @@ static inline void *gprw(void *gp) {

// Read hart ID
static inline unsigned int hart_id() {
int hart_id;
asm volatile("csrr %0, mhartid" : "=r" (hart_id) : );
return hart_id;
int hart_id;
asm volatile("csrr %0, mhartid" : "=r"(hart_id) :);
return hart_id;
}

// Disable data caches
static inline void disable_dcache(){
asm volatile("csrrwi x0, 0x701, 0x0 \n\t" : : : "memory");
static inline void disable_dcache() {
asm volatile("csrrwi x0, 0x701, 0x0 \n\t" : : : "memory");
}

// Enable data caches
static inline void enable_dcache(){
asm volatile("csrrwi x0, 0x701, 0x1 \n\t" : : : "memory");
static inline void enable_dcache() {
asm volatile("csrrwi x0, 0x701, 0x1 \n\t" : : : "memory");
}

// The following is for future DMR support
// Wake up sleeping hart using CLINT
// static inline void wakeup_hart(unsigned int hart_id) {
// *reg32(&__base_clint, 0x4*hart_id) = 0x1;
// *reg32(&__base_clint, 0x4*hart_id) = 0x0;
// *reg32(&__base_clint, 0x4*hart_id) = 0x1;
// *reg32(&__base_clint, 0x4*hart_id) = 0x0;
// }

// Write synchronization request in dedicated register
// static inline void sync_req(unsigned int hart_id){
// uint32_t sync_reg = *reg32(&__base_regs, CHESHIRE_HARTS_SYNC_REG_OFFSET);
// *reg32(&__base_regs, CHESHIRE_HARTS_SYNC_REG_OFFSET) = sync_reg | (0x1 << hart_id);
// uint32_t sync_reg = *reg32(&__base_regs, CHESHIRE_HARTS_SYNC_REG_OFFSET);
// *reg32(&__base_regs, CHESHIRE_HARTS_SYNC_REG_OFFSET) = sync_reg | (0x1 << hart_id);
// }
14 changes: 7 additions & 7 deletions sw/lib/cheshire_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "cheshire_io.h"

void cheshire_init_io() {
// Initialize UART first
uart_open();
// Initialize other IOs
// .
// .
// .
// Initialize UART first
uart_open();

// Initialize other IOs
// .
// .
// .
};
2 changes: 1 addition & 1 deletion sw/lib/dif/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void uart_read_str(void *uart_base, void *dst, uint64_t len) {
}

// Default UART provides console
void uart_open(){
void uart_open() {
uint32_t rtc_freq = *reg32(&__base_regs, CHESHIRE_RTC_FREQ_REG_OFFSET);
uint64_t reset_freq = clint_get_core_freq(rtc_freq, 2500);
uart_init(&__base_uart, reset_freq, 115200);
Expand Down
4 changes: 2 additions & 2 deletions sw/lib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#include "init.h"

void soc_init() {
// IO initialization
cheshire_init_io();
// IO initialization
cheshire_init_io();
};

0 comments on commit c8cd65a

Please sign in to comment.