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 | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 3 | * Author: Wu Zhangjin, wuzj@lemote.com |
| 4 | * |
| 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 |
| 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> |
| 12 | |
Wu Zhangjin | 5e983ff | 2009-07-02 23:23:03 +0800 | [diff] [blame] | 13 | #include <loongson.h> |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 14 | |
Wu Zhangjin | 6f7a251 | 2009-11-06 18:45:05 +0800 | [diff] [blame^] | 15 | /* Loongson CPU address windows config space base address */ |
| 16 | unsigned long __maybe_unused _loongson_addrwincfg_base; |
| 17 | |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 18 | void __init prom_init(void) |
| 19 | { |
Wu Zhangjin | a3ed495 | 2009-11-06 18:35:34 +0800 | [diff] [blame] | 20 | /* init base address of io space */ |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 21 | set_io_port_base((unsigned long) |
Wu Zhangjin | e2fee57 | 2009-10-16 14:17:19 +0800 | [diff] [blame] | 22 | ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE)); |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 23 | |
Wu Zhangjin | 6f7a251 | 2009-11-06 18:45:05 +0800 | [diff] [blame^] | 24 | #if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT) |
| 25 | _loongson_addrwincfg_base = (unsigned long) |
| 26 | ioremap(LOONGSON_ADDRWINCFG_BASE, LOONGSON_ADDRWINCFG_SIZE); |
| 27 | #endif |
| 28 | |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 29 | prom_init_cmdline(); |
| 30 | prom_init_env(); |
| 31 | prom_init_memory(); |
Wu Zhangjin | a3ed495 | 2009-11-06 18:35:34 +0800 | [diff] [blame] | 32 | |
| 33 | /*init the uart base address */ |
| 34 | #if defined(CONFIG_EARLY_PRINTK) || defined(CONFIG_SERIAL_8250) |
| 35 | prom_init_uart_base(); |
| 36 | #endif |
Wu Zhangjin | bd92aa0 | 2009-07-02 23:22:36 +0800 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | void __init prom_free_prom_memory(void) |
| 40 | { |
| 41 | } |