123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- #include <common.h>
- #include <asm/ppc4xx.h>
- #include <i2c.h>
- #include <libfdt.h>
- #include <fdt_support.h>
- #include <netdev.h>
- #include <video.h>
- #include <asm/processor.h>
- #include <asm/io.h>
- #include <asm/ppc4xx-gpio.h>
- #include <asm/4xx_pcie.h>
- #include <linux/errno.h>
- #include <asm/mmu.h>
- DECLARE_GLOBAL_DATA_PTR;
- int board_early_init_f(void)
- {
- unsigned long mfr;
-
-
- mtdcr(UIC3SR, 0xffffffff);
- mtdcr(UIC3ER, 0x00000000);
- mtdcr(UIC3CR, 0x00000000);
- mtdcr(UIC3PR, 0xffffffff);
- mtdcr(UIC3TR, 0x001fffff);
- mtdcr(UIC3VR, 0x00000001);
- mtdcr(UIC3SR, 0x00000000);
- mtdcr(UIC3SR, 0xffffffff);
- mtdcr(UIC2SR, 0xffffffff);
- mtdcr(UIC2ER, 0x00000000);
- mtdcr(UIC2CR, 0x00000000);
- mtdcr(UIC2PR, 0xebebebff);
- mtdcr(UIC2TR, 0x74747400);
- mtdcr(UIC2VR, 0x00000001);
- mtdcr(UIC2SR, 0x00000000);
- mtdcr(UIC2SR, 0xffffffff);
- mtdcr(UIC1SR, 0xffffffff);
- mtdcr(UIC1ER, 0x00000000);
- mtdcr(UIC1CR, 0x00000000);
- mtdcr(UIC1PR, 0xffffffff);
- mtdcr(UIC1TR, 0x001f8040);
- mtdcr(UIC1VR, 0x00000001);
- mtdcr(UIC1SR, 0x00000000);
- mtdcr(UIC1SR, 0xffffffff);
- mtdcr(UIC0SR, 0xffffffff);
- mtdcr(UIC0ER, 0x00000000);
- mtdcr(UIC0CR, 0x00104001);
- mtdcr(UIC0PR, 0xffffffff);
- mtdcr(UIC0TR, 0x010f0004);
- mtdcr(UIC0VR, 0x00000001);
- mtdcr(UIC0SR, 0x00000000);
- mtdcr(UIC0SR, 0xffffffff);
- mfsdr(SDR0_MFR, mfr);
- mfr |= SDR0_MFR_FIXD;
- mtsdr(SDR0_MFR, mfr);
- mtsdr(SDR0_PFC0, CONFIG_SYS_PFC0);
- out_be32((void *)GPIO0_OR, CONFIG_SYS_GPIO_OR);
- out_be32((void *)GPIO0_ODR, CONFIG_SYS_GPIO_ODR);
- out_be32((void *)GPIO0_TCR, CONFIG_SYS_GPIO_TCR);
- return 0;
- }
- int board_early_init_r(void)
- {
-
-
- mtebc(PB0CR, CONFIG_SYS_FLASH_BASE_PHYS_L | 0xda000);
-
- remove_tlb(CONFIG_SYS_BOOT_BASE_ADDR, 16 << 20);
-
- program_tlb(CONFIG_SYS_FLASH_BASE_PHYS, CONFIG_SYS_FLASH_BASE,
- CONFIG_SYS_FLASH_SIZE, TLB_WORD2_I_ENABLE);
-
-
- set_mcsr(get_mcsr());
- return 0;
- }
- int checkboard(void)
- {
- char buf[64];
- int i = getenv_f("serial#", buf, sizeof(buf));
- printf("Board: ICON");
- if (i > 0) {
- puts(", serial# ");
- puts(buf);
- }
- putc('\n');
- return 0;
- }
- u32 ddr_wrdtr(u32 default_val)
- {
- return SDRAM_WRDTR_LLWP_1_CYC | SDRAM_WRDTR_WTR_90_DEG_ADV;
- }
- u32 ddr_clktr(u32 default_val)
- {
- return SDRAM_CLKTR_CLKP_180_DEG_ADV;
- }
- int board_pcie_last(void)
- {
-
- return 1;
- }
- #ifdef CONFIG_VIDEO_SM501
- #include <sm501.h>
- #define DISPLAY_WIDTH 640
- #define DISPLAY_HEIGHT 480
- static const SMI_REGS sm502_init_regs[] = {
- {0x00004, 0x0},
- {0x00040, 0x00021847},
- {0x00044, 0x091a0a01},
- {0x00054, 0x0},
- {0x00048, 0x00021847},
- {0x0004C, 0x091a0a01},
- {0x00054, 0x1},
- {0x80004, 0xc428bb17},
- {0x8000C, 0x00000000},
- {0x80010, 0x0a000a00},
- {0x80014, 0x02800000},
- {0x80018, 0x01e00000},
- {0x8001C, 0x00000000},
- {0x80020, 0x01e00280},
- {0x80024, 0x02fa027f},
- {0x80028, 0x004a0280},
- {0x8002C, 0x020c01df},
- {0x80030, 0x000201e7},
- {0x80200, 0x00010000},
- {0x00008, 0x20000000},
- {0x0000C, 0x3f000000},
- {0x10020, 0x25725728},
- {0x80000, 0x0f010106},
- {0, 0}
- };
- const SMI_REGS *board_get_regs(void)
- {
- return sm502_init_regs;
- }
- int board_get_width(void)
- {
- return DISPLAY_WIDTH;
- }
- int board_get_height(void)
- {
- return DISPLAY_HEIGHT;
- }
- #ifdef CONFIG_CONSOLE_EXTRA_INFO
- void video_get_info_str(int line_number, char *info)
- {
- if (line_number == 1)
- strcpy(info, " Board: ICON");
- else
- info[0] = '\0';
- }
- #endif
- #endif
|