1 /* 2 * Copyright (c) 2015 MediaTek Inc. 3 * 4 * Use of this source code is governed by a MIT-style 5 * license that can be found in the LICENSE file or at 6 * https://opensource.org/licenses/MIT 7 */ 8 #pragma once 9 10 #include <arch/arm.h> 11 12 #define dsb() DSB 13 14 #define mt_reg_sync_writel(v, a) \ 15 do { \ 16 *(volatile unsigned int *)(a) = (v); \ 17 dsb(); \ 18 } while (0) 19 20 #define mt_reg_sync_writew(v, a) \ 21 do { \ 22 *(volatile unsigned short *)(a) = (v); \ 23 dsb(); \ 24 } while (0) 25 26 #define mt_reg_sync_writeb(v, a) \ 27 do { \ 28 *(volatile unsigned char *)(a) = (v); \ 29 dsb(); \ 30 } while (0) 31 32