#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_4_LTS || defined CONFIG_ORANGEPI_800)
unsignedintgrf_phyaddr=0,ddr_phyaddr=0;
intoffset=((index-((index>>3)<<3)));
if(bank==1){
@ -1863,7 +1964,7 @@ int OrangePi_set_gpio_mode(int pin, int mode)
unsignedintphyaddr=0;
#ifdef CONFIG_ORANGEPI_2G_IOT
unsignedintbase_address=0;
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)
intoffset=((index-((index>>3)<<3)));
unsignedintcru_phyaddr,grf_phyaddr,gpio_phyaddr;
#else
@ -1895,7 +1996,7 @@ int OrangePi_set_gpio_mode(int pin, int mode)
phyaddr=base_address+OEN_SET_OUT_REGISTER;
else
printf("Invalid mode\n");
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
#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_800)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800)
writeR(0xffff0180,cru_phyaddr);
regval=readR(grf_phyaddr);
regval|=0x3<<((offset<<1)|0x10);
@ -2094,7 +2195,7 @@ int OrangePi_set_gpio_mode(int pin, int mode)
return0;
}
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
intOrangePi_set_gpio_alt(intpin,intmode)
{
unsignedintregval=0;
@ -2135,7 +2236,7 @@ int OrangePi_digitalWrite(int pin, int value)
#ifdef CONFIG_ORANGEPI_2G_IOT
unsignedintbase_address=0;
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS )
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS )
unsignedintregval=0;
unsignedintcru_phyaddr=0;
@ -2193,7 +2294,7 @@ int OrangePi_digitalWrite(int pin, int value)
else
printf("Invalid value\n");
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800)
@ -2226,7 +2327,7 @@ int OrangePi_digitalWrite(int pin, int value)
writeR(GPIO_BIT(index),phyaddr);
#else
#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_4_LTS || defined CONFIG_ORANGEPI_800)
writeR(0xffff0180,cru_phyaddr);
#elif (defined CONFIG_ORANGEPI_R1PLUS)
writeR(0xffff9877,cru_phyaddr);
@ -2262,7 +2363,7 @@ int OrangePi_digitalRead(int pin)
intbank=pin>>5;
intindex=pin-(bank<<5);
intval;
#if ! (defined CONFIG_ORANGEPI_2G_IOT || defined CONFIG_ORANGEPI_RK3399 || CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)
#if ! (defined CONFIG_ORANGEPI_2G_IOT || defined CONFIG_ORANGEPI_RK3399 || CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)
unsignedintphyaddr;
@ -2299,7 +2400,7 @@ int OrangePi_digitalRead(int pin)
phys_SET_R=base_address+SET_REGISTER;
phys_VAL_R=base_address+VAL_REGISTER;
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800)
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800)
unsignedintphyaddr;
if(bank==1)
phyaddr=GPIO1_BASE+GPIO_EXT_PORTA_OFFSET;
@ -2367,7 +2468,7 @@ int isOrangePi(void)
#elif CONFIG_ORANGEPI_ZERO2
/* Support: OrangePi zero */
char*OrangePi_string="sun50iw9";
#elif (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || 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 */
char*OrangePi_string="rk3399";
#elif (defined CONFIG_ORANGEPI_R1PLUS)
@ -2394,7 +2495,7 @@ int isOrangePi(void)
fclose(cpuFd);
#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_4_LTS || defined CONFIG_ORANGEPI_800)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
@ -961,7 +961,7 @@ void piBoardId (int *model, int *rev, int *mem, int *maker, int *warranty)
break;
fclose(cpuFd);
#if (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)
#if (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_R1PLUS)
strcpy(line,"Revision : 0000");
#endif
@ -1340,7 +1340,7 @@ void pinModeAlt (int pin, int mode)
#ifdef CONFIG_ORANGEPI
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS || CONFIG_ORANGEPI_2G_IOT)
#if !(defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || 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)
#if ! (defined CONFIG_ORANGEPI_RK3399 || defined CONFIG_ORANGEPI_4 || defined CONFIG_ORANGEPI_4_LTS || defined CONFIG_ORANGEPI_800 || defined CONFIG_ORANGEPI_R1PLUS)