diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-05 11:05:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-05-05 11:05:51 +0200 |
commit | f8327af20c1c2988b0d9909f403780e31cc6b59e (patch) | |
tree | 80eb52cc1160e577646e136ad9e3e4638aac5559 /arch/x86/boards/x86_generic/disk_bios_drive.c | |
parent | b568687bc3c48edd814c4b4546d049d859c8cc3f (diff) | |
parent | 9f556d4b6fc71d548e5c984c416f4f1b7d599d2f (diff) | |
download | barebox-f8327af20c1c2988b0d9909f403780e31cc6b59e.tar.gz barebox-f8327af20c1c2988b0d9909f403780e31cc6b59e.tar.xz |
Merge branch 'for-next/ioresource'
Diffstat (limited to 'arch/x86/boards/x86_generic/disk_bios_drive.c')
-rw-r--r-- | arch/x86/boards/x86_generic/disk_bios_drive.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/x86/boards/x86_generic/disk_bios_drive.c b/arch/x86/boards/x86_generic/disk_bios_drive.c new file mode 100644 index 0000000000..f33f48c3fb --- /dev/null +++ b/arch/x86/boards/x86_generic/disk_bios_drive.c @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2009 Juergen Beisert, Pengutronix + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + */ + +/** + * @file + * @brief Generic PC support for the BIOS disk interface + */ + +#include <common.h> +#include <driver.h> +#include <init.h> +#include <linux/err.h> +#include "envsector.h" + +static int bios_disk_init(void) +{ + struct cdev *cdev; + + add_generic_device("biosdrive", DEVICE_ID_DYNAMIC, NULL, 0, 0, + IORESOURCE_MEM, NULL); + + if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) { + cdev = devfs_add_partition("biosdisk0", + pers_env_storage * 512, + (unsigned)pers_env_size * 512, + DEVFS_PARTITION_FIXED, "env0"); + printf("Partition: %ld\n", IS_ERR(cdev) ? PTR_ERR(cdev) : 0); + } else + printf("No persistent storage defined\n"); + + return 0; +} +device_initcall(bios_disk_init); |