···55# removes any old dependencies. DON'T put your own dependencies here66# unless it's something special (ie not a .c file).77#88-obj-y += irq.o prom.o reset.o setup.o88+obj-y += irq.o platform.o prom.o reset.o setup.o
···3434extern unsigned long marvell_base;3535extern unsigned long cpu_clock;36363737-#ifdef CONFIG_MV643XX_ETH3838-extern unsigned char prom_mac_addr_base[6];3939-#endif4040-4137const char *get_system_type(void)4238{4339 return "Momentum Ocelot-3";4440}4545-4646-#ifdef CONFIG_MV643XX_ETH4747-void burn_clocks(void)4848-{4949- int i;5050-5151- /* this loop should burn at least 1us -- this should be plenty */5252- for (i = 0; i < 0x10000; i++)5353- ;5454-}5555-5656-u8 exchange_bit(u8 val, u8 cs)5757-{5858- /* place the data */5959- OCELOT_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);6060- burn_clocks();6161-6262- /* turn the clock on */6363- OCELOT_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);6464- burn_clocks();6565-6666- /* turn the clock off and read-strobe */6767- OCELOT_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);6868-6969- /* return the data */7070- return ((OCELOT_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);7171-}7272-7373-void get_mac(char dest[6])7474-{7575- u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};7676- int i,j;7777-7878- for (i = 0; i < 12; i++)7979- exchange_bit(read_opcode[i], 1);8080-8181- for (j = 0; j < 6; j++) {8282- dest[j] = 0;8383- for (i = 0; i < 8; i++) {8484- dest[j] <<= 1;8585- dest[j] |= exchange_bit(0, 1);8686- }8787- }8888-8989- /* turn off CS */9090- exchange_bit(0,0);9191-}9292-#endif9393-94419542#ifdef CONFIG_64BIT9643···174227175228 mips_machgroup = MACH_GROUP_MOMENCO;176229 mips_machtype = MACH_MOMENCO_OCELOT_3;177177-178178-#ifdef CONFIG_MV643XX_ETH179179- /* get the base MAC address for on-board ethernet ports */180180- get_mac(prom_mac_addr_base);181181-#endif182230183231#ifndef CONFIG_64BIT184232 debug_vectors->printf("Booting Linux kernel...\n");