Rev 4 of MKE18F16.h (SDK 2.8.0) has
#define NV_FOPT_BOOTSRC_SEL_MASK (0xC0U)
#define NV_FOPT_BOOTSRC_SEL_SHIFT (6U)
This doesn't match KE1xF RM 22.3.1 / Table 22-2, which indicates BOOTSRC_SEL is just FOPT[7], and the choice of boot source depends on both FOPT[7] and FOPT[1] (BOOTPIN_OPT), rather than FOPT[7:6]
I would think the definitions above should be changed to 0x80U and 7U, respectively?
It would also be nice to #define NV_FOPT_RSVD (0x70U)
You are right, it should be as below in SDK
#define NV_FOPT_BOOTSRC_SEL1_MASK (0x80U)
#define NV_FOPT_BOOTSRC_SEL1_SHIFT (7U)
#define NV_FOPT_BOOTSRC_SEL0_MASK (0x02U)
#define NV_FOPT_BOOTSRC_SEL0_SHIFT (1U)