/* * FPGA-driven PCIe clocks * * Historically these include the oscillator, clock B (slots 2/3/4) and * clock A (slot 1 and the CPU clock). Newer revs of the PCB shove * everything under a single PCIe clocks enable bit that happens to map * to the same bit position as the oscillator bit for earlier FPGA * versions. * * Given that the legacy clocks have the side-effect of shutting the CPU * off through the FPGA along with the PCI slots, we simply leave them in * their initial state and don't bother registering them with the clock * framework.
*/ staticint sdk7786_pcie_clk_enable(struct clk *clk)
{
fpga_write_reg(fpga_read_reg(PCIECR) | PCIECR_CLKEN, PCIECR); return 0;
}
staticint sdk7786_clk_init(void)
{ struct clk *clk; int ret;
/* * Only handle the EXTAL case, anyone interfacing a crystal * resonator will need to provide their own input clock.
*/ if (test_mode_pin(MODE_PIN9)) return -EINVAL;
clk = clk_get(NULL, "extal"); if (IS_ERR(clk)) return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333);
clk_put(clk);
/* * Setup the FPGA clocks.
*/
ret = clk_register(&sdk7786_pcie_clk); if (unlikely(ret)) {
pr_err("FPGA clock registration failed\n"); return ret;
}
/* * It can take up to 20us for the R8C to do its job, back off and * wait a bit until we've been shut off. Even though newer FPGA * versions don't set the ACK bit, the latency issue remains.
*/ while ((fpga_read_reg(PWRCR) & PWRCR_PDWNACK) == 0)
cpu_sleep();
}
/* Initialize the board */ staticvoid __init sdk7786_setup(char **cmdline_p)
{
pr_info("Renesas Technology Europe SDK7786 support:\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.