aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Tabaka <corey.tabaka@gmail.com>2013-05-29 00:34:19 -0700
committerCorey Tabaka <corey.tabaka@gmail.com>2013-06-01 22:59:56 -0700
commitf99d0af6ad9b50174115cfbd49d3c599e44be4ea (patch)
tree9f7bf97528938643e00aa4f4cd0d3f4522f5cf3b
parente30cff8f915419e96069c2f4de1efff53c9dbf3b (diff)
downloadlk-f99d0af6ad9b50174115cfbd49d3c599e44be4ea.tar.gz
[target][pc-x86] Add driver config and init.
-rw-r--r--target/pc-x86/config.c58
-rw-r--r--target/pc-x86/rules.mk10
2 files changed, 68 insertions, 0 deletions
diff --git a/target/pc-x86/config.c b/target/pc-x86/config.c
new file mode 100644
index 00000000..2bd6ecd9
--- /dev/null
+++ b/target/pc-x86/config.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2012 Corey Tabaka
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dev/driver.h>
+#include <dev/class/block.h>
+#include <platform/uart.h>
+#include <platform/ide.h>
+#include <platform.h>
+#include <malloc.h>
+#include <string.h>
+#include <debug.h>
+#include <ffs.h>
+
+#define LOCAL_TRACE 1
+
+static const struct platform_uart_config uart0_config = {
+ .io_port = 0x3f8,
+ .irq = 0x24,
+ .baud_rate = 115200,
+ .rx_buf_len = 1024,
+ .tx_buf_len = 1024,
+};
+
+DEVICE_INSTANCE(uart, uart0, &uart0_config);
+
+static const struct platform_ide_config ide0_config = {
+};
+
+DEVICE_INSTANCE(ide, ide0, &ide0_config);
+
+void target_init(void) {
+ //device_init_all();
+
+ device_init(device_get_by_name(ide, ide0));
+ ffs_mount(0, device_get_by_name(ide, ide0));
+
+}
+
diff --git a/target/pc-x86/rules.mk b/target/pc-x86/rules.mk
index ed7bbfb4..5d2240d0 100644
--- a/target/pc-x86/rules.mk
+++ b/target/pc-x86/rules.mk
@@ -1,5 +1,15 @@
# mostly null target configuration for pc-x86
LOCAL_DIR := $(GET_LOCAL_DIR)
+MODULE := $(LOCAL_DIR)
+
PLATFORM := pc
+MODULES += \
+ lib/ffs \
+
+MODULE_SRCS += \
+ $(LOCAL_DIR)/config.c \
+
+include make/module.mk
+