@@ -80,6 +80,7 @@ typedef unsigned char u8;
8080#define R329_UART0_BASE 0x02500000
8181#define R329_PIO_BASE 0x02000400
8282#define R329_CCM_BASE 0x02001000
83+ #define A733_CCM_BASE 0x02002000
8384
8485#define V853_PIO_BASE 0x02000000
8586
@@ -175,8 +176,11 @@ enum sunxi_gpio_number {
175176#define FLAG_NEW_CLOCK BIT(3)
176177#define FLAG_UART_ON_APB1 BIT(4)
177178#define FLAG_A80_CLOCK BIT(5)
179+ #define FLAG_A733_GPIO BIT(6)
180+ #define FLAG_A733_CLOCK BIT(7)
178181
179182#define FLAG_NCAT2 FLAG_NEW_GPIO | FLAG_NEW_CLOCK
183+ #define FLAG_NCAT3 FLAG_A733_GPIO | FLAG_A733_CLOCK
180184
181185static const struct soc_info {
182186 u16 soc_id ;
@@ -239,6 +243,8 @@ static const struct soc_info {
239243 R329_UART0_BASE , SUNXI_GPH (9 ), MUX_5 , FLAG_NCAT2 },
240244 { 0x1890 , "A523" , V853_PIO_BASE , R329_CCM_BASE , SRAM_A1_ADDR_20000 ,
241245 R329_UART0_BASE , SUNXI_GPB (9 ), MUX_2 , FLAG_NCAT2 },
246+ { 0x1903 , "A733" , V853_PIO_BASE , A733_CCM_BASE , SRAM_A1_ADDR_20000 ,
247+ R329_UART0_BASE , SUNXI_GPB (9 ), MUX_2 , FLAG_NCAT3 },
242248};
243249
244250#define ARRAY_SIZE (x ) (sizeof(x) / sizeof(x[0]))
@@ -259,6 +265,7 @@ static const struct soc_info *find_soc_info(int soc_id, int variant)
259265}
260266
261267static u32 pio_base ;
268+ static u32 pio_bank_a_offset ;
262269static u32 pio_bank_size , pio_dat_off , pio_pull_off ;
263270
264271static int sunxi_gpio_set_cfgpin (u32 pin , u32 val )
@@ -411,6 +418,9 @@ static void clock_init_uart(const struct soc_info *soc)
411418 if (soc -> flags & FLAG_NEW_CLOCK ) {
412419 set_wbit (soc -> ccu_base + 0x90c ,
413420 0x10001 << (CONFIG_CONS_INDEX - 1 ));
421+ } else if (soc -> flags & FLAG_A733_CLOCK ) {
422+ set_wbit (soc -> ccu_base + 0xe00 + (CONFIG_CONS_INDEX - 1 ) * 4 ,
423+ 0x10001 );
414424 } else {
415425 int bit = 16 + CONFIG_CONS_INDEX - 1 ;
416426 int gate_ofs = 0x06c ;
@@ -439,20 +449,26 @@ static void clock_init_uart(const struct soc_info *soc)
439449
440450static void gpio_init (const struct soc_info * soc )
441451{
442- pio_base = soc -> pio_base ;
443-
444452 if (soc -> flags & FLAG_NEW_GPIO ) {
445453 /* GPIO V2 */
446454 pio_bank_size = 0x30 ;
447455 pio_dat_off = 0x10 ;
448456 pio_pull_off = 0x24 ;
457+ } else if (soc -> flags & FLAG_A733_GPIO ) {
458+ /* Bank A Offset = 0x80 */
459+ pio_bank_a_offset = 0x80 ;
460+ pio_bank_size = 0x80 ;
461+ pio_dat_off = 0x10 ;
462+ pio_pull_off = 0x30 ;
449463 } else {
450464 /* GPIO V1 */
451465 pio_bank_size = 0x24 ;
452466 pio_dat_off = 0x10 ;
453467 pio_pull_off = 0x1c ;
454468 }
455469
470+ pio_base = soc -> pio_base + pio_bank_a_offset ;
471+
456472 if (soc -> flags & FLAG_UART_ON_PORTF ) {
457473 /* Disable normal UART0 pins to avoid conflict */
458474 sunxi_gpio_set_cfgpin (soc -> uart0_tx_pin , MUX_GPIO_INPUT );
0 commit comments