1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <boot_device.h>
5 void __weak
boot_device_init(void)
7 /* Provide weak do-nothing init. */
10 int __weak
boot_device_wp_region(const struct region_device
*rd
,
11 const enum bootdev_prot_type type
)
13 /* return a failure, make aware WP is not implemented */
17 static int boot_device_subregion(const struct region
*sub
,
18 struct region_device
*subrd
,
19 const struct region_device
*parent
)
24 return rdev_chain(subrd
, parent
, region_offset(sub
), region_sz(sub
));
27 int boot_device_ro_subregion(const struct region
*sub
,
28 struct region_device
*subrd
)
30 /* Ensure boot device has been initialized at least once. */
33 return boot_device_subregion(sub
, subrd
, boot_device_ro());
36 int boot_device_rw_subregion(const struct region
*sub
,
37 struct region_device
*subrd
)
39 /* Ensure boot device has been initialized at least once. */
42 return boot_device_subregion(sub
, subrd
, boot_device_rw());