blob: b91020e2bcdd7c6251aedcd1a5f41a3d6be54d5f [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/*
2 * Copyright (c) 2012 Corey Tabaka
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24#include <dev/driver.h>
25#include <dev/class/block.h>
26#include <dev/class/netif.h>
27#include <platform/uart.h>
28#include <platform/ide.h>
29#include <platform/pcnet.h>
30#include <platform.h>
31#include <malloc.h>
32#include <string.h>
33#include <debug.h>
34
35#ifndef ARCH_X86_64
36#include <ffs.h>
37#endif
38
39#define LOCAL_TRACE 1
40
41static const struct platform_uart_config uart0_config = {
42 .io_port = 0x3f8,
43 .irq = 0x24,
44 .baud_rate = 115200,
45 .rx_buf_len = 1024,
46 .tx_buf_len = 1024,
47};
48
49DEVICE_INSTANCE(uart, uart0, &uart0_config);
50
51#ifndef ARCH_X86_64
52static const struct platform_ide_config ide0_config = {
53};
54
55DEVICE_INSTANCE(ide, ide0, &ide0_config);
56
57#endif
58
59void target_init(void) {
60 //device_init_all();
61#ifndef ARCH_X86_64
62
63 device_init(device_get_by_name(ide, ide0));
64 ffs_mount(0, device_get_by_name(ide, ide0));
65#endif
66}
67