Christophe Leroy | d8f34da | 2023-05-03 08:50:55 +0200 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | /* |
| 4 | * Microcode patches for the CPM as supplied by Motorola. |
| 5 | */ |
| 6 | |
| 7 | #include <linux/string.h> |
| 8 | #include <linux/io.h> |
| 9 | #include <asm/immap_8xx.h> |
| 10 | #include <asm/cpm_8xx.h> |
| 11 | |
| 12 | /* |
| 13 | * USB SOF patch arrays. |
| 14 | */ |
| 15 | static uint patch_2000[] = { |
| 16 | 0x7fff0000, 0x7ffd0000, 0x7ffb0000, 0x49f7ba5b, |
| 17 | 0xba383ffb, 0xf9b8b46d, 0xe5ab4e07, 0xaf77bffe, |
| 18 | 0x3f7bbf79, 0xba5bba38, 0xe7676076, 0x60750000 |
| 19 | }; |
| 20 | |
| 21 | static uint patch_2f00[] = { |
| 22 | 0x3030304c, 0xcab9e441, 0xa1aaf220 |
| 23 | }; |
| 24 | |
| 25 | void cpm_load_patch(cpm8xx_t __iomem *cp) |
| 26 | { |
| 27 | out_be16(&cp->cp_rccr, 0); |
| 28 | |
| 29 | memcpy_toio(cp->cp_dpmem, patch_2000, sizeof(patch_2000)); |
| 30 | memcpy_toio(cp->cp_dpmem + 0xf00, patch_2f00, sizeof(patch_2f00)); |
| 31 | |
| 32 | out_be16(&cp->cp_cpmcr1, 0); |
| 33 | out_be16(&cp->cp_cpmcr2, 0); |
| 34 | out_be16(&cp->cp_cpmcr3, 0); |
| 35 | out_be16(&cp->cp_cpmcr4, 0); |
| 36 | |
| 37 | out_be16(&cp->cp_rccr, 9); |
| 38 | } |