Lines Matching refs:gpmc

30 #include <linux/omap-gpmc.h>
36 #define DEVICE_NAME "omap-gpmc"
203 /* Structure to save gpmc cs context */
216 * Structure to save/restore gpmc context
411 * @name: DTS node name, w/o "gpmc,"
415 * raw format: gpmc,name = <value>
416 * tick format: gpmc,name = <value> /&zwj;* x ns -- y ns; x ticks *&zwj;/
456 pr_info("gpmc,%s = <%u>; /* %u ns - %u ns; %i ticks%s*/\n",
461 pr_info("gpmc,%s = <%u>;%s\n", name, l,
488 pr_info("gpmc cs%i %s:\n", cs, desc);
498 * Note that gpmc,wait-pin handing wrongly assumes bit 8 is available,
505 pr_info("gpmc cs%i access configuration:\n", cs);
518 GPMC_GET_RAW_BOOL(GPMC_CS_CONFIG1, 29, 29, "gpmc,sync-read");
532 pr_info("gpmc cs%i timings configuration:\n", cs);
702 * Calculate GPMCFCLKDIVIDER independent of gpmc,sync-clk-ps in DT for
907 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
909 gpmc->flags |= GPMC_CS_RESERVED;
914 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
916 return gpmc->flags & GPMC_CS_RESERVED;
935 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
936 struct resource *res = &gpmc->mem;
951 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
952 struct resource *res = &gpmc->mem;
966 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
967 struct resource *res = &gpmc->mem;
1012 struct gpmc_cs_data *gpmc;
1021 gpmc = &gpmc_cs[cs];
1022 res = &gpmc->mem;
1033 * gpmc_configure - write request to configure gpmc
1335 struct gpmc_device *gpmc = d->host_data;
1337 irq_set_chip_data(virq, gpmc);
1340 irq_set_chip_and_handler(virq, &gpmc->irq_chip,
1343 irq_set_chip_and_handler(virq, &gpmc->irq_chip,
1359 struct gpmc_device *gpmc = data;
1367 for (hwirq = 0; hwirq < gpmc->nirqs; hwirq++) {
1375 dev_warn(gpmc->dev,
1389 static int gpmc_setup_irq(struct gpmc_device *gpmc)
1401 gpmc->irq_chip.name = "gpmc";
1402 gpmc->irq_chip.irq_enable = gpmc_irq_enable;
1403 gpmc->irq_chip.irq_disable = gpmc_irq_disable;
1404 gpmc->irq_chip.irq_ack = gpmc_irq_ack;
1405 gpmc->irq_chip.irq_mask = gpmc_irq_mask;
1406 gpmc->irq_chip.irq_unmask = gpmc_irq_unmask;
1407 gpmc->irq_chip.irq_set_type = gpmc_irq_set_type;
1409 gpmc_irq_domain = irq_domain_add_linear(gpmc->dev->of_node,
1410 gpmc->nirqs,
1412 gpmc);
1414 dev_err(gpmc->dev, "IRQ domain add failed\n");
1418 rc = request_irq(gpmc->irq, gpmc_handle_irq, 0, "gpmc", gpmc);
1420 dev_err(gpmc->dev, "failed to request irq %d: %d\n",
1421 gpmc->irq, rc);
1429 static int gpmc_free_irq(struct gpmc_device *gpmc)
1433 free_irq(gpmc->irq, gpmc);
1435 for (hwirq = 0; hwirq < gpmc->nirqs; hwirq++)
1882 { .compatible = "ti,omap2420-gpmc" },
1883 { .compatible = "ti,omap2430-gpmc" },
1884 { .compatible = "ti,omap3430-gpmc" }, /* omap3430 & omap3630 */
1885 { .compatible = "ti,omap4430-gpmc" }, /* omap4430 & omap4460 & omap543x */
1886 { .compatible = "ti,am3352-gpmc" }, /* am335x devices */
1892 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
1894 gpmc->name = name;
1899 struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
1901 return gpmc->name;
1948 * gpmc_read_settings_dt - read gpmc settings from device-tree
1949 * @np: pointer to device-tree node for a gpmc child device
1950 * @p: pointer to gpmc settings structure
1961 p->sync_read = of_property_read_bool(np, "gpmc,sync-read");
1962 p->sync_write = of_property_read_bool(np, "gpmc,sync-write");
1963 of_property_read_u32(np, "gpmc,device-width", &p->device_width);
1964 of_property_read_u32(np, "gpmc,mux-add-data", &p->mux_add_data);
1966 if (!of_property_read_u32(np, "gpmc,burst-length", &p->burst_len)) {
1967 p->burst_wrap = of_property_read_bool(np, "gpmc,burst-wrap");
1968 p->burst_read = of_property_read_bool(np, "gpmc,burst-read");
1969 p->burst_write = of_property_read_bool(np, "gpmc,burst-write");
1975 if (!of_property_read_u32(np, "gpmc,wait-pin", &p->wait_pin)) {
1977 "gpmc,wait-on-read");
1979 "gpmc,wait-on-write");
1997 of_property_read_u32(np, "gpmc,sync-clk-ps", &gpmc_t->sync_clk);
2000 of_property_read_u32(np, "gpmc,cs-on-ns", &gpmc_t->cs_on);
2001 of_property_read_u32(np, "gpmc,cs-rd-off-ns", &gpmc_t->cs_rd_off);
2002 of_property_read_u32(np, "gpmc,cs-wr-off-ns", &gpmc_t->cs_wr_off);
2005 of_property_read_u32(np, "gpmc,adv-on-ns", &gpmc_t->adv_on);
2006 of_property_read_u32(np, "gpmc,adv-rd-off-ns", &gpmc_t->adv_rd_off);
2007 of_property_read_u32(np, "gpmc,adv-wr-off-ns", &gpmc_t->adv_wr_off);
2008 of_property_read_u32(np, "gpmc,adv-aad-mux-on-ns",
2010 of_property_read_u32(np, "gpmc,adv-aad-mux-rd-off-ns",
2012 of_property_read_u32(np, "gpmc,adv-aad-mux-wr-off-ns",
2016 of_property_read_u32(np, "gpmc,we-on-ns", &gpmc_t->we_on);
2017 of_property_read_u32(np, "gpmc,we-off-ns", &gpmc_t->we_off);
2020 of_property_read_u32(np, "gpmc,oe-on-ns", &gpmc_t->oe_on);
2021 of_property_read_u32(np, "gpmc,oe-off-ns", &gpmc_t->oe_off);
2022 of_property_read_u32(np, "gpmc,oe-aad-mux-on-ns",
2024 of_property_read_u32(np, "gpmc,oe-aad-mux-off-ns",
2028 of_property_read_u32(np, "gpmc,page-burst-access-ns",
2030 of_property_read_u32(np, "gpmc,access-ns", &gpmc_t->access);
2031 of_property_read_u32(np, "gpmc,rd-cycle-ns", &gpmc_t->rd_cycle);
2032 of_property_read_u32(np, "gpmc,wr-cycle-ns", &gpmc_t->wr_cycle);
2033 of_property_read_u32(np, "gpmc,bus-turnaround-ns",
2035 of_property_read_u32(np, "gpmc,cycle2cycle-delay-ns",
2037 of_property_read_u32(np, "gpmc,wait-monitoring-ns",
2039 of_property_read_u32(np, "gpmc,clk-activation-ns",
2043 of_property_read_u32(np, "gpmc,wr-access-ns", &gpmc_t->wr_access);
2044 of_property_read_u32(np, "gpmc,wr-data-mux-bus-ns",
2051 of_property_read_bool(np, "gpmc,cycle2cycle-diffcsen");
2053 of_property_read_bool(np, "gpmc,cycle2cycle-samecsen");
2054 p->we_extra_delay = of_property_read_bool(np, "gpmc,we-extra-delay");
2055 p->oe_extra_delay = of_property_read_bool(np, "gpmc,oe-extra-delay");
2056 p->adv_extra_delay = of_property_read_bool(np, "gpmc,adv-extra-delay");
2057 p->cs_extra_delay = of_property_read_bool(np, "gpmc,cs-extra-delay");
2059 of_property_read_bool(np, "gpmc,time-para-granularity");
2063 * gpmc_probe_generic_child - configures the gpmc for a child device
2064 * @pdev: pointer to gpmc platform device
2081 struct gpmc_device *gpmc = platform_get_drvdata(pdev);
2127 /* CS must be disabled while making changes to gpmc configuration */
2132 * location in the gpmc address space. When booting with
2200 "%pOF has no 'gpmc,device-width' property\n",
2210 waitpin_desc = gpiochip_request_own_desc(&gpmc->gpio_chip,
2229 dev_err(&pdev->dev, "failed to set gpmc timings for: %pOFn\n",
2258 dev_err(&pdev->dev, "failed to create gpmc child %pOFn\n", child);
2278 ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-cs",
2292 ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-waitpins",
2363 static int gpmc_gpio_init(struct gpmc_device *gpmc)
2367 gpmc->gpio_chip.parent = gpmc->dev;
2368 gpmc->gpio_chip.owner = THIS_MODULE;
2369 gpmc->gpio_chip.label = DEVICE_NAME;
2370 gpmc->gpio_chip.ngpio = gpmc_nr_waitpins;
2371 gpmc->gpio_chip.get_direction = gpmc_gpio_get_direction;
2372 gpmc->gpio_chip.direction_input = gpmc_gpio_direction_input;
2373 gpmc->gpio_chip.direction_output = gpmc_gpio_direction_output;
2374 gpmc->gpio_chip.set = gpmc_gpio_set;
2375 gpmc->gpio_chip.get = gpmc_gpio_get;
2376 gpmc->gpio_chip.base = -1;
2378 ret = devm_gpiochip_add_data(gpmc->dev, &gpmc->gpio_chip, NULL);
2380 dev_err(gpmc->dev, "could not register gpio chip: %d\n", ret);
2392 struct gpmc_device *gpmc;
2394 gpmc = devm_kzalloc(&pdev->dev, sizeof(*gpmc), GFP_KERNEL);
2395 if (!gpmc)
2398 gpmc->dev = &pdev->dev;
2399 platform_set_drvdata(pdev, gpmc);
2415 gpmc->irq = res->start;
2458 dev_info(gpmc->dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),
2462 rc = gpmc_gpio_init(gpmc);
2466 gpmc->nirqs = GPMC_NR_NAND_IRQS + gpmc_nr_waitpins;
2467 rc = gpmc_setup_irq(gpmc);
2469 dev_err(gpmc->dev, "gpmc_setup_irq failed\n");
2487 struct gpmc_device *gpmc = platform_get_drvdata(pdev);
2489 gpmc_free_irq(gpmc);