Skip to content

Commit

Permalink
need ccu.h
Browse files Browse the repository at this point in the history
  • Loading branch information
adventuresin9 committed Jul 4, 2023
1 parent 3b3e06c commit 01687f7
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
60 changes: 60 additions & 0 deletions ccu.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@


typedef struct Gate Gate;
typedef struct Reset Reset;
typedef struct Nkmp Nkmp;


Expand All @@ -111,6 +112,13 @@ struct Gate{
};


struct Reset{
char *name;
uint bank;
uint mask;
};


static Gate gates[] = {
{"USBOHCI0", 0x0, 1<<29},
{"USB-OTG-OHCI", 0x0, 1<<28},
Expand Down Expand Up @@ -157,6 +165,58 @@ static Gate gates[] = {
{"TWI1", 0xC, 1<<1},
{"TWI0", 0xC, 1<<0},
{"DBGSYS", 0x10, 1<<7},
{ nil },
};


static Reset resets[] = {
{"USBOHCI0", 0x0, 1<<29},
{"USB-OTG-OHCI", 0x0, 1<<28},
{"USBEHCI0", 0x0, 1<<25},
{"USB-OTG-EHCI", 0x0, 1<<24},
{"USB-OTG-Device", 0x0, 1<<23},
{"SPI1", 0x0, 1<<21},
{"SPI0", 0x0, 1<<20},
{"HSTMR", 0x0, 1<<19},
{"TS", 0x0, 1<<18},
{"EMAC", 0x0, 1<<17},
{"DRAM", 0x0, 1<<14},
{"NAND", 0x0, 1<<13},
{"SMHC2", 0x0, 1<<10},
{"SMHC1", 0x0, 1<<9},
{"SMHC0", 0x0, 1<<8},
{"DMA", 0x0, 1<<6},
{"CE", 0x0, 1<<5},
{"MIPIDSI", 0x0, 1<<1},
{"DBGSYS", 0x4, 1<<31},
{"SPINLOCK", 0x4, 1<<22},
{"MSGBOX", 0x4, 1<<21},
{"GPU", 0x4, 1<<20},
{"DE", 0x4, 1<<12},
{"HDMI", 0x4, 1<<11}, // listed as HDMI1 in datasheet
{"HDMI0", 0x4, 1<<10},
{"CSI", 0x4, 1<<8},
{"DEINTERLACE", 0x4, 1<<5},
{"TCON1", 0x4, 1<<4},
{"TCON0", 0x4, 1<<3},
{"VE", 0x4, 1<<0},
{"LVDS", 0x8, 1<<0},
{"I2SPCM2", 0x10, 1<<14},
{"I2SPCM1", 0x10, 1<<13},
{"I2SPCM0", 0x10, 1<<12},
{"THS", 0x10, 1<<8},
{"OWA", 0x10, 1<<1},
{"AC_DIG", 0x10, 1<<0},
{"UART4", 0x18, 1<<20},
{"UART3", 0x18, 1<<19},
{"UART2", 0x18, 1<<18},
{"UART1", 0x18, 1<<17},
{"UART0", 0x18, 1<<16},
{"SCR", 0x18, 1<<5},
{"TWI2", 0x18, 1<<2},
{"TWI1", 0x18, 1<<1},
{"TWI0", 0x18, 1<<0},
{ nil },
};


Expand Down
2 changes: 1 addition & 1 deletion thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ thermalinit(void)
u32int buf;

/* turn on THS clock */
turnonts();
turnonths();

/* start calibration */
thrmwr(THS_CTRL1, ACaliEn);
Expand Down

0 comments on commit 01687f7

Please sign in to comment.