blob: 19d341591254eb1df1061384791d494958f00565 [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 Zhangjinf7a904d2010-01-04 17:16:51 +08003 * Author: Wu Zhangjin, wuzhangjin@gmail.com
Wu Zhangjinbd92aa02009-07-02 23:22:36 +08004 *
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 Zhangjin55045ff2009-11-11 13:39:12 +080024#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
Wu Zhangjin6f7a2512009-11-06 18:45:05 +080025 _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 */
Wu Zhangjina3ed4952009-11-06 18:35:34 +080034 prom_init_uart_base();
Wu Zhangjinbd92aa02009-07-02 23:22:36 +080035}
36
37void __init prom_free_prom_memory(void)
38{
39}