static void eio_init(void) { /***output enable***/ hard_i2c_write8(EIO_ID, 0x0c, 0); hard_i2c_write8(EIO_ID, 0x0d, 0); // hard_i2c_write8(EIO_ID, 0x0e, 0); hard_i2c_write8(EIO_ID, 0x0e, 0x1f); }
int board_eth_init(bd_t *bis) { int out; /* @todo implement this function */ ///GPIOD15-24 for 8626M; ///GPIOD12 nRst; ///GPIOD13 n_int; printf("Set 8626m\n"); //eth_clk_set(ETH_CLKSRC_SYS_D3,900*CLK_1M/3,50*CLK_1M); //eth_clk_set(ETH_CLKSRC_SYS_D3,get_cpu_clk()*2/3,50*CLK_1M); eth_clk_set(ETH_CLKSRC_APLL_CLK,400*CLK_1M,50*CLK_1M); ///GPIOD15-24 for 8626M; ///GPIOD12 nRst; ///GPIOD13 n_int; //eth_set_pinmux(ETH_BANK2_GPIOD15_D23,ETH_CLK_OUT_GPIOD7_REG4_20,0); eth_set_pinmux(ETH_BANK2_GPIOD15_D23,ETH_CLK_OUT_GPIOD24_REG5_1,0); /*disalbe*/ //reset:LCD_G5 writel(readl(ETH_PLL_CNTL) & ~(1 << 0), ETH_PLL_CNTL); // Disable the Ethernet clocks // --------------------------------------------- // Test 50Mhz Input Divide by 2 // --------------------------------------------- // Select divide by 2 writel(readl(ETH_PLL_CNTL) | (0 << 3), ETH_PLL_CNTL); // desc endianess "same order" writel(readl(ETH_PLL_CNTL) | (0 << 2), ETH_PLL_CNTL); // data endianess "little" writel(readl(ETH_PLL_CNTL) | (1 << 1), ETH_PLL_CNTL); // divide by 2 for 100M writel(readl(ETH_PLL_CNTL) | (1 << 0), ETH_PLL_CNTL); // enable Ethernet clocks udelay(100); /*reset*/ //EIO P13 SET LOW out = hard_i2c_read8(EIO_ID, 0x01); // printf("out = %x\n", out); udelay(100); hard_i2c_write8(EIO_ID, 0x05, out&(~(0x8))); udelay(100); out = hard_i2c_read8(EIO_ID, 0x01); // printf("out2 = %x\n", out); //EIO P13 SET HIGH hard_i2c_write8(EIO_ID, 0x05, out|0x8); udelay(100); // out = hard_i2c_read8(EIO_ID, 0x01); // printf("out3 = %x\n", out); //power hold // setbits_le32(P_PREG_AGPIO_O,(1<<8)); // clrbits_le32(P_PREG_AGPIO_EN_N,(1<<8)); udelay(10); //waiting reset end; aml_eth_init(bis); return 0; }
void i2c_pmu_write(unsigned char reg, unsigned char val) { return hard_i2c_write8(I2C_RN5T618_ADDR, reg, val); }
static void power_init(void) { eio_init(); hard_i2c_write8(EIO_ID, 0x04, 0xfa);//P00 VCC5V_EN & P02 LCD3.3_EN set to low level hard_i2c_write8(EIO_ID, 0x06, 0x1f); }