Lines Matching full:cs
172 const struct stm32_fmc2_prop *prop, int cs);
173 u32 (*calculate)(struct stm32_fmc2_ebi *ebi, int cs, u32 setup);
176 int cs, u32 setup);
181 int cs) in stm32_fmc2_ebi_check_mux() argument
186 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_mux()
198 int cs) in stm32_fmc2_ebi_check_waitcfg() argument
203 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_waitcfg()
215 int cs) in stm32_fmc2_ebi_check_sync_trans() argument
220 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_sync_trans()
232 int cs) in stm32_fmc2_ebi_check_async_trans() argument
237 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_async_trans()
249 int cs) in stm32_fmc2_ebi_check_cpsize() argument
254 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_cpsize()
266 int cs) in stm32_fmc2_ebi_check_address_hold() argument
271 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_address_hold()
276 ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
278 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
291 int cs) in stm32_fmc2_ebi_check_clk_period() argument
296 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_clk_period()
300 if (cs) { in stm32_fmc2_ebi_check_clk_period()
308 if (bcr & FMC2_BCR_BURSTEN && (!cs || !(bcr1 & FMC2_BCR1_CCLKEN))) in stm32_fmc2_ebi_check_clk_period()
316 int cs) in stm32_fmc2_ebi_check_cclk() argument
318 if (cs) in stm32_fmc2_ebi_check_cclk()
321 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_check_cclk()
325 int cs, u32 setup) in stm32_fmc2_ebi_ns_to_clock_cycles() argument
334 int cs, u32 setup) in stm32_fmc2_ebi_ns_to_clk_period() argument
336 u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup); in stm32_fmc2_ebi_ns_to_clk_period()
344 if (bcr & FMC2_BCR1_CCLKEN || !cs) in stm32_fmc2_ebi_ns_to_clk_period()
347 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &btr); in stm32_fmc2_ebi_ns_to_clk_period()
356 static int stm32_fmc2_ebi_get_reg(int reg_type, int cs, u32 *reg) in stm32_fmc2_ebi_get_reg() argument
360 *reg = FMC2_BCR(cs); in stm32_fmc2_ebi_get_reg()
363 *reg = FMC2_BTR(cs); in stm32_fmc2_ebi_get_reg()
366 *reg = FMC2_BWTR(cs); in stm32_fmc2_ebi_get_reg()
380 int cs, u32 setup) in stm32_fmc2_ebi_set_bit_field() argument
385 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, ®); in stm32_fmc2_ebi_set_bit_field()
397 int cs, u32 setup) in stm32_fmc2_ebi_set_trans_type() argument
520 regmap_update_bits(ebi->regmap, FMC2_BWTR(cs), in stm32_fmc2_ebi_set_trans_type()
522 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), btr_mask, btr); in stm32_fmc2_ebi_set_trans_type()
523 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), bcr_mask, bcr); in stm32_fmc2_ebi_set_trans_type()
530 int cs, u32 setup) in stm32_fmc2_ebi_set_buswidth() argument
546 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MWID, val); in stm32_fmc2_ebi_set_buswidth()
553 int cs, u32 setup) in stm32_fmc2_ebi_set_cpsize() argument
578 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_CPSIZE, val); in stm32_fmc2_ebi_set_cpsize()
585 int cs, u32 setup) in stm32_fmc2_ebi_set_bl_setup() argument
591 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_NBLSET, val); in stm32_fmc2_ebi_set_bl_setup()
598 int cs, u32 setup) in stm32_fmc2_ebi_set_address_setup() argument
604 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, ®); in stm32_fmc2_ebi_set_address_setup()
608 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_set_address_setup()
613 ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
615 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
631 int cs, u32 setup) in stm32_fmc2_ebi_set_address_hold() argument
636 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, ®); in stm32_fmc2_ebi_set_address_hold()
649 int cs, u32 setup) in stm32_fmc2_ebi_set_data_setup() argument
654 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, ®); in stm32_fmc2_ebi_set_data_setup()
667 int cs, u32 setup) in stm32_fmc2_ebi_set_bus_turnaround() argument
672 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, ®); in stm32_fmc2_ebi_set_bus_turnaround()
685 int cs, u32 setup) in stm32_fmc2_ebi_set_data_hold() argument
690 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, ®); in stm32_fmc2_ebi_set_data_hold()
706 int cs, u32 setup) in stm32_fmc2_ebi_set_clk_period() argument
712 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_CLKDIV, val); in stm32_fmc2_ebi_set_clk_period()
719 int cs, u32 setup) in stm32_fmc2_ebi_set_data_latency() argument
725 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_DATLAT, val); in stm32_fmc2_ebi_set_data_latency()
732 int cs, u32 setup) in stm32_fmc2_ebi_set_max_low_pulse() argument
746 FMC2_PCSCNTR_CNTBEN(cs), in stm32_fmc2_ebi_set_max_low_pulse()
747 FMC2_PCSCNTR_CNTBEN(cs)); in stm32_fmc2_ebi_set_max_low_pulse()
763 /* st,fmc2-ebi-cs-trans-type must be the first property */
765 .name = "st,fmc2-ebi-cs-transaction-type",
770 .name = "st,fmc2-ebi-cs-cclk-enable",
778 .name = "st,fmc2-ebi-cs-mux-enable",
786 .name = "st,fmc2-ebi-cs-buswidth",
791 .name = "st,fmc2-ebi-cs-waitpol-high",
798 .name = "st,fmc2-ebi-cs-waitcfg-enable",
806 .name = "st,fmc2-ebi-cs-wait-enable",
814 .name = "st,fmc2-ebi-cs-asyncwait-enable",
822 .name = "st,fmc2-ebi-cs-cpsize",
827 .name = "st,fmc2-ebi-cs-byte-lane-setup-ns",
832 .name = "st,fmc2-ebi-cs-address-setup-ns",
840 .name = "st,fmc2-ebi-cs-address-hold-ns",
848 .name = "st,fmc2-ebi-cs-data-setup-ns",
856 .name = "st,fmc2-ebi-cs-bus-turnaround-ns",
863 .name = "st,fmc2-ebi-cs-data-hold-ns",
870 .name = "st,fmc2-ebi-cs-clk-period-ns",
877 .name = "st,fmc2-ebi-cs-data-latency-ns",
883 .name = "st,fmc2-ebi-cs-write-address-setup-ns",
891 .name = "st,fmc2-ebi-cs-write-address-hold-ns",
899 .name = "st,fmc2-ebi-cs-write-data-setup-ns",
907 .name = "st,fmc2-ebi-cs-write-bus-turnaround-ns",
914 .name = "st,fmc2-ebi-cs-write-data-hold-ns",
921 .name = "st,fmc2-ebi-cs-max-low-pulse-ns",
930 int cs) in stm32_fmc2_ebi_parse_prop() argument
940 if (prop->check && prop->check(ebi, prop, cs)) in stm32_fmc2_ebi_parse_prop()
970 setup = prop->calculate(ebi, cs, val); in stm32_fmc2_ebi_parse_prop()
975 return prop->set(ebi, prop, cs, setup); in stm32_fmc2_ebi_parse_prop()
978 static void stm32_fmc2_ebi_enable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_enable_bank() argument
980 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), in stm32_fmc2_ebi_enable_bank()
984 static void stm32_fmc2_ebi_disable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_disable_bank() argument
986 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MBKEN, 0); in stm32_fmc2_ebi_disable_bank()
991 unsigned int cs; in stm32_fmc2_ebi_save_setup() local
994 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_save_setup()
995 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]); in stm32_fmc2_ebi_save_setup()
996 ret |= regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]); in stm32_fmc2_ebi_save_setup()
997 ret |= regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]); in stm32_fmc2_ebi_save_setup()
1007 unsigned int cs; in stm32_fmc2_ebi_set_setup() local
1009 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_set_setup()
1010 regmap_write(ebi->regmap, FMC2_BCR(cs), ebi->bcr[cs]); in stm32_fmc2_ebi_set_setup()
1011 regmap_write(ebi->regmap, FMC2_BTR(cs), ebi->btr[cs]); in stm32_fmc2_ebi_set_setup()
1012 regmap_write(ebi->regmap, FMC2_BWTR(cs), ebi->bwtr[cs]); in stm32_fmc2_ebi_set_setup()
1020 unsigned int cs; in stm32_fmc2_ebi_disable_banks() local
1022 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_disable_banks()
1023 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_disable_banks()
1026 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_disable_banks()
1034 unsigned int cs; in stm32_fmc2_ebi_nwait_used_by_ctrls() local
1038 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_nwait_used_by_ctrls()
1039 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_nwait_used_by_ctrls()
1042 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_nwait_used_by_ctrls()
1069 u32 cs) in stm32_fmc2_ebi_setup_cs() argument
1074 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()
1079 ret = stm32_fmc2_ebi_parse_prop(ebi, dev_node, p, cs); in stm32_fmc2_ebi_setup_cs()
1087 stm32_fmc2_ebi_enable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()