From 4b302ccef8505a31800dcf7d3f432da1618382da Mon Sep 17 00:00:00 2001 From: eng33 Date: Thu, 17 Aug 2023 22:08:01 +0800 Subject: [PATCH] feat:luckfox_gpio_test support luckfox pico and luckfox pico plus --- media/luckfox/examples/luckfox_adc_test.c | 33 +- media/luckfox/examples/luckfox_gpio_test.c | 127 ++++++-- media/luckfox/examples/luckfox_i2c_test.c | 3 +- media/luckfox/examples/luckfox_pwm_test.c | 36 +-- media/luckfox/examples/luckfox_spi_test.c | 22 +- media/luckfox/examples/luckfox_uart_test.c | 3 +- media/luckfox/include/luckfox_gpio.h | 68 ++--- .../dts/rv1103-luckfox-pico-plus-ipc.dtsi | 66 ++-- .../boot/dts/rv1103g-luckfox-pico-plus.dts | 287 +++++++++--------- .../arm/boot/dts/rv1103g-luckfox-pico.dts | 39 +-- 10 files changed, 375 insertions(+), 309 deletions(-) diff --git a/media/luckfox/examples/luckfox_adc_test.c b/media/luckfox/examples/luckfox_adc_test.c index 5d9bc3f37..de8b9e80f 100755 --- a/media/luckfox/examples/luckfox_adc_test.c +++ b/media/luckfox/examples/luckfox_adc_test.c @@ -34,30 +34,29 @@ #include //exit() #include "luckfox_adc.h" - -void Delay_ms(uint32_t xms) { +void Delay_ms(uint32_t xms) +{ uint32_t i; - for (i = 0; i < xms; i++) { + for (i = 0; i < xms; i++) + { usleep(1000); } } - int main(int argc, char *argv[]) { - int adc_read_value[2]; - float adc_voltage[2]; - while (1) + int adc_read_value[2]; + float adc_voltage[2]; + while (1) + { + printf("***********ADC READ TEST***********\r\n"); + for (int cnt = 0; cnt < 2; cnt++) { - printf("***********ADC READ TEST***********\r\n"); - for (int cnt = 0; cnt < 2; cnt++) - { - adc_read_value[cnt] = luckfox_adc_get_value(luckfox_adc_get_devnum("ff3c0000.saradc"), cnt); - adc_voltage[cnt]= adc_read_value[cnt]*1.8/1024; - printf("ADC %d:raw data = %d,voltage = %.2f \r\n",cnt,adc_read_value[cnt],adc_voltage[cnt]); - } - Delay_ms(1000); + adc_read_value[cnt] = luckfox_adc_get_value(luckfox_adc_get_devnum("ff3c0000.saradc"), cnt); + adc_voltage[cnt] = adc_read_value[cnt] * 1.8 / 1024; + printf("ADC %d:raw data = %d,voltage = %.2f \r\n", cnt, adc_read_value[cnt], adc_voltage[cnt]); } - return 0; + Delay_ms(1000); + } + return 0; } - diff --git a/media/luckfox/examples/luckfox_gpio_test.c b/media/luckfox/examples/luckfox_gpio_test.c index d67319078..57e809ab2 100755 --- a/media/luckfox/examples/luckfox_gpio_test.c +++ b/media/luckfox/examples/luckfox_gpio_test.c @@ -35,18 +35,37 @@ #include //exit() #include "luckfox_gpio.h" -#define GPIO_ALL_TEST 0 +int GPIO_BEGIN_PIN, GPIO_END_PIN; +int *TEST_PIN; -#if GPIO_ALL_TEST -#define GPIO_BEGIN_PIN (2) -#define GPIO_END_PIN (21) -#else -#define GPIO_BEGIN_PIN (16) -#define GPIO_END_PIN (21) -#endif - - -int GPIOS[] = { +int PICO_PLUS_GPIOS[] = { + LUCKFOX_PICO_PLUS_GPIO0, + LUCKFOX_PICO_PLUS_GPIO1, + LUCKFOX_PICO_PLUS_GPIO2, + LUCKFOX_PICO_PLUS_GPIO3, + LUCKFOX_PICO_PLUS_GPIO4, + LUCKFOX_PICO_PLUS_GPIO5, + LUCKFOX_PICO_PLUS_GPIO6, + LUCKFOX_PICO_PLUS_GPIO7, + LUCKFOX_PICO_PLUS_GPIO8, + LUCKFOX_PICO_PLUS_GPIO9, + LUCKFOX_PICO_PLUS_GPIO10, + LUCKFOX_PICO_PLUS_GPIO11, + LUCKFOX_PICO_PLUS_GPIO12, + LUCKFOX_PICO_PLUS_GPIO13, + LUCKFOX_PICO_PLUS_GPIO14, + LUCKFOX_PICO_PLUS_GPIO15, + LUCKFOX_PICO_PLUS_GPIO16, + LUCKFOX_PICO_PLUS_GPIO17, + LUCKFOX_PICO_PLUS_GPIO18, + LUCKFOX_PICO_PLUS_GPIO19, + LUCKFOX_PICO_PLUS_GPIO20, + LUCKFOX_PICO_PLUS_GPIO21, + LUCKFOX_PICO_PLUS_GPIO22, + LUCKFOX_PICO_PLUS_GPIO26, + LUCKFOX_PICO_PLUS_GPIO27, +}; +int PICO_GPIOS[] = { LUCKFOX_PICO_GPIO0, LUCKFOX_PICO_GPIO1, LUCKFOX_PICO_GPIO2, @@ -69,9 +88,6 @@ int GPIOS[] = { LUCKFOX_PICO_GPIO19, LUCKFOX_PICO_GPIO20, LUCKFOX_PICO_GPIO21, -#if LUCKFOX_PICO_PLUS - LUCKFOX_PICO_GPIO22, // -#endif LUCKFOX_PICO_GPIO26, LUCKFOX_PICO_GPIO27, @@ -92,20 +108,83 @@ void Handler(int signo) printf("\r\nHandler:exit\r\n"); for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++) { - luckfox_gpio_set_value(GPIOS[x], 0); - luckfox_gpio_unexport(GPIOS[x]); + luckfox_gpio_set_value(TEST_PIN[x], 0); + luckfox_gpio_unexport(TEST_PIN[x]); } exit(0); } int main(int argc, char *argv[]) { + char input_char = '0'; + int delay_time = 500; signal(SIGINT, Handler); + printf("-----------------------------\r\n"); + printf("----------GPIO TEST----------\r\n"); + printf("-----------------------------\r\n"); + printf("Please select your test borad\r\n"); + printf("* 1. LUCKFOX PICO\r\n"); + printf("* 2. LUCKFOX PICO PLUS\r\n"); + printf("-----------------------------\r\n"); + while (1) + { + printf("Which would you like? :"); + input_char = getchar(); + if (input_char >= '1' && input_char <= '2') + { + break; + } + } + + if (input_char == '1') + { + GPIO_BEGIN_PIN = 16; + GPIO_END_PIN = 21; + TEST_PIN = PICO_GPIOS; + } + else if (input_char == '2') + { + GPIO_BEGIN_PIN = 16; + GPIO_END_PIN = 22; + TEST_PIN = PICO_PLUS_GPIOS; + } + else + { + exit(0); + } + printf("-----------------------------\r\n"); + printf("Please select your test borad\r\n"); + printf("* 1. Default part(GP%d-GP%d)\r\n", GPIO_BEGIN_PIN, GPIO_END_PIN); + printf("* 2. ALL(Except GP0 GP1)\r\n"); + printf("-----------------------------\r\n"); + while (1) + { + printf("Which would you like? :"); + input_char = getchar(); + if (input_char >= '1' && input_char <= '2') + { + break; + } + } + + if (input_char == '1') + { + ; + } + else if (input_char == '2') + { + GPIO_BEGIN_PIN = 2; + delay_time = 250; + } + else + { + exit(0); + } for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++) { - luckfox_gpio_export_direction(GPIOS[x], GPIO_DIRECTION_OUTPUT); - luckfox_gpio_set_value(GPIOS[x], 0); + luckfox_gpio_export_direction(TEST_PIN[x], GPIO_DIRECTION_OUTPUT); + luckfox_gpio_set_value(TEST_PIN[x], 0); } while (1) { @@ -113,16 +192,16 @@ int main(int argc, char *argv[]) for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++) { - luckfox_gpio_set_value(GPIOS[x], 1); - printf("GPIO%d set \r\n",GPIOS[x]); - Delay_ms(1000); + luckfox_gpio_set_value(TEST_PIN[x], 1); + printf("GP%d : GPIO%d set \r\n", x, TEST_PIN[x]); + Delay_ms(delay_time); } for (int x = GPIO_BEGIN_PIN; x <= GPIO_END_PIN; x++) { - luckfox_gpio_set_value(GPIOS[x], 0); - printf("GPIO%d reset \r\n",GPIOS[x]); - Delay_ms(1000); + luckfox_gpio_set_value(TEST_PIN[x], 0); + printf("GP%d : GPIO%d reset \r\n", x, TEST_PIN[x]); + Delay_ms(delay_time); } } diff --git a/media/luckfox/examples/luckfox_i2c_test.c b/media/luckfox/examples/luckfox_i2c_test.c index e0752dad3..1f1f60f77 100755 --- a/media/luckfox/examples/luckfox_i2c_test.c +++ b/media/luckfox/examples/luckfox_i2c_test.c @@ -62,10 +62,9 @@ int main(int argc, char *argv[]) printf("i2cdetect addr : "); for (int x = 0; x < 0x7f; x++) { - if (luckfox_i2c_write(fd, x,0,0) == 0) + if (luckfox_i2c_write(fd, x, 0, 0) == 0) { printf("0x%x,", x); - } } printf("\r\n"); diff --git a/media/luckfox/examples/luckfox_pwm_test.c b/media/luckfox/examples/luckfox_pwm_test.c index 1cb928bf4..2ff4a3751 100755 --- a/media/luckfox/examples/luckfox_pwm_test.c +++ b/media/luckfox/examples/luckfox_pwm_test.c @@ -34,12 +34,13 @@ #include //signal() #include "luckfox_pwm.h" -int PWMS[] = { 0,1,10,11 }; +int PWMS[] = {0, 1, 10, 11}; - -void Delay_ms(uint32_t xms) { +void Delay_ms(uint32_t xms) +{ uint32_t i; - for (i = 0; i < xms; i++) { + for (i = 0; i < xms; i++) + { usleep(1000); } } @@ -50,8 +51,9 @@ void Handler(int signo) printf("\r\nHandler:exit\r\n"); for (int x = 0; x < 4; x++) { + luckfox_pwm_set_duty(PWMS[x], 0); luckfox_pwm_deinit(PWMS[x]); - printf("PWM%dM0 deinit\r\n",PWMS[x]); + printf("PWM%dM0 deinit\r\n", PWMS[x]); } exit(0); @@ -59,17 +61,17 @@ void Handler(int signo) int main(int argc, char *argv[]) { - signal(SIGINT, Handler); - for(int x = 0 ; x < 4;x++) - { - luckfox_pwm_init(PWMS[x], 100000, 5000*(x+1), PWM_POLARITY_INVERSED); - luckfox_pwm_set_enable(PWMS[x], true); - printf("PWM%dM0 period=%d duty=%d\r\n",PWMS[x],luckfox_pwm_get_period(PWMS[x]),luckfox_pwm_get_duty(PWMS[x])); - } - while(1) - { - Delay_ms(1000); - } + signal(SIGINT, Handler); + for (int x = 0; x < 4; x++) + { + luckfox_pwm_init(PWMS[x], 100000, 15000 * (x + 1), PWM_POLARITY_NORMAL); + luckfox_pwm_set_enable(PWMS[x], true); + printf("PWM%dM0 period=%d duty=%d\r\n", PWMS[x], luckfox_pwm_get_period(PWMS[x]), luckfox_pwm_get_duty(PWMS[x])); + } + while (1) + { + Delay_ms(1000); + } - return 0; + return 0; } diff --git a/media/luckfox/examples/luckfox_spi_test.c b/media/luckfox/examples/luckfox_spi_test.c index e0d563f70..3f1b44ffb 100755 --- a/media/luckfox/examples/luckfox_spi_test.c +++ b/media/luckfox/examples/luckfox_spi_test.c @@ -35,31 +35,31 @@ #include //signal() #include "luckfox_spi.h" -#define spidev0_path "/dev/spidev0.0" +#define spidev0_path "/dev/spidev0.0" /* SPI send and receive buffer */ static unsigned char tx_buffer[100] = "hello the world !"; static unsigned char rx_buffer[100]; -static int fd; // File descriptor for SPI control pins +static int fd; // File descriptor for SPI control pins -static uint32_t mode = SPI_MODE_2; // Used to save SPI mode -static uint8_t bits = 8; // Number of bits for receive and send data -static uint32_t speed = 500000; // Transfer speed +static uint32_t mode = SPI_MODE_2; // Used to save SPI mode +static uint8_t bits = 8; // Number of bits for receive and send data +static uint32_t speed = 500000; // Transfer speed -int main(int argc,char * argv[]) +int main(int argc, char *argv[]) { int ret; - uint16_t delay=10; - fd = luckfox_spi_init(spidev0_path,mode,bits,speed); - if( fd == -1 ) + uint16_t delay = 10; + fd = luckfox_spi_init(spidev0_path, mode, bits, speed); + if (fd == -1) { printf("spi_init error\n"); exit(-1); } - ret = luckfox_spi_transfer(fd, tx_buffer, rx_buffer, sizeof(tx_buffer),delay); - if (ret == -1 ) + ret = luckfox_spi_transfer(fd, tx_buffer, rx_buffer, sizeof(tx_buffer), delay); + if (ret == -1) { printf("transfer error...\n"); exit(-1); diff --git a/media/luckfox/examples/luckfox_uart_test.c b/media/luckfox/examples/luckfox_uart_test.c index a702ca286..e4dc7ffca 100755 --- a/media/luckfox/examples/luckfox_uart_test.c +++ b/media/luckfox/examples/luckfox_uart_test.c @@ -42,7 +42,6 @@ int uart_fd = 0; char w_data[] = "Waveshare Hello World"; char r_data[256]; - void Delay_ms(uint32_t xms) { uint32_t i; @@ -92,7 +91,7 @@ int main(int argc, char *argv[]) luckfox_uart_begin(dev); luckfox_uart_write(w_data, strlen(w_data)); Delay_ms(5); - // callback + // callback while (1) { diff --git a/media/luckfox/include/luckfox_gpio.h b/media/luckfox/include/luckfox_gpio.h index 3e70041ea..fac664910 100755 --- a/media/luckfox/include/luckfox_gpio.h +++ b/media/luckfox/include/luckfox_gpio.h @@ -75,44 +75,44 @@ #define PD7 31 #define GPIO(bank, pin) ((((bank) * 32) + (pin))) -#define LUCKFOX_PICO_PLUS 0 -#if LUCKFOX_PICO_PLUS -/**********************************************/ -#define LUCKFOX_PICO_GPIO0 GPIO(GPIO1,PB2) -#define LUCKFOX_PICO_GPIO1 GPIO(GPIO1,PB3) - -#define LUCKFOX_PICO_GPIO2 GPIO(GPIO1,PC7) -#define LUCKFOX_PICO_GPIO3 GPIO(GPIO1,PC6) -#define LUCKFOX_PICO_GPIO4 GPIO(GPIO1,PC5) -#define LUCKFOX_PICO_GPIO5 GPIO(GPIO1,PC4) - -#define LUCKFOX_PICO_GPIO6 GPIO(GPIO1,PD2) -#define LUCKFOX_PICO_GPIO7 GPIO(GPIO1,PD3) -#define LUCKFOX_PICO_GPIO8 GPIO(GPIO1,PA2) -#define LUCKFOX_PICO_GPIO9 GPIO(GPIO1,PC0) - -#define LUCKFOX_PICO_GPIO10 GPIO(GPIO1,PC1) -#define LUCKFOX_PICO_GPIO11 GPIO(GPIO1,PC2) -#define LUCKFOX_PICO_GPIO12 GPIO(GPIO1,PC3) -#define LUCKFOX_PICO_GPIO13 GPIO(GPIO0,PA4) - -#define LUCKFOX_PICO_GPIO14 GPIO(GPIO1,PD0) -#define LUCKFOX_PICO_GPIO15 GPIO(GPIO1,PD1) /**********************************************/ -#define LUCKFOX_PICO_GPIO27 GPIO(GPIO4,PC1) -#define LUCKFOX_PICO_GPIO26 GPIO(GPIO4,PC0) +#define LUCKFOX_PICO_PLUS_GPIO0 GPIO(GPIO1,PB2) +#define LUCKFOX_PICO_PLUS_GPIO1 GPIO(GPIO1,PB3) -#define LUCKFOX_PICO_GPIO22 GPIO(GPIO3,PA1) +#define LUCKFOX_PICO_PLUS_GPIO2 GPIO(GPIO1,PC7) +#define LUCKFOX_PICO_PLUS_GPIO3 GPIO(GPIO1,PC6) +#define LUCKFOX_PICO_PLUS_GPIO4 GPIO(GPIO1,PC5) +#define LUCKFOX_PICO_PLUS_GPIO5 GPIO(GPIO1,PC4) + +#define LUCKFOX_PICO_PLUS_GPIO6 GPIO(GPIO1,PD2) +#define LUCKFOX_PICO_PLUS_GPIO7 GPIO(GPIO1,PD3) +#define LUCKFOX_PICO_PLUS_GPIO8 GPIO(GPIO1,PA2) +#define LUCKFOX_PICO_PLUS_GPIO9 GPIO(GPIO1,PC0) + +#define LUCKFOX_PICO_PLUS_GPIO10 GPIO(GPIO1,PC1) +#define LUCKFOX_PICO_PLUS_GPIO11 GPIO(GPIO1,PC2) +#define LUCKFOX_PICO_PLUS_GPIO12 GPIO(GPIO1,PC3) +#define LUCKFOX_PICO_PLUS_GPIO13 GPIO(GPIO0,PA4) + +#define LUCKFOX_PICO_PLUS_GPIO14 GPIO(GPIO1,PD0) +#define LUCKFOX_PICO_PLUS_GPIO15 GPIO(GPIO1,PD1) + +/**********************************************/ +#define LUCKFOX_PICO_PLUS_GPIO27 GPIO(GPIO4,PC1) +#define LUCKFOX_PICO_PLUS_GPIO26 GPIO(GPIO4,PC0) + +#define LUCKFOX_PICO_PLUS_GPIO22 GPIO(GPIO3,PA1) + +#define LUCKFOX_PICO_PLUS_GPIO21 GPIO(GPIO3,PA3) +#define LUCKFOX_PICO_PLUS_GPIO20 GPIO(GPIO3,PA2) +#define LUCKFOX_PICO_PLUS_GPIO19 GPIO(GPIO3,PA4) +#define LUCKFOX_PICO_PLUS_GPIO18 GPIO(GPIO3,PA5) + +#define LUCKFOX_PICO_PLUS_GPIO17 GPIO(GPIO3,PA7) +#define LUCKFOX_PICO_PLUS_GPIO16 GPIO(GPIO3,PA6) -#define LUCKFOX_PICO_GPIO21 GPIO(GPIO3,PA3) -#define LUCKFOX_PICO_GPIO20 GPIO(GPIO3,PA2) -#define LUCKFOX_PICO_GPIO19 GPIO(GPIO3,PA4) -#define LUCKFOX_PICO_GPIO18 GPIO(GPIO3,PA5) -#define LUCKFOX_PICO_GPIO17 GPIO(GPIO3,PA7) -#define LUCKFOX_PICO_GPIO16 GPIO(GPIO3,PA6) -#else /**********************************************/ #define LUCKFOX_PICO_GPIO0 GPIO(GPIO1,PB2) #define LUCKFOX_PICO_GPIO1 GPIO(GPIO1,PB3) @@ -146,7 +146,7 @@ #define LUCKFOX_PICO_GPIO17 GPIO(GPIO4,PB0) #define LUCKFOX_PICO_GPIO16 GPIO(GPIO4,PB1) -#endif + enum gpio_direction { GPIO_DIRECTION_OUTPUT = 0, diff --git a/sysdrv/source/kernel/arch/arm/boot/dts/rv1103-luckfox-pico-plus-ipc.dtsi b/sysdrv/source/kernel/arch/arm/boot/dts/rv1103-luckfox-pico-plus-ipc.dtsi index 036ee9c44..fc4cf25f6 100644 --- a/sysdrv/source/kernel/arch/arm/boot/dts/rv1103-luckfox-pico-plus-ipc.dtsi +++ b/sysdrv/source/kernel/arch/arm/boot/dts/rv1103-luckfox-pico-plus-ipc.dtsi @@ -54,7 +54,7 @@ gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>; linux,default-trigger = "activity"; default-state = "on"; - }; + }; }; }; @@ -222,9 +222,9 @@ }; }; -&pwm0 { - status = "okay"; -}; +//&pwm0 { +// status = "okay"; +//}; &rkcif { status = "okay"; @@ -273,47 +273,33 @@ vref-supply = <&vcc_1v8>; }; -// &sfc { -// status = "okay"; +//&sfc { +// status = "okay"; -// flash@0 { -// compatible = "jedec,spi-nor"; -// reg = <0>; -// spi-max-frequency = <80000000>; -// spi-rx-bus-width = <4>; -// spi-tx-bus-width = <1>; -// }; -// }; +// flash@0 { +// compatible = "spi-nand"; +// reg = <0>; +// spi-max-frequency = <80000000>; +// spi-rx-bus-width = <4>; +// spi-tx-bus-width = <1>; +// }; +//}; -// &sdmmc { -// max-frequency = <50000000>; -// no-sdio; -// no-mmc; -// bus-width = <4>; -// cap-mmc-highspeed; -// cap-sd-highspeed; -// disable-wp; -// pinctrl-names = "default"; -// pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>; -// status = "okay"; -// }; +//&sdmmc { +// max-frequency = <50000000>; +// no-sdio; +// no-mmc; +// bus-width = <4>; +// cap-mmc-highspeed; +// cap-sd-highspeed; +// disable-wp; +// pinctrl-names = "default"; +// pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>; +// status = "okay"; +//}; &tsadc { status = "okay"; }; -// &u2phy { -// status = "disabled"; -// }; -// &u2phy_otg { -// status = "disabled"; -// }; - -// &usbdrd { -// status = "disabled"; -// }; - -// &usbdrd_dwc3 { -// status = "disabled"; -// }; diff --git a/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico-plus.dts b/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico-plus.dts index 7efd0f927..986d0d428 100644 --- a/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico-plus.dts +++ b/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico-plus.dts @@ -12,106 +12,106 @@ / { model = "Luckfox Pico Plus"; compatible = "rockchip,rv1103g-38x38-ipc-v10", "rockchip,rv1103"; -// gpio3pa1:gpio3pa1 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa1>; -// regulator-name = "gpio3_pa1"; -// regulator-always-on; -// }; + gpio3pa1:gpio3pa1 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa1>; + regulator-name = "gpio3_pa1"; + regulator-always-on; + }; -// gpio3pa2:gpio3pa2 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa2>; -// regulator-name = "gpio3_pa2"; -// regulator-always-on; -// }; + gpio3pa2:gpio3pa2 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa2>; + regulator-name = "gpio3_pa2"; + regulator-always-on; + }; -// gpio3pa3:gpio3pa3 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa3>; -// regulator-name = "gpio3_pa3"; -// regulator-always-on; -// }; + gpio3pa3:gpio3pa3 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa3>; + regulator-name = "gpio3_pa3"; + regulator-always-on; + }; -// gpio3pa4:gpio3pa4 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa4>; -// regulator-name = "gpio3_pa4"; -// regulator-always-on; -// }; + gpio3pa4:gpio3pa4 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa4>; + regulator-name = "gpio3_pa4"; + regulator-always-on; + }; -// gpio3pa5:gpio3pa5 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa5>; -// regulator-name = "gpio3_pa5"; -// regulator-always-on; -// }; + gpio3pa5:gpio3pa5 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa5>; + regulator-name = "gpio3_pa5"; + regulator-always-on; + }; -// gpio3pa6:gpio3pa6 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa6>; -// regulator-name = "gpio3_pa6"; -// regulator-always-on; -// }; + gpio3pa6:gpio3pa6 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa6>; + regulator-name = "gpio3_pa6"; + regulator-always-on; + }; -// gpio3pa7:gpio3pa7 { -// compatible = "regulator-fixed"; -// pinctrl-names = "default"; -// pinctrl-0 = <&gpio3_pa7>; -// regulator-name = "gpio3_pa7"; -// regulator-always-on; -// }; + gpio3pa7:gpio3pa7 { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&gpio3_pa7>; + regulator-name = "gpio3_pa7"; + regulator-always-on; + }; }; /**********GPIO**********/ -// &pinctrl { -// gpio3-pa1 { -// gpio3_pa1:gpio3-pa1 { -// rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; +&pinctrl { + gpio3-pa1 { + gpio3_pa1:gpio3-pa1 { + rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; -// gpio3-pa2 { -// gpio3_pa2:gpio3-pa2 { -// rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; + gpio3-pa2 { + gpio3_pa2:gpio3-pa2 { + rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; -// gpio3-pa3 { -// gpio3_pa3:gpio3-pa3 { -// rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; + gpio3-pa3 { + gpio3_pa3:gpio3-pa3 { + rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; -// gpio3-pa4 { -// gpio3_pa4:gpio3-pa4 { -// rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; + gpio3-pa4 { + gpio3_pa4:gpio3-pa4 { + rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; -// gpio3-pa5 { -// gpio3_pa5:gpio3-pa5 { -// rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; + gpio3-pa5 { + gpio3_pa5:gpio3-pa5 { + rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; -// gpio3-pa6 { -// gpio3_pa6:gpio3-pa6 { -// rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; + gpio3-pa6 { + gpio3_pa6:gpio3-pa6 { + rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; -// gpio3-pa7 { -// gpio3_pa7:gpio3-pa7 { -// rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>; -// }; -// }; -// }; + gpio3-pa7 { + gpio3_pa7:gpio3-pa7 { + rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; &sfc { status = "okay"; @@ -125,30 +125,27 @@ }; }; -&usbdrd_dwc3 { - dr_mode = "peripheral"; -}; - +/**********ETH**********/ &gmac { status = "okay"; }; /**********USB**********/ -// &usbdrd { +//&usbdrd { // status = "disabled"; -// }; +//}; -// &usbdrd_dwc3 { +//&usbdrd_dwc3 { // status = "disabled"; -// }; +//}; -// &u2phy { +//&u2phy { // status = "disabled"; -// }; +//}; -// &u2phy_otg { +//&u2phy_otg { // status = "disabled"; -// }; +//}; /**********I2C**********/ // &i2c0 { @@ -189,11 +186,11 @@ pinctrl-names = "default"; pinctrl-0 = <&uart4m1_xfer>; }; -// &uart5 { -// status = "okay"; -// pinctrl-names = "default"; -// pinctrl-0 = <&uart5m0_xfer>; -// }; +//&uart5 { +// status = "okay"; +// pinctrl-names = "default"; +// pinctrl-0 = <&uart5m0_xfer>; +//}; /**********PWM**********/ @@ -210,48 +207,48 @@ // pinctrl-0 = <&pwm1m1_pins>; }; -// &pwm2 { -// status = "okay"; -// pinctrl-names = "active"; -// pinctrl-0 = <&pwm2m2_pins>; -// }; -// &pwm3 { -// status = "okay"; -// pinctrl-names = "active"; -// pinctrl-0 = <&pwm3m2_pins>; -// }; -// &pwm4 { -// status = "okay"; -// pinctrl-names = "active"; -// pinctrl-0 = <&pwm4m2_pins>; -// }; -// &pwm5 { -// status = "okay"; -// pinctrl-names = "active"; -// pinctrl-0 = <&pwm5m2_pins>; -// }; -// &pwm6 { -// status = "okay"; -// pinctrl-names = "active"; -// pinctrl-0 = <&pwm6m2_pins>; -// }; -// &pwm7 { -// status = "okay"; -// pinctrl-names = "active"; -// pinctrl-0 = <&pwm7m2_pins>; -// }; -// &pwm8 { -// status = "okay"; -// pinctrl-names = "active"; -// // pinctrl-0 = <&pwm8m1_pins>; -// pinctrl-0 = <&pwm8m0_pins>; -// }; -// &pwm9 { -// status = "okay"; -// pinctrl-names = "active"; -// // pinctrl-0 = <&pwm9m1_pins>; -// pinctrl-0 = <&pwm9m0_pins>; -// }; +//&pwm2 { +// status = "okay"; +// pinctrl-names = "active"; +// pinctrl-0 = <&pwm2m2_pins>; +//}; +//&pwm3 { +// status = "okay"; +// pinctrl-names = "active"; +// pinctrl-0 = <&pwm3m2_pins>; +//}; +//&pwm4 { +// status = "okay"; +// pinctrl-names = "active"; +// pinctrl-0 = <&pwm4m2_pins>; +//}; +//&pwm5 { +// status = "okay"; +// pinctrl-names = "active"; +// pinctrl-0 = <&pwm5m2_pins>; +//}; +//&pwm6 { +// status = "okay"; +// pinctrl-names = "active"; +// pinctrl-0 = <&pwm6m2_pins>; +//}; +//&pwm7 { +// status = "okay"; +// pinctrl-names = "active"; +// pinctrl-0 = <&pwm7m2_pins>; +//}; +//&pwm8 { +// status = "okay"; +// pinctrl-names = "active"; +// // pinctrl-0 = <&pwm8m1_pins>; +// pinctrl-0 = <&pwm8m0_pins>; +//}; +//&pwm9 { +// status = "okay"; +// pinctrl-names = "active"; +// // pinctrl-0 = <&pwm9m1_pins>; +// pinctrl-0 = <&pwm9m0_pins>; +//}; &pwm10 { status = "okay"; diff --git a/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico.dts b/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico.dts index 82af79e1b..0f1a686fc 100644 --- a/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico.dts +++ b/sysdrv/source/kernel/arch/arm/boot/dts/rv1103g-luckfox-pico.dts @@ -104,27 +104,32 @@ }; -// &sfc { -// status = "okay"; - -// flash@0 { -// compatible = "spi-nand"; -// reg = <0>; -// spi-max-frequency = <75000000>; -// spi-rx-bus-width = <4>; -// spi-tx-bus-width = <1>; -// }; -// }; - -&usbdrd_dwc3 { - dr_mode = "peripheral"; -}; + + + +/**********ETH**********/ &gmac { status = "disabled"; }; +/**********USB**********/ +// &usbdrd { +// status = "disabled"; +// }; + +// &usbdrd_dwc3 { +// status = "disabled"; +// }; + +// &u2phy { +// status = "disabled"; +// }; + +// &u2phy_otg { +// status = "disabled"; +// }; /**********I2C**********/ // &i2c0 { @@ -138,7 +143,7 @@ clock-frequency = <100000>; }; -/**********SPI**********/ +// /**********SPI**********/ &spi0 { status = "okay"; pinctrl-names = "default"; @@ -154,7 +159,7 @@ }; }; -/**********UART**********/ +// /**********UART**********/ &uart3 { status = "okay"; pinctrl-names = "default";