#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
writeR(0xffff0180,cru_phyaddr);
writeR(0xffff0180,cru_phyaddr);
regval=readR(grf_phyaddr);
regval=readR(grf_phyaddr);
regval|=0x3<<((offset<<1)|0x10);
regval|=0x3<<((offset<<1)|0x10);
@ -1996,7 +2094,7 @@ int OrangePi_set_gpio_mode(int pin, int mode)
return0;
return0;
}
}
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
intOrangePi_set_gpio_alt(intpin,intmode)
intOrangePi_set_gpio_alt(intpin,intmode)
{
{
unsignedintregval=0;
unsignedintregval=0;
@ -2037,7 +2135,7 @@ int OrangePi_digitalWrite(int pin, int value)
#ifdef CONFIG_ORANGEPI_2G_IOT
#ifdef CONFIG_ORANGEPI_2G_IOT
unsignedintbase_address=0;
unsignedintbase_address=0;
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_R1PLUS )
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS )
unsignedintregval=0;
unsignedintregval=0;
unsignedintcru_phyaddr=0;
unsignedintcru_phyaddr=0;
@ -2095,7 +2193,7 @@ int OrangePi_digitalWrite(int pin, int value)
else
else
printf("Invalid value\n");
printf("Invalid value\n");
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
@ -2128,7 +2226,7 @@ int OrangePi_digitalWrite(int pin, int value)
writeR(GPIO_BIT(index),phyaddr);
writeR(GPIO_BIT(index),phyaddr);
#else
#else
#if (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
#if (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
writeR(0xffff0180,cru_phyaddr);
writeR(0xffff0180,cru_phyaddr);
#elif (defined CONFIG_ORANGEPI_R1PLUS)
#elif (defined CONFIG_ORANGEPI_R1PLUS)
writeR(0xffff9877,cru_phyaddr);
writeR(0xffff9877,cru_phyaddr);
@ -2164,7 +2262,7 @@ int OrangePi_digitalRead(int pin)
intbank=pin>>5;
intbank=pin>>5;
intindex=pin-(bank<<5);
intindex=pin-(bank<<5);
intval;
intval;
#if ! (defined CONFIG_ORANGEPI_2G_IOT || defined CONFIG_ORANGEPI_RK3399 || CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_R1PLUS)
#if ! (defined CONFIG_ORANGEPI_2G_IOT || defined CONFIG_ORANGEPI_RK3399 || CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)
unsignedintphyaddr;
unsignedintphyaddr;
@ -2201,7 +2299,7 @@ int OrangePi_digitalRead(int pin)
phys_SET_R=base_address+SET_REGISTER;
phys_SET_R=base_address+SET_REGISTER;
phys_VAL_R=base_address+VAL_REGISTER;
phys_VAL_R=base_address+VAL_REGISTER;
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
unsignedintphyaddr;
unsignedintphyaddr;
if(bank==1)
if(bank==1)
phyaddr=GPIO1_BASE+GPIO_EXT_PORTA_OFFSET;
phyaddr=GPIO1_BASE+GPIO_EXT_PORTA_OFFSET;
@ -2269,7 +2367,7 @@ 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 (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
/* Support: OrangePi RK3399 */
/* Support: OrangePi RK3399 */
char*OrangePi_string="rk3399";
char*OrangePi_string="rk3399";
#elif (defined CONFIG_ORANGEPI_R1PLUS)
#elif (defined CONFIG_ORANGEPI_R1PLUS)
@ -2296,7 +2394,7 @@ int isOrangePi(void)
fclose(cpuFd);
fclose(cpuFd);
#if (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4)
#if (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)