Firstly, what architecture are you targeting. Some architectures have the kernel symbol CONFIG_DEVMEM defined, some don't. If it's not defined, the device node won't exist. For example, my x86_64 router has a /dev/mem, however my WRT1200AC does not, because the kernel config option is not enabled. If it's not enabled, you'll need to create a new kernel with the relevant config option enabled.
Moving beyond the basics (lack of a CONFIG_DEVMEM=y in the kernel config is almost certainly why /dev/mem does not exist), why are you trying to write directly to /dev/mem? This is a pretty dangerous thing to do unless you know exactly what you're doing.
On devices with CONFIG_DEVMEM enabled, OpenWrt kernel is compiled with CONFIG_STRICT_DEVMEM. Quoting directly from the manpage
Since Linux 2.6.26, and depending on the architecture, the
CONFIG_STRICT_DEVMEM kernel configuration option limits the areas
which can be accessed through this file. For example: on x86, RAM
access is not allowed but accessing memory-mapped PCI regions is.
So even if it IS enabled, you may not be able to write to it in the way you desire.