xref: /haiku/src/add-ons/kernel/bus_managers/isa/arch/ppc/isa_controller.c (revision aef94baf32b4370979ce315902c400d23076366c)
1d4a25c07SFrançois Revol /*
2d4a25c07SFrançois Revol  * Copyright 2007 Haiku, Inc.
3d4a25c07SFrançois Revol  * Distributed under the terms of the MIT License.
4d4a25c07SFrançois Revol  *
5d4a25c07SFrançois Revol  * arch-specific config manager
6d4a25c07SFrançois Revol  *
7d4a25c07SFrançois Revol  * Authors (in chronological order):
8d4a25c07SFrançois Revol  *              François Revol (revol@free.fr)
9d4a25c07SFrançois Revol  */
10d4a25c07SFrançois Revol 
11d4a25c07SFrançois Revol #include <KernelExport.h>
12d4a25c07SFrançois Revol #include "ISA.h"
13d4a25c07SFrançois Revol #include "arch_cpu.h"
14d4a25c07SFrançois Revol #include "isa_arch.h"
15d4a25c07SFrançois Revol 
16d4a25c07SFrançois Revol //#define TRACE_ISA
17d4a25c07SFrançois Revol #ifdef TRACE_ISA
18d4a25c07SFrançois Revol #       define TRACE(x) dprintf x
19d4a25c07SFrançois Revol #else
20d4a25c07SFrançois Revol #       define TRACE(x) ;
21d4a25c07SFrançois Revol #endif
22d4a25c07SFrançois Revol 
23d4a25c07SFrançois Revol #warning PPC: WRITEME!
24d4a25c07SFrançois Revol 
25d4a25c07SFrançois Revol uint8
arch_isa_read_io_8(int mapped_io_addr)26d4a25c07SFrançois Revol arch_isa_read_io_8(int mapped_io_addr)
27d4a25c07SFrançois Revol {
28d4a25c07SFrançois Revol 	uint8 value = in8(mapped_io_addr);
29d4a25c07SFrançois Revol 
30d4a25c07SFrançois Revol 	TRACE(("isa_read8(%x->%x)\n", mapped_io_addr, value));
31d4a25c07SFrançois Revol 
32d4a25c07SFrançois Revol 	return value;
33d4a25c07SFrançois Revol }
34d4a25c07SFrançois Revol 
35d4a25c07SFrançois Revol 
36d4a25c07SFrançois Revol void
arch_isa_write_io_8(int mapped_io_addr,uint8 value)37d4a25c07SFrançois Revol arch_isa_write_io_8(int mapped_io_addr, uint8 value)
38d4a25c07SFrançois Revol {
39d4a25c07SFrançois Revol 	TRACE(("isa_write8(%x->%x)\n", value, mapped_io_addr));
40d4a25c07SFrançois Revol 
41d4a25c07SFrançois Revol 	out8(value, mapped_io_addr);
42d4a25c07SFrançois Revol }
43d4a25c07SFrançois Revol 
44d4a25c07SFrançois Revol 
45d4a25c07SFrançois Revol uint16
arch_isa_read_io_16(int mapped_io_addr)46d4a25c07SFrançois Revol arch_isa_read_io_16(int mapped_io_addr)
47d4a25c07SFrançois Revol {
48d4a25c07SFrançois Revol 	return in16(mapped_io_addr);
49d4a25c07SFrançois Revol }
50d4a25c07SFrançois Revol 
51d4a25c07SFrançois Revol 
52d4a25c07SFrançois Revol void
arch_isa_write_io_16(int mapped_io_addr,uint16 value)53d4a25c07SFrançois Revol arch_isa_write_io_16(int mapped_io_addr, uint16 value)
54d4a25c07SFrançois Revol {
55d4a25c07SFrançois Revol 	out16(value, mapped_io_addr);
56d4a25c07SFrançois Revol }
57d4a25c07SFrançois Revol 
58d4a25c07SFrançois Revol 
59d4a25c07SFrançois Revol uint32
arch_isa_read_io_32(int mapped_io_addr)60d4a25c07SFrançois Revol arch_isa_read_io_32(int mapped_io_addr)
61d4a25c07SFrançois Revol {
62d4a25c07SFrançois Revol 	return in32(mapped_io_addr);
63d4a25c07SFrançois Revol }
64d4a25c07SFrançois Revol 
65d4a25c07SFrançois Revol 
66d4a25c07SFrançois Revol void
arch_isa_write_io_32(int mapped_io_addr,uint32 value)67d4a25c07SFrançois Revol arch_isa_write_io_32(int mapped_io_addr, uint32 value)
68d4a25c07SFrançois Revol {
69d4a25c07SFrançois Revol 	out32(value, mapped_io_addr);
70d4a25c07SFrançois Revol }
71d4a25c07SFrançois Revol 
72d4a25c07SFrançois Revol 
73*aef94bafSFrançois Revol phys_addr_t
arch_isa_ram_address(phys_addr_t physical_address_in_system_memory)74*aef94bafSFrançois Revol arch_isa_ram_address(phys_addr_t physical_address_in_system_memory)
75d4a25c07SFrançois Revol {
76d4a25c07SFrançois Revol 	// this is what the BeOS kernel does
77*aef94bafSFrançois Revol 	return physical_address_in_system_memory;
78d4a25c07SFrançois Revol }
79d4a25c07SFrançois Revol 
80d4a25c07SFrançois Revol 
81d4a25c07SFrançois Revol status_t
arch_isa_init(void)82d4a25c07SFrançois Revol arch_isa_init(void)
83d4a25c07SFrançois Revol {
84d4a25c07SFrançois Revol 	return B_OK;
85d4a25c07SFrançois Revol }
86