Ignore:
Timestamp:
Mar 15, 2017, 2:42:58 AM (3 months ago)
Author:
brainslayer
Message:

use new squashfs in all kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/memory/atmel-ebi.c

    r31574 r31662  
    9494{
    9595        struct at91sam9_smc_generic_fields *fields = &ebid->ebi->sam9;
    96         unsigned int clk_rate = clk_get_rate(ebid->ebi->clk);
     96        unsigned int clk_period = NSEC_PER_SEC / clk_get_rate(ebid->ebi->clk);
    9797        struct at91sam9_ebi_dev_config *config = &conf->sam9;
    9898        struct at91sam9_smc_timings *timings = &config->timings;
     
    103103
    104104        val = (val & AT91_SMC_TDF) >> 16;
    105         timings->tdf_ns = clk_rate * val;
     105        timings->tdf_ns = clk_period * val;
    106106
    107107        regmap_fields_read(fields->setup, conf->cs, &val);
    108108        timings->ncs_rd_setup_ns = (val >> 24) & 0x1f;
    109109        timings->ncs_rd_setup_ns += ((val >> 29) & 0x1) * 128;
    110         timings->ncs_rd_setup_ns *= clk_rate;
     110        timings->ncs_rd_setup_ns *= clk_period;
    111111        timings->nrd_setup_ns = (val >> 16) & 0x1f;
    112112        timings->nrd_setup_ns += ((val >> 21) & 0x1) * 128;
    113         timings->nrd_setup_ns *= clk_rate;
     113        timings->nrd_setup_ns *= clk_period;
    114114        timings->ncs_wr_setup_ns = (val >> 8) & 0x1f;
    115115        timings->ncs_wr_setup_ns += ((val >> 13) & 0x1) * 128;
    116         timings->ncs_wr_setup_ns *= clk_rate;
     116        timings->ncs_wr_setup_ns *= clk_period;
    117117        timings->nwe_setup_ns = val & 0x1f;
    118118        timings->nwe_setup_ns += ((val >> 5) & 0x1) * 128;
    119         timings->nwe_setup_ns *= clk_rate;
     119        timings->nwe_setup_ns *= clk_period;
    120120
    121121        regmap_fields_read(fields->pulse, conf->cs, &val);
    122122        timings->ncs_rd_pulse_ns = (val >> 24) & 0x3f;
    123123        timings->ncs_rd_pulse_ns += ((val >> 30) & 0x1) * 256;
    124         timings->ncs_rd_pulse_ns *= clk_rate;
     124        timings->ncs_rd_pulse_ns *= clk_period;
    125125        timings->nrd_pulse_ns = (val >> 16) & 0x3f;
    126126        timings->nrd_pulse_ns += ((val >> 22) & 0x1) * 256;
    127         timings->nrd_pulse_ns *= clk_rate;
     127        timings->nrd_pulse_ns *= clk_period;
    128128        timings->ncs_wr_pulse_ns = (val >> 8) & 0x3f;
    129129        timings->ncs_wr_pulse_ns += ((val >> 14) & 0x1) * 256;
    130         timings->ncs_wr_pulse_ns *= clk_rate;
     130        timings->ncs_wr_pulse_ns *= clk_period;
    131131        timings->nwe_pulse_ns = val & 0x3f;
    132132        timings->nwe_pulse_ns += ((val >> 6) & 0x1) * 256;
    133         timings->nwe_pulse_ns *= clk_rate;
     133        timings->nwe_pulse_ns *= clk_period;
    134134
    135135        regmap_fields_read(fields->cycle, conf->cs, &val);
    136136        timings->nrd_cycle_ns = (val >> 16) & 0x7f;
    137137        timings->nrd_cycle_ns += ((val >> 23) & 0x3) * 256;
    138         timings->nrd_cycle_ns *= clk_rate;
     138        timings->nrd_cycle_ns *= clk_period;
    139139        timings->nwe_cycle_ns = val & 0x7f;
    140140        timings->nwe_cycle_ns += ((val >> 7) & 0x3) * 256;
    141         timings->nwe_cycle_ns *= clk_rate;
     141        timings->nwe_cycle_ns *= clk_period;
    142142}
    143143
     
    335335{
    336336        unsigned int clk_rate = clk_get_rate(ebid->ebi->clk);
     337        unsigned int clk_period = NSEC_PER_SEC / clk_rate;
    337338        struct at91sam9_ebi_dev_config *config = &conf->sam9;
    338339        struct at91sam9_smc_timings *timings = &config->timings;
     
    377378        regmap_fields_write(fields->cycle, conf->cs, val);
    378379
    379         val = DIV_ROUND_UP(timings->tdf_ns, clk_rate);
     380        val = DIV_ROUND_UP(timings->tdf_ns, clk_period);
    380381        if (val > AT91_SMC_TDF_MAX)
    381382                val = AT91_SMC_TDF_MAX;
Note: See TracChangeset for help on using the changeset viewer.