xref: /openbmc/linux/include/linux/iscsi_ibft.h (revision 9338c223)
1d9523678SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2138fe4e0SKonrad Rzeszutek /*
3138fe4e0SKonrad Rzeszutek  *  Copyright 2007 Red Hat, Inc.
4138fe4e0SKonrad Rzeszutek  *  by Peter Jones <pjones@redhat.com>
5138fe4e0SKonrad Rzeszutek  *  Copyright 2007 IBM, Inc.
6138fe4e0SKonrad Rzeszutek  *  by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
7138fe4e0SKonrad Rzeszutek  *  Copyright 2008
8138fe4e0SKonrad Rzeszutek  *  by Konrad Rzeszutek <ketuzsezr@darnok.org>
9138fe4e0SKonrad Rzeszutek  *
10138fe4e0SKonrad Rzeszutek  * This code exposes the iSCSI Boot Format Table to userland via sysfs.
11138fe4e0SKonrad Rzeszutek  */
12138fe4e0SKonrad Rzeszutek 
13138fe4e0SKonrad Rzeszutek #ifndef ISCSI_IBFT_H
14138fe4e0SKonrad Rzeszutek #define ISCSI_IBFT_H
15138fe4e0SKonrad Rzeszutek 
16342f43afSMaurizio Lombardi #include <linux/types.h>
17138fe4e0SKonrad Rzeszutek 
18138fe4e0SKonrad Rzeszutek /*
19342f43afSMaurizio Lombardi  * Physical location of iSCSI Boot Format Table.
20342f43afSMaurizio Lombardi  * If the value is 0 there is no iBFT on the machine.
21138fe4e0SKonrad Rzeszutek  */
22342f43afSMaurizio Lombardi extern phys_addr_t ibft_phys_addr;
23138fe4e0SKonrad Rzeszutek 
24*9338c223SRoss Lagerwall #ifdef CONFIG_ISCSI_IBFT_FIND
25*9338c223SRoss Lagerwall 
26138fe4e0SKonrad Rzeszutek /*
27138fe4e0SKonrad Rzeszutek  * Routine used to find and reserve the iSCSI Boot Format Table. The
28342f43afSMaurizio Lombardi  * physical address is set in the ibft_phys_addr variable.
29138fe4e0SKonrad Rzeszutek  */
30342f43afSMaurizio Lombardi void reserve_ibft_region(void);
31*9338c223SRoss Lagerwall 
32*9338c223SRoss Lagerwall /*
33*9338c223SRoss Lagerwall  * Physical bounds to search for the iSCSI Boot Format Table.
34*9338c223SRoss Lagerwall  */
35*9338c223SRoss Lagerwall #define IBFT_START 0x80000 /* 512kB */
36*9338c223SRoss Lagerwall #define IBFT_END 0x100000 /* 1MB */
37*9338c223SRoss Lagerwall 
38138fe4e0SKonrad Rzeszutek #else
reserve_ibft_region(void)39342f43afSMaurizio Lombardi static inline void reserve_ibft_region(void) {}
40138fe4e0SKonrad Rzeszutek #endif
41138fe4e0SKonrad Rzeszutek 
42138fe4e0SKonrad Rzeszutek #endif /* ISCSI_IBFT_H */
43