Import('env')

env = env.Clone()

#------------------------------------------------------------------------------
# Generate HWIO files
#------------------------------------------------------------------------------
if env.has_key('HWIO_IMAGE'):
  env.AddHWIOFile('HWIO', [
    {
      'filename': '${BUILD_ROOT}/core/bsp/rpm/target/${MSM_ID}/gcc_rpm_branch_ena_vote_hwio.h',
      'modules': [
        'GCC_CLK_CTL_REG',
      ],
      'module-filter-include': {
        'GCC_CLK_CTL_REG': ['RPM_CLOCK_BRANCH_ENA_VOTE'],
      },
      'output-fvals': True,
      'header': '''#include "msmhwiobase.h"''',
    },
  ])

  env.AddHWIOFile('HWIO', [
    {
      'filename': '${BUILD_ROOT}/core/bsp/rpm/target/${MSM_ID}/rpm_target_hwio.h',
      'modules': [
        'RPM_.+',
      ],
      'output-fvals': True,
      'header': '''#include "msmhwiobase.h"''',
    },
  ])

  env.AddHWIOFile('HWIO', [
    # Note: The 'filename' argument must have the correct path filled in.
    {
      'filename': '${BUILD_ROOT}/core/bsp/rpm/target/${MSM_ID}/tcsr_soc_hw_version_hwio.h',
      'modules': [
        'TCSR_TCSR_REGS',
      ],
      'module-filter-include': {
        'TCSR_TCSR_REGS': ['HW_VERSION'],
      },
      'output-fvals': True,
      'header': '''#include "msmhwiobase.h"''',
    },
  ])


