blob: 743d3571f010f6204da7000f846429d763334b17 [file] [log] [blame]
Wu Zhangjinbd92aa02009-07-02 23:22:36 +08001/*
Wu Zhangjina3ed4952009-11-06 18:35:34 +08002 * Copyright (C) 2009 Lemote Inc.
Wu Zhangjinbd92aa02009-07-02 23:22:36 +08003 * 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 Zhangjinbd92aa02009-07-02 23:22:36 +080011#include <linux/bootmem.h>
12
Wu Zhangjin5e983ff2009-07-02 23:23:03 +080013#include <loongson.h>
Wu Zhangjinbd92aa02009-07-02 23:22:36 +080014
Wu Zhangjin6f7a2512009-11-06 18:45:05 +080015/* Loongson CPU address windows config space base address */
16unsigned long __maybe_unused _loongson_addrwincfg_base;
17
Wu Zhangjinbd92aa02009-07-02 23:22:36 +080018void __init prom_init(void)
19{
Wu Zhangjina3ed4952009-11-06 18:35:34 +080020 /* init base address of io space */
Wu Zhangjinbd92aa02009-07-02 23:22:36 +080021 set_io_port_base((unsigned long)
Wu Zhangjine2fee572009-10-16 14:17:19 +080022 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
Wu Zhangjinbd92aa02009-07-02 23:22:36 +080023
Wu Zhangjin6f7a2512009-11-06 18:45:05 +080024#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 Zhangjinbd92aa02009-07-02 23:22:36 +080029 prom_init_cmdline();
30 prom_init_env();
31 prom_init_memory();
Wu Zhangjina3ed4952009-11-06 18:35:34 +080032
33 /*init the uart base address */
34#if defined(CONFIG_EARLY_PRINTK) || defined(CONFIG_SERIAL_8250)
35 prom_init_uart_base();
36#endif
Wu Zhangjinbd92aa02009-07-02 23:22:36 +080037}
38
39void __init prom_free_prom_memory(void)
40{
41}