@ -67,51 +67,51 @@ struct atctmr_timer_regs {
u32 int_mask ; /* 0x38 */
} ;
struct atftmr _timer_platdata {
struct atcpit _timer_platdata {
u32 * regs ;
} ;
static int atftmr _timer_get_count ( struct udevice * dev , u64 * count )
static int atcpit _timer_get_count ( struct udevice * dev , u64 * count )
{
struct atftmr _timer_platdata * plat = dev - > platdata ;
struct atcpit _timer_platdata * plat = dev - > platdata ;
u32 val ;
val = ~ ( REG32_TMR ( CH_CNT ( 1 ) ) + 0xffffffff ) ;
* count = timer_conv_64 ( val ) ;
return 0 ;
}
static int atctmr _timer_probe ( struct udevice * dev )
static int atcpi t_timer_probe ( struct udevice * dev )
{
struct atftmr _timer_platdata * plat = dev - > platdata ;
struct atcpit _timer_platdata * plat = dev - > platdata ;
REG32_TMR ( CH_REL ( 1 ) ) = 0xffffffff ;
REG32_TMR ( CH_CTL ( 1 ) ) = APB_CLK | TMR_32 ;
REG32_TMR ( CH_EN ) | = CH_TMR_EN ( 1 , 0 ) ;
return 0 ;
}
static int atctme _timer_ofdata_to_platdata ( struct udevice * dev )
static int atcpi t_timer_ofdata_to_platdata ( struct udevice * dev )
{
struct atftmr _timer_platdata * plat = dev_get_platdata ( dev ) ;
struct atcpit _timer_platdata * plat = dev_get_platdata ( dev ) ;
plat - > regs = map_physmem ( devfdt_get_addr ( dev ) , 0x100 , MAP_NOCACHE ) ;
return 0 ;
}
static const struct timer_ops ag101p _timer_ops = {
. get_count = atftmr _timer_get_count ,
static const struct timer_ops atcpit _timer_ops = {
. get_count = atcpit _timer_get_count ,
} ;
static const struct udevice_id ag101p _timer_ids [ ] = {
static const struct udevice_id atcpit _timer_ids [ ] = {
{ . compatible = " andestech,atcpit100 " } ,
{ }
} ;
U_BOOT_DRIVER ( altera _timer ) = {
. name = " ae3xx _timer " ,
U_BOOT_DRIVER ( atcpit100 _timer ) = {
. name = " atcpit100 _timer " ,
. id = UCLASS_TIMER ,
. of_match = ag101p _timer_ids ,
. ofdata_to_platdata = atctme _timer_ofdata_to_platdata ,
. platdata_auto_alloc_size = sizeof ( struct atftmr _timer_platdata ) ,
. probe = atctmr _timer_probe ,
. ops = & ag101p _timer_ops ,
. of_match = atcpit _timer_ids ,
. ofdata_to_platdata = atcpi t_timer_ofdata_to_platdata ,
. platdata_auto_alloc_size = sizeof ( struct atcpit _timer_platdata ) ,
. probe = atcpi t_timer_probe ,
. ops = & atcpit _timer_ops ,
. flags = DM_FLAG_PRE_RELOC ,
} ;