2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
6 * Copyright (C) 2011 Thomas Langer <thomas.langer@lantiq.com>
7 * Copyright (C) 2011 John Crispin <blogic@openwrt.org>
10 #include <lantiq_soc.h>
16 #define SOC_FALCON "Falcon"
17 #define SOC_FALCON_D "Falcon-D"
18 #define SOC_FALCON_V "Falcon-V"
19 #define SOC_FALCON_M "Falcon-M"
22 #define PART_MASK 0x0FFFF000
24 #define REV_MASK 0xF0000000
26 #define SREV_MASK 0x03C00000
28 #define TYPE_MASK 0x3C000000
30 /* this parameter allows us enable/disable asc1 via commandline */
31 static int register_asc1;
33 ltq_parse_asc1(char *p)
38 __setup("use_asc1", ltq_parse_asc1);
45 falcon_register_gpio();
51 ltq_soc_detect(struct ltq_soc_info *i)
54 i->partnum = (ltq_r32(LTQ_FALCON_CHIPID) & PART_MASK) >> PART_SHIFT;
55 i->rev = (ltq_r32(LTQ_FALCON_CHIPID) & REV_MASK) >> REV_SHIFT;
56 i->srev = ((ltq_r32(LTQ_FALCON_CHIPCONF) & SREV_MASK) >> SREV_SHIFT);
57 sprintf(i->rev_type, "%c%d%d", (i->srev & 0x4) ? ('B') : ('A'),
58 i->rev & 0x7, (i->srev & 0x3) + 1);
62 type = (ltq_r32(LTQ_FALCON_CHIPTYPE) & TYPE_MASK) >> TYPE_SHIFT;
65 i->name = SOC_FALCON_D;
68 i->name = SOC_FALCON_V;
71 i->name = SOC_FALCON_M;
77 i->type = SOC_TYPE_FALCON;