Skip to content

Commit

Permalink
misc bflb fixes and changes
Browse files Browse the repository at this point in the history
rx thresold 1 -> 0

on-chip and off-chip ram fused in node

set i2c config to more sensible values

set bl60x speed to 192M instead of 160M

Signed-off-by: Camille BAUD <mail@massdriver.space>
  • Loading branch information
VynDragon committed Jul 14, 2024
1 parent a1bd67f commit 6e64143
Showing 7 changed files with 9 additions and 25 deletions.
3 changes: 3 additions & 0 deletions boards/bouffalolab/bl6/ai_wb2_12f/ai_wb2_12f.yaml
Original file line number Diff line number Diff line change
@@ -14,4 +14,7 @@ testing:
- bluetooth
supported:
- uart
- i2c
- spi
- gpio
vendor: bouffalolab
4 changes: 2 additions & 2 deletions drivers/i2c/i2c_bflb.c
Original file line number Diff line number Diff line change
@@ -25,13 +25,13 @@ LOG_MODULE_REGISTER(i2c_bflb);

/* defines */

#define I2C_WAIT_TIMEOUT_MS 10000
#define I2C_WAIT_TIMEOUT_MS 100
#define I2C_MAX_PACKET_LENGTH 0xFF

/* dependant on frequency, if you run at low frequencies, reduce this for more
* performance, if you are having issues sporadically (like addresswrite and then no data), increase
* it */
#define I2C_DUMMY_WAIT __asm__ volatile (".rept 160 ; nop ; .endr");
#define I2C_DUMMY_WAIT __asm__ volatile (".rept 200 ; nop ; .endr");

/* Structure declarations */

2 changes: 1 addition & 1 deletion drivers/serial/uart_bflb.c
Original file line number Diff line number Diff line change
@@ -730,7 +730,7 @@ static const struct uart_driver_api uart_bflb_driver_api = {
.flow_ctrl = UART_FLOWCTRL_NONE, \
/* overflow interupt thresold, size is 32 bytes*/ \
.tx_fifo_threshold = 8, \
.rx_fifo_threshold = 1, \
.rx_fifo_threshold = 0, \
BFLB_UART_IRQ_HANDLER_FUNC(instance) \
}; \
DEVICE_DT_INST_DEFINE(instance, &uart_bflb_init, \
5 changes: 1 addition & 4 deletions dts/riscv/bouffalolab/bl6.dtsi
Original file line number Diff line number Diff line change
@@ -53,10 +53,7 @@

sram0: memory@42020000 {
compatible = "mmio-sram";
};
sram1: memory@42030000 {
compatible = "mmio-sram";
reg = <0x42030000 DT_SIZE_K(112)>;
reg = <0x42020000 DT_SIZE_K(176)>;
};

clint: clint@2000000 {
8 changes: 0 additions & 8 deletions dts/riscv/bouffalolab/bl602.dtsi
Original file line number Diff line number Diff line change
@@ -5,11 +5,3 @@
*/

#include <bouffalolab/bl6.dtsi>

/ {
soc {
sram0: memory@42020000 {
reg = <0x42020000 DT_SIZE_K(64)>;
};
};
};
8 changes: 0 additions & 8 deletions dts/riscv/bouffalolab/bl604e.dtsi
Original file line number Diff line number Diff line change
@@ -5,11 +5,3 @@
*/

#include <bouffalolab/bl6.dtsi>

/ {
soc {
sram0: memory@42020000 {
reg = <0x42020000 DT_SIZE_K(64)>;
};
};
};
4 changes: 2 additions & 2 deletions soc/bouffalolab/bflb/bl6/soc.c
Original file line number Diff line number Diff line change
@@ -775,8 +775,8 @@ static void system_clock_init(void)
system_set_root_clock_dividers(0, 0);
system_clock_trim_32M();
#else
system_init_root_clock(5, 3);
system_set_root_clock_dividers(0, 1);
system_init_root_clock(5, 4);
system_set_root_clock_dividers(0, 2);
#endif
system_set_machine_timer_clock(1, 0, mtimer_get_clk_src_div());
}

0 comments on commit 6e64143

Please sign in to comment.