#!/usr/bin/perl
use strict;
use warnings;
use FindBin qw($Bin);
use lib "$Bin/../../PerlLib";
use BRCM::GenConfig;

# $p will allow us to GET values from the PROFILE
# $c will allow us to SET (and GET and DRIVER_SETUP) on the config
# file as we transform it from a template to the final config

# arguments
# * profile file
# * config  file
my $p    = new BRCM::GenConfig(shift);
my $chip = $p->get('BRCM_CHIP');
my $c    = new BRCM::GenConfig( shift, Chip => $chip, Profile => $p );


if ( ( $chip =~ /^(63138|63148|4908|6858|6836|63158)$/ ) && $p->get("BUILD_SATA") ) {

    $c->set(
            [
            qw[ CONFIG_ATA CONFIG_SATA_AHCI CONFIG_SATA_AHCI_PLATFORM ]
            ],
            'm'
           );

    $c->set( 'CONFIG_ATA_VERBOSE_ERROR', 'y' );


    $c->driver_setup("SATA_TEST", "SATA_TEST"); 
    
}
$c->write();
