Commit 01a8765d authored by Federico Vaga's avatar Federico Vaga

WIP watch SPI registers

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent ac61b222
...@@ -56,19 +56,26 @@ int fd_pll_init(struct fd_dev *fd) ...@@ -56,19 +56,26 @@ int fd_pll_init(struct fd_dev *fd)
/* Write the magic config */ /* Write the magic config */
for (i = 0, r = __9516_regs; i < ARRAY_SIZE(__9516_regs); i++, r++) { for (i = 0, r = __9516_regs; i < ARRAY_SIZE(__9516_regs); i++, r++) {
i = pll_readl(fd, 0x1f);
// printk("0x%x Write PLL reg: reg %x val %x\n", i, r->val, r->reg);
if (pll_writel(fd, r->val, r->reg) < 0) { if (pll_writel(fd, r->val, r->reg) < 0) {
dev_err(dev, "Error in configuring PLL (step %i)\n", i); dev_err(dev, "Error in configuring PLL (step %i)\n", i);
return -EIO; return -EIO;
} }
} }
// i = pll_readl(fd, 0x003);
// printk("Before commit regs: ID %x\n", i);
if (pll_writel(fd, 0x01, 0x232) < 0) if (pll_writel(fd, 0x01, 0x232) < 0)
goto out; goto out;
i = pll_readl(fd, 0x003);
printk("After commit regs: ID %x\n", i);
/* Wait for it to lock */ /* Wait for it to lock */
j = jiffies + HZ / 2; j = jiffies + HZ / 2;
while (jiffies < j) { while (jiffies < j) {
i = pll_readl(fd, 0x1f); i = pll_readl(fd, 0x1f);
pr_info("0x%x", i);
if (i < 0) if (i < 0)
return -EIO; return -EIO;
if (i & 1) if (i & 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment