2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
10 #include <linux/module.h>
11 #include <linux/clk.h>
12 #include <linux/time.h>
13 #include <asm/bootinfo.h>
15 #include <lantiq_soc.h>
19 #include "../machtypes.h"
24 #define SOC_SVIP "SVIP"
27 #define PART_MASK 0x0FFFF000
29 #define REV_MASK 0xF0000000
31 static struct svip_reg_ebu *const ebu = (struct svip_reg_ebu *)LTQ_EBU_BASE;
33 void __init ltq_soc_init(void)
35 clkdev_add_static(ltq_svip_cpu_hz(), ltq_svip_fpi_hz(),
36 ltq_svip_io_region_clock());
42 if (mips_machtype == LANTIQ_MACH_EASY33016 ||
43 mips_machtype == LANTIQ_MACH_EASY336) {
44 ebu_w32(0x120000f1, addr_sel_2);
45 ebu_w32(LTQ_EBU_CON_0_ADSWP |
47 LTQ_EBU_CON_0_BCGEN_VAL(0x02) |
48 LTQ_EBU_CON_0_WAITWRC_VAL(7) |
49 LTQ_EBU_CON_0_WAITRDC_VAL(3) |
50 LTQ_EBU_CON_0_HOLDC_VAL(3) |
51 LTQ_EBU_CON_0_RECOVC_VAL(3) |
52 LTQ_EBU_CON_0_CMULT_VAL(3), con_2);
57 ltq_soc_detect(struct ltq_soc_info *i)
59 i->partnum = (ltq_r32(LTQ_STATUS_CHIPID) & PART_MASK) >> PART_SHIFT;
60 i->rev = (ltq_r32(LTQ_STATUS_CHIPID) & REV_MASK) >> REV_SHIFT;
61 sprintf(i->rev_type, "1.%d", i->rev);
65 i->type = SOC_TYPE_SVIP;
69 printk(KERN_ERR "unknown partnum : 0x%08X\n", i->partnum);