Path: blob/master/arch/mips/lantiq/xway/prom-xway.c
10818 views
/*1* This program is free software; you can redistribute it and/or modify it2* under the terms of the GNU General Public License version 2 as published3* by the Free Software Foundation.4*5* Copyright (C) 2010 John Crispin <[email protected]>6*/78#include <linux/module.h>9#include <linux/clk.h>10#include <asm/bootinfo.h>11#include <asm/time.h>1213#include <lantiq_soc.h>1415#include "../prom.h"1617#define SOC_DANUBE "Danube"18#define SOC_TWINPASS "Twinpass"19#define SOC_AR9 "AR9"2021#define PART_SHIFT 1222#define PART_MASK 0x0FFFFFFF23#define REV_SHIFT 2824#define REV_MASK 0xF00000002526void __init ltq_soc_detect(struct ltq_soc_info *i)27{28i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;29i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;30switch (i->partnum) {31case SOC_ID_DANUBE1:32case SOC_ID_DANUBE2:33i->name = SOC_DANUBE;34i->type = SOC_TYPE_DANUBE;35break;3637case SOC_ID_TWINPASS:38i->name = SOC_TWINPASS;39i->type = SOC_TYPE_DANUBE;40break;4142case SOC_ID_ARX188:43case SOC_ID_ARX168:44case SOC_ID_ARX182:45i->name = SOC_AR9;46i->type = SOC_TYPE_AR9;47break;4849default:50unreachable();51break;52}53}545556