Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 1 | /* |
Wu Zhangjin | a3ed495 | 2009-11-06 18:35:34 +0800 | [diff] [blame] | 2 | * Copyright (C) 2009 Lemote Inc. |
Wu Zhangjin | f7a904d | 2010-01-04 17:16:51 +0800 | [diff] [blame] | 3 | * Author: Wu Zhangjin, wuzhangjin@gmail.com |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 4 | * |
Ralf Baechle | 7034228 | 2013-01-22 12:59:30 +0100 | [diff] [blame] | 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License as published by the |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 7 | * Free Software Foundation; either version 2 of the License, or (at your |
| 8 | * option) any later version. |
| 9 | */ |
| 10 | |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 11 | #include <linux/bootmem.h> |
Aaro Koskinen | 8387efd | 2014-11-19 23:52:50 +0200 | [diff] [blame] | 12 | #include <asm/bootinfo.h> |
Huacai Chen | 300459d | 2014-03-21 18:44:08 +0800 | [diff] [blame] | 13 | #include <asm/smp-ops.h> |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 14 | |
Wu Zhangjin | 5e983ff | 2009-07-02 23:23:03 +0800 | [diff] [blame] | 15 | #include <loongson.h> |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 16 | |
Wu Zhangjin | 6f7a251 | 2009-11-06 18:45:05 +0800 | [diff] [blame] | 17 | /* Loongson CPU address windows config space base address */ |
| 18 | unsigned long __maybe_unused _loongson_addrwincfg_base; |
| 19 | |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 20 | void __init prom_init(void) |
| 21 | { |
Wu Zhangjin | 55045ff | 2009-11-11 13:39:12 +0800 | [diff] [blame] | 22 | #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG |
Wu Zhangjin | 6f7a251 | 2009-11-06 18:45:05 +0800 | [diff] [blame] | 23 | _loongson_addrwincfg_base = (unsigned long) |
| 24 | ioremap(LOONGSON_ADDRWINCFG_BASE, LOONGSON_ADDRWINCFG_SIZE); |
| 25 | #endif |
| 26 | |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 27 | prom_init_cmdline(); |
| 28 | prom_init_env(); |
Huacai Chen | 1a08f15 | 2014-03-21 18:44:02 +0800 | [diff] [blame] | 29 | |
| 30 | /* init base address of io space */ |
| 31 | set_io_port_base((unsigned long) |
| 32 | ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE)); |
| 33 | |
Huacai Chen | c461731 | 2014-06-26 11:41:28 +0800 | [diff] [blame] | 34 | #ifdef CONFIG_NUMA |
| 35 | prom_init_numa_memory(); |
| 36 | #else |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 37 | prom_init_memory(); |
Huacai Chen | c461731 | 2014-06-26 11:41:28 +0800 | [diff] [blame] | 38 | #endif |
Wu Zhangjin | a3ed495 | 2009-11-06 18:35:34 +0800 | [diff] [blame] | 39 | |
| 40 | /*init the uart base address */ |
Wu Zhangjin | a3ed495 | 2009-11-06 18:35:34 +0800 | [diff] [blame] | 41 | prom_init_uart_base(); |
Huacai Chen | 300459d | 2014-03-21 18:44:08 +0800 | [diff] [blame] | 42 | register_smp_ops(&loongson3_smp_ops); |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | void __init prom_free_prom_memory(void) |
| 46 | { |
| 47 | } |