增加设备蓝莓(Blueberry)

This commit is contained in:
aixiao 2023-12-01 17:50:18 +08:00
parent 4ee040125a
commit d28e676f1e
6 changed files with 223 additions and 3 deletions

7
build
View File

@ -72,7 +72,7 @@ select_boards()
"orangepilite2" "orangepilite2"
"orangepioneplus" "orangepioneplus"
"orangepi4" "orangepi4"
"orangepi4-lts" "orangepi4-lts"
"orangepirk3399" "orangepirk3399"
"orangepi800" "orangepi800"
"orangepizero2" "orangepizero2"
@ -80,7 +80,8 @@ select_boards()
"orangepizero2-b" "orangepizero2-b"
"orangepizero3" "orangepizero3"
"orangepir1plus-lts" "orangepir1plus-lts"
"orangepir1plus") "orangepir1plus"
"blueberry")
if [[ -f /etc/orangepi-release ]]; then if [[ -f /etc/orangepi-release ]]; then
@ -143,9 +144,9 @@ select_boards()
[[ $BOARD == orangepizero3 ]] && BOARD=orangepizero2-h616 [[ $BOARD == orangepizero3 ]] && BOARD=orangepizero2-h616
[[ $BOARD == orangepir1plus ]] && BOARD=orangepir1plus-rk3328 [[ $BOARD == orangepir1plus ]] && BOARD=orangepir1plus-rk3328
[[ $BOARD == orangepir1plus-lts ]] && BOARD=orangepir1plus-rk3328 [[ $BOARD == orangepir1plus-lts ]] && BOARD=orangepir1plus-rk3328
[[ $BOARD == blueberry ]] && BOARD=blueberry
export BOARD="${BOARD}" export BOARD="${BOARD}"
export BOARD=orangepizero2-h616
} }
sudo=${WIRINGPI_SUDO-sudo} sudo=${WIRINGPI_SUDO-sudo}

View File

@ -83,6 +83,10 @@ ifeq ($(BOARD), orangepizero2-h616)
EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZERO2 EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZERO2
endif endif
ifeq ($(BOARD), blueberry)
EXTRA_CFLAGS = -DCONFIG_BLUEBERRY
endif
ifeq ($(BOARD), orangepizeroplus2h3) ifeq ($(BOARD), orangepizeroplus2h3)
EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZEROPLUS2_H3 EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZEROPLUS2_H3
endif endif

View File

