prom-ase.c 877 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  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.
  5. *
  6. * Copyright (C) 2010 John Crispin <blogic@openwrt.org>
  7. */
  8. #include <linux/export.h>
  9. #include <linux/clk.h>
  10. #include <asm/bootinfo.h>
  11. #include <asm/time.h>
  12. #include <lantiq_soc.h>
  13. #include "../prom.h"
  14. #define SOC_AMAZON_SE "Amazon_SE"
  15. #define PART_SHIFT 12
  16. #define PART_MASK 0x0FFFFFFF
  17. #define REV_SHIFT 28
  18. #define REV_MASK 0xF0000000
  19. void __init ltq_soc_detect(struct ltq_soc_info *i)
  20. {
  21. i->partnum = (ltq_r32(LTQ_MPS_CHIPID) & PART_MASK) >> PART_SHIFT;
  22. i->rev = (ltq_r32(LTQ_MPS_CHIPID) & REV_MASK) >> REV_SHIFT;
  23. switch (i->partnum) {
  24. case SOC_ID_AMAZON_SE:
  25. i->name = SOC_AMAZON_SE;
  26. i->type = SOC_TYPE_AMAZON_SE;
  27. break;
  28. default:
  29. unreachable();
  30. break;
  31. }
  32. }