Lines Matching full:cs

234 		     const struct stm32_fmc2_prop *prop, int cs);
235 u32 (*calculate)(struct stm32_fmc2_ebi *ebi, int cs, u32 setup);
238 int cs, u32 setup);
243 int cs) in stm32_fmc2_ebi_check_mux() argument
248 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_mux()
260 int cs) in stm32_fmc2_ebi_check_waitcfg() argument
265 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_waitcfg()
277 int cs) in stm32_fmc2_ebi_check_sync_trans() argument
282 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_sync_trans()
294 int cs) in stm32_fmc2_ebi_mp25_check_cclk() argument
299 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_mp25_check_cclk()
304 int cs) in stm32_fmc2_ebi_mp25_check_clk_period() argument
316 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_mp25_check_clk_period()
321 int cs) in stm32_fmc2_ebi_check_async_trans() argument
326 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_async_trans()
338 int cs) in stm32_fmc2_ebi_check_cpsize() argument
343 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_cpsize()
355 int cs) in stm32_fmc2_ebi_check_address_hold() argument
360 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_address_hold()
365 ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
367 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
380 int cs) in stm32_fmc2_ebi_check_clk_period() argument
385 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_clk_period()
389 if (cs) { in stm32_fmc2_ebi_check_clk_period()
397 if (bcr & FMC2_BCR_BURSTEN && (!cs || !(bcr1 & FMC2_BCR1_CCLKEN))) in stm32_fmc2_ebi_check_clk_period()
405 int cs) in stm32_fmc2_ebi_check_cclk() argument
407 if (cs) in stm32_fmc2_ebi_check_cclk()
410 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_check_cclk()
414 int cs, u32 setup) in stm32_fmc2_ebi_ns_to_clock_cycles() argument
423 int cs, u32 setup) in stm32_fmc2_ebi_ns_to_clk_period() argument
425 u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup); in stm32_fmc2_ebi_ns_to_clk_period()
433 if (bcr & FMC2_BCR1_CCLKEN || !cs) in stm32_fmc2_ebi_ns_to_clk_period()
436 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &btr); in stm32_fmc2_ebi_ns_to_clk_period()
446 int cs, u32 setup) in stm32_fmc2_ebi_mp25_ns_to_clk_period() argument
448 u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup); in stm32_fmc2_ebi_mp25_ns_to_clk_period()
459 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &btr); in stm32_fmc2_ebi_mp25_ns_to_clk_period()
469 static int stm32_fmc2_ebi_get_reg(int reg_type, int cs, u32 *reg) in stm32_fmc2_ebi_get_reg() argument
473 *reg = FMC2_BCR(cs); in stm32_fmc2_ebi_get_reg()
476 *reg = FMC2_BTR(cs); in stm32_fmc2_ebi_get_reg()
479 *reg = FMC2_BWTR(cs); in stm32_fmc2_ebi_get_reg()
496 int cs, u32 setup) in stm32_fmc2_ebi_set_bit_field() argument
501 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_bit_field()
513 int cs, u32 setup) in stm32_fmc2_ebi_set_trans_type() argument
636 regmap_update_bits(ebi->regmap, FMC2_BWTR(cs), in stm32_fmc2_ebi_set_trans_type()
638 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), btr_mask, btr); in stm32_fmc2_ebi_set_trans_type()
639 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), bcr_mask, bcr); in stm32_fmc2_ebi_set_trans_type()
646 int cs, u32 setup) in stm32_fmc2_ebi_set_buswidth() argument
662 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MWID, val); in stm32_fmc2_ebi_set_buswidth()
669 int cs, u32 setup) in stm32_fmc2_ebi_set_cpsize() argument
694 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_CPSIZE, val); in stm32_fmc2_ebi_set_cpsize()
701 int cs, u32 setup) in stm32_fmc2_ebi_set_bl_setup() argument
707 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_NBLSET, val); in stm32_fmc2_ebi_set_bl_setup()
714 int cs, u32 setup) in stm32_fmc2_ebi_set_address_setup() argument
720 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_address_setup()
724 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_set_address_setup()
729 ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
731 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
747 int cs, u32 setup) in stm32_fmc2_ebi_set_address_hold() argument
752 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_address_hold()
765 int cs, u32 setup) in stm32_fmc2_ebi_set_data_setup() argument
770 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_data_setup()
783 int cs, u32 setup) in stm32_fmc2_ebi_set_bus_turnaround() argument
788 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_bus_turnaround()
801 int cs, u32 setup) in stm32_fmc2_ebi_set_data_hold() argument
806 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_data_hold()
822 int cs, u32 setup) in stm32_fmc2_ebi_set_clk_period() argument
828 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_CLKDIV, val); in stm32_fmc2_ebi_set_clk_period()
835 int cs, u32 setup) in stm32_fmc2_ebi_mp25_set_clk_period() argument
851 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_CLKDIV, val); in stm32_fmc2_ebi_mp25_set_clk_period()
859 int cs, u32 setup) in stm32_fmc2_ebi_set_data_latency() argument
865 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_DATLAT, val); in stm32_fmc2_ebi_set_data_latency()
872 int cs, u32 setup) in stm32_fmc2_ebi_set_max_low_pulse() argument
886 FMC2_PCSCNTR_CNTBEN(cs), in stm32_fmc2_ebi_set_max_low_pulse()
887 FMC2_PCSCNTR_CNTBEN(cs)); in stm32_fmc2_ebi_set_max_low_pulse()
904 int cs, u32 setup) in stm32_fmc2_ebi_mp25_set_max_low_pulse() argument
917 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), in stm32_fmc2_ebi_mp25_set_max_low_pulse()
924 /* st,fmc2-ebi-cs-trans-type must be the first property */
926 .name = "st,fmc2-ebi-cs-transaction-type",
931 .name = "st,fmc2-ebi-cs-cclk-enable",
939 .name = "st,fmc2-ebi-cs-mux-enable",
947 .name = "st,fmc2-ebi-cs-buswidth",
952 .name = "st,fmc2-ebi-cs-waitpol-high",
959 .name = "st,fmc2-ebi-cs-waitcfg-enable",
967 .name = "st,fmc2-ebi-cs-wait-enable",
975 .name = "st,fmc2-ebi-cs-asyncwait-enable",
983 .name = "st,fmc2-ebi-cs-cpsize",
988 .name = "st,fmc2-ebi-cs-byte-lane-setup-ns",
993 .name = "st,fmc2-ebi-cs-address-setup-ns",
1001 .name = "st,fmc2-ebi-cs-address-hold-ns",
1009 .name = "st,fmc2-ebi-cs-data-setup-ns",
1017 .name = "st,fmc2-ebi-cs-bus-turnaround-ns",
1024 .name = "st,fmc2-ebi-cs-data-hold-ns",
1031 .name = "st,fmc2-ebi-cs-clk-period-ns",
1038 .name = "st,fmc2-ebi-cs-data-latency-ns",
1044 .name = "st,fmc2-ebi-cs-write-address-setup-ns",
1052 .name = "st,fmc2-ebi-cs-write-address-hold-ns",
1060 .name = "st,fmc2-ebi-cs-write-data-setup-ns",
1068 .name = "st,fmc2-ebi-cs-write-bus-turnaround-ns",
1075 .name = "st,fmc2-ebi-cs-write-data-hold-ns",
1082 .name = "st,fmc2-ebi-cs-max-low-pulse-ns",
1089 /* st,fmc2-ebi-cs-trans-type must be the first property */
1091 .name = "st,fmc2-ebi-cs-transaction-type",
1096 .name = "st,fmc2-ebi-cs-cclk-enable",
1104 .name = "st,fmc2-ebi-cs-mux-enable",
1112 .name = "st,fmc2-ebi-cs-buswidth",
1117 .name = "st,fmc2-ebi-cs-waitpol-high",
1124 .name = "st,fmc2-ebi-cs-waitcfg-enable",
1132 .name = "st,fmc2-ebi-cs-wait-enable",
1140 .name = "st,fmc2-ebi-cs-asyncwait-enable",
1148 .name = "st,fmc2-ebi-cs-cpsize",
1153 .name = "st,fmc2-ebi-cs-byte-lane-setup-ns",
1158 .name = "st,fmc2-ebi-cs-address-setup-ns",
1166 .name = "st,fmc2-ebi-cs-address-hold-ns",
1174 .name = "st,fmc2-ebi-cs-data-setup-ns",
1182 .name = "st,fmc2-ebi-cs-bus-turnaround-ns",
1189 .name = "st,fmc2-ebi-cs-data-hold-ns",
1196 .name = "st,fmc2-ebi-cs-clk-period-ns",
1203 .name = "st,fmc2-ebi-cs-data-latency-ns",
1209 .name = "st,fmc2-ebi-cs-write-address-setup-ns",
1217 .name = "st,fmc2-ebi-cs-write-address-hold-ns",
1225 .name = "st,fmc2-ebi-cs-write-data-setup-ns",
1233 .name = "st,fmc2-ebi-cs-write-bus-turnaround-ns",
1240 .name = "st,fmc2-ebi-cs-write-data-hold-ns",
1247 .name = "st,fmc2-ebi-cs-max-low-pulse-ns",
1360 int cs) in stm32_fmc2_ebi_parse_prop() argument
1370 if (prop->check && prop->check(ebi, prop, cs)) in stm32_fmc2_ebi_parse_prop()
1400 setup = prop->calculate(ebi, cs, val); in stm32_fmc2_ebi_parse_prop()
1405 return prop->set(ebi, prop, cs, setup); in stm32_fmc2_ebi_parse_prop()
1408 static void stm32_fmc2_ebi_enable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_enable_bank() argument
1410 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), in stm32_fmc2_ebi_enable_bank()
1414 static void stm32_fmc2_ebi_disable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_disable_bank() argument
1416 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MBKEN, 0); in stm32_fmc2_ebi_disable_bank()
1421 unsigned int cs; in stm32_fmc2_ebi_save_setup() local
1424 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_save_setup()
1425 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_save_setup()
1428 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]); in stm32_fmc2_ebi_save_setup()
1429 ret |= regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]); in stm32_fmc2_ebi_save_setup()
1430 ret |= regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]); in stm32_fmc2_ebi_save_setup()
1465 unsigned int cs; in stm32_fmc2_ebi_set_setup() local
1467 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_set_setup()
1468 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_set_setup()
1471 regmap_write(ebi->regmap, FMC2_BCR(cs), ebi->bcr[cs]); in stm32_fmc2_ebi_set_setup()
1472 regmap_write(ebi->regmap, FMC2_BTR(cs), ebi->btr[cs]); in stm32_fmc2_ebi_set_setup()
1473 regmap_write(ebi->regmap, FMC2_BWTR(cs), ebi->bwtr[cs]); in stm32_fmc2_ebi_set_setup()
1493 unsigned int cs; in stm32_fmc2_ebi_disable_banks() local
1495 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_disable_banks()
1496 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_disable_banks()
1499 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_disable_banks()
1507 unsigned int cs; in stm32_fmc2_ebi_nwait_used_by_ctrls() local
1511 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_nwait_used_by_ctrls()
1512 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_nwait_used_by_ctrls()
1515 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_nwait_used_by_ctrls()
1550 u32 cs) in stm32_fmc2_ebi_setup_cs() argument
1555 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()
1560 ret = stm32_fmc2_ebi_parse_prop(ebi, dev_node, p, cs); in stm32_fmc2_ebi_setup_cs()
1568 stm32_fmc2_ebi_enable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()