@ -761,6 +761,97 @@ char *physNames[64] =
}; };
#endif #endif
// 蓝莓
#ifdef CONFIG_BLUEBERRY
int physToWpi[64] =
{
-1, //0
-1, -1, //1, 2
3, -1, //3, 4
5, -1, //5, 6
7, 8, //7, 8
-1, 10, //9,10
11, 12, //11,12
13, -1, //13,14
15, 16, //15,16
-1, 18, //17,18
19, -1, //19,20
21, 22, //21,22
23, 24, //23, 24
-1, 26, //25, 26
27, 28, //27, 28
29, -1, //29, 30
31, 32, //31, 32
33, -1, //33, 34
35, 36, //35, 36
37, 38, //37, 38
-1, 40, //39, 40
// Padding:
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 56
-1, -1, -1, -1, -1, -1, -1, // ... 63
};
int pinToGpioOrangePi [64] =
{
-1, // 0
-1 , -1 , // 3.3V 5V
266 , -1 , // PI10 266 5V
271 , -1 , // PI15 271 GND
268 , 267 , // PI12 268 PI11 267
-1 , 261 , // GND PI5 261
260 , 262 , // PI4 260 PI6 262
263 , -1 , // PI7 263 GND
272 , 270 , // PI16 272 PI14 270
-1 , 256 , // 3.3V PI0 256
258 , -1 , // PI2 258 GND
232 , 225 , // PH8 232 PH1 225
224 , 231 , // PH0 224 PH7 231
-1 , 234 , // GND PH10 234
229 , 233 , // PH5 229 PH9 233
259 , -1 , // PI3 259 GND
265 , 257 , // PI9 265 PI1 257
269 , -1 , // PI13 269 GND
228 , 264 , // PH4 228 PI8 264
226 , 230 , // PH2 226 PH6 230
-1 , 227 , // GND PH3 227
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1,-1, // 63
};
char *physNames[64] =
{
NULL,
" 3.3V", "5V ",
" PI10", "5V ",
" PI15", "GND ",
" PI12", "PI11 ",
" GND", "PI5 ",
" PI4", "PI6 ",
" PI7", "GND ",
" PI16", "PI14 ",
" 3.3V", "PI0 ",
" PI2", "GND ",
" PH8", "PH1 ",
" PH0", "PH7 ",
" GND", "PH10 ",
" PH5", "PH9 ",
" PI3", "GND ",
" PI9", "PI1 ",
" PI13", "GND ",
" PH4", "PI8 ",
" PH2", "PH6 ",
" GND", "PH3 ",
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
};
#endif
#ifdef CONFIG_ORANGEPI_RK3399 #ifdef CONFIG_ORANGEPI_RK3399
int pinToGpioOrangePi [64] = int pinToGpioOrangePi [64] =
{ {
@ -1219,6 +1310,8 @@ void OrangePiReadAll(void)
printf (" +------+-----+----------+------+---+ OPi 3 +---+------+----------+-----+------+\n"); printf (" +------+-----+----------+------+---+ OPi 3 +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_ZERO2 #elif CONFIG_ORANGEPI_ZERO2
printf (" +------+-----+----------+------+---+ H616 +---+------+----------+-----+------+\n"); printf (" +------+-----+----------+------+---+ H616 +---+------+----------+-----+------+\n");
#elif CONFIG_BLUEBERRY
printf (" +------+-----+----------+------+---+ BLUEBERRY +---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_RK3399 #elif CONFIG_ORANGEPI_RK3399
printf (" +------+-----+----------+------+---+OPi RK3399+---+------+----------+-----+------+\n"); printf (" +------+-----+----------+------+---+OPi RK3399+---+------+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_4 #elif CONFIG_ORANGEPI_4
@ -1245,6 +1338,8 @@ void OrangePiReadAll(void)
#elif CONFIG_ORANGEPI_ZERO2 #elif CONFIG_ORANGEPI_ZERO2
for (pin = 1 ; pin <= 40; pin += 2) for (pin = 1 ; pin <= 40; pin += 2)
#elif CONFIG_BLUEBERRY
for (pin = 1 ; pin <= 40; pin += 2)
#endif #endif
readallPhys(pin); readallPhys(pin);
@ -1285,6 +1380,8 @@ void OrangePiReadAll(void)
printf (" +------+-----+----------+------+---+ 800 +---+---+--+----------+-----+------+\n"); printf (" +------+-----+----------+------+---+ 800 +---+---+--+----------+-----+------+\n");
#elif CONFIG_ORANGEPI_R1PLUS #elif CONFIG_ORANGEPI_R1PLUS
printf (" +------+-----+----------+------+---+ R1 Plus +---+---+--+----------+-----+------+\n"); printf (" +------+-----+----------+------+---+ R1 Plus +---+---+--+----------+-----+------+\n");
#elif CONFIG_BLUEBERRY
printf (" +------+-----+----------+------+---+ BLUEBERRY +---+------+----------+-----+------+\n");
#endif #endif
wiringPiDebug = tmp; wiringPiDebug = tmp;

View File

@ -88,6 +88,10 @@ ifeq ($(BOARD), orangepizero2-h616)
EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZERO2 EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZERO2
endif endif
ifeq ($(BOARD), blueberry)
EXTRA_CFLAGS = -DCONFIG_BLUEBERRY
endif
ifeq ($(BOARD), orangepizeroplus2h3) ifeq ($(BOARD), orangepizeroplus2h3)
EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZEROPLUS2_H3 EXTRA_CFLAGS = -DCONFIG_ORANGEPI_ZEROPLUS2_H3
endif endif

View File

@ -1033,6 +1033,105 @@ int ORANGEPI_PIN_MASK[12][32] = //[BANK] [INDEX]
}; };
#endif #endif
// 蓝莓
#ifdef CONFIG_BLUEBERRY
int pinToGpioOrangePi [64] =
{
-1, // 0
-1 , -1 , // 3.3V 5V
266 , -1 , // PI10 266 5V
271 , -1 , // PI15 271 GND
268 , 267 , // PI12 268 PI11 267
-1 , 261 , // GND PI5 261
260 , 262 , // PI4 260 PI6 262
263 , -1 , // PI7 263 GND
272 , 270 , // PI16 272 PI14 270
-1 , 256 , // 3.3V PI0 256
258 , -1 , // PI2 258 GND
232 , 225 , // PH8 232 PH1 225
224 , 231 , // PH0 224 PH7 231
-1 , 234 , // GND PH10 234
229 , 233 , // PH5 229 PH9 233
259 , -1 , // PI3 259 GND
265 , 257 , // PI9 265 PI1 257
269 , -1 , // PI13 269 GND
228 , 264 , // PH4 228 PI8 264
226 , 230 , // PH2 226 PH6 230
-1 , 227 , // GND PH3 227
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1,-1, // 63
};
int physToGpioOrangePi[64] = {
-1, // 0
-1 , -1 , // 3.3V 5V
266 , -1 , // PI10 266 5V
271 , -1 , // PI15 271 GND
268 , 267 , // PI12 268 PI11 267
-1 , 261 , // GND PI5 261
260 , 262 , // PI4 260 PI6 262
263 , -1 , // PI7 263 GND
272 , 270 , // PI16 272 PI14 270
-1 , 256 , // 3.3V PI0 256
258 , -1 , // PI2 258 GND
232 , 225 , // PH8 232 PH1 225
224 , 231 , // PH0 224 PH7 231
-1 , 234 , // GND PH10 234
229 , 233 , // PH5 229 PH9 233
259 , -1 , // PI3 259 GND
265 , 257 , // PI9 265 PI1 257
269 , -1 , // PI13 269 GND
228 , 264 , // PH4 228 PI8 264
226 , 230 , // PH2 226 PH6 230
-1 , 227 , // GND PH3 227
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1,-1, // 63
};
int physToPinOrangePi[64] = {
-1, // 0
-1, -1, // 1, 2
3, -1, //3, 4
5, -1, //5, 6
7, 8, //7, 8
-1, 10, //9,10
11, 12, //11,12
13, -1, //13,14
15, 16, //15,16
-1, 18, //17,18
19, -1, //19,20
21, 22, //21,22
23, 24, //23, 24
-1, 26, // 25, 26
27, 28, //27, 28
29, -1, //29, 30
31, 32, //31, 32
33, -1, //33, 34
35, 36, //35, 36
37, 38, //37, 38
-1, 40, //39, 40
// Padding:
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 56
-1, -1, -1, -1, -1, -1, -1, // ... 63
};
int ORANGEPI_PIN_MASK[12][32] = //[BANK] [INDEX]
{
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PA
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PB
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PC
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PD
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PE
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PF
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PG
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PH
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PI
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PJ
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PK
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }, //PE
};
#endif
#ifdef CONFIG_ORANGEPI_RK3399 #ifdef CONFIG_ORANGEPI_RK3399
int pinToGpioOrangePi[64] = { int pinToGpioOrangePi[64] = {
43, 44, // 0, 1 43, 44, // 0, 1
@ -2527,6 +2626,9 @@ int isOrangePi(void)
#elif CONFIG_ORANGEPI_ZERO2 #elif CONFIG_ORANGEPI_ZERO2
/* Support: OrangePi zero */ /* Support: OrangePi zero */
char *OrangePi_string = "sun50iw9"; char *OrangePi_string = "sun50iw9";
#elif CONFIG_BLUEBERRY
/* Support: OrangePi zero */
char *OrangePi_string = "sun50iw9";
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800) #elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800)
/* Support: OrangePi RK3399 */ /* Support: OrangePi RK3399 */
char *OrangePi_string = "rk3399"; char *OrangePi_string = "rk3399";

View File

@ -90,6 +90,18 @@
#define GPIO_PWM_OP (0x0300A000) #define GPIO_PWM_OP (0x0300A000)
#endif #endif
/*********** OrangePi H616 *************/
#if CONFIG_BLUEBERRY
#define GPIOA_BASE (0x0300B000)
#define GPIO_NUM (0x40)
#define GPIO_BASE_MAP (0x0300B000)
#define MEM_INFO (1024)
#define GPIOL_BASE (0x07022000)
#define GPIOL_BASE_MAP (0x07022000)
#define MAP_SIZE_L (4096 * 1)
#define GPIO_PWM_OP (0x0300A000)
#endif
/*********** OrangePi RK3399 *************/ /*********** OrangePi RK3399 *************/
#if CONFIG_ORANGEPI_RK3399 || CONFIG_ORANGEPI_4 || CONFIG_ORANGEPI_4_LTS || CONFIG_ORANGEPI_800 #if CONFIG_ORANGEPI_RK3399 || CONFIG_ORANGEPI_4 || CONFIG_ORANGEPI_4_LTS || CONFIG_ORANGEPI_800