def METHOD_NAME(env):
    """
    Finds all CMSIS bit fields related to enabling and resetting peripherals
    in the RCC of the format `RCC_(REGISTER)_(PERIPHERAL)_(TYPE)` where:
      - REGISTER: a variation of `(BUS)(ID?)(ENR|RSTR)`, e.g. `AHB1ENR`
      - PERIPHERAL: typical peripheral name, e.g. `GPIOA`
      - TYPE: either `EN` or `RST`.
    :returns: a 2D-dictionary: `map[PERIPHERAL][TYPE] = REGISTER`
    """
    headers = env.query("headers")
    core_header = repopath("ext/arm/cmsis/CMSIS/Core/Include", headers["core_header"])
    content = ""
    for header_path in [core_header, localpath(bprops["folder"], headers["device_header"])]:
        content += Path(header_path).read_text(encoding="utf-8", errors="replace")
    # find mpu and fpu features
    features = re.findall(r"#define +__([MF]PU)_PRESENT +([01])", content)
    core_features = {f[0]:bool(int(f[1])) for f in features}
    # find all peripherals
    mperipherals = re.findall(r"#define +(.*?) +\(\((.*?_Type(?:Def)?)", content)
    # We only care about the absolute peripheral addresses
    peripherals = [(p[0],p[1]) for p in mperipherals]
    # filter out MPU and/or FPU if required
    peripherals = filter(lambda p: p[0] not in core_features or core_features[p[0]], peripherals)
    peripherals = sorted(peripherals, key=lambda p: p[0])
    # print("\n".join([s+" -> "+hex(a) for (s,k,a) in peripherals]))
    # Find all RCC enable and reset definitions
    match = re.findall(r"RCC_([A-Z0-9]*?)_([A-Z0-9]+?)(EN|RST) ", content)
    rcc_map = defaultdict(dict)
    for (reg, per, typ) in match:
        rcc_map[per][typ] = reg
    bprops["peripherals"] = peripherals
    return rcc_